From aee457eb3566cf2e6ea62e4f99f609abb6cf0b77 Mon Sep 17 00:00:00 2001 From: Solomon Laing Date: Tue, 7 Feb 2023 07:41:12 +1030 Subject: [PATCH] updates for headless server --- .config/bash/.bashrc | 8 + .config/nvim/lua/chris/treesitter.lua | 214 +++++++++--------- .../nvim/lua/lazyvim/plugins/treesitter.lua | 1 - .config/shell/inputrc | 4 - .config/zsh/.zshrc | 5 +- 5 files changed, 119 insertions(+), 113 deletions(-) diff --git a/.config/bash/.bashrc b/.config/bash/.bashrc index 6a63122..2950610 100644 --- a/.config/bash/.bashrc +++ b/.config/bash/.bashrc @@ -1,3 +1,5 @@ +#!/bin/bash + # If not running interactively, don't do anything case $- in *i*) ;; @@ -28,6 +30,12 @@ shopt -s checkwinsize # colored GCC warnings and errors export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' +# Add some custom keybinds + +bind '"\C-o":"lfcd\n"' +bind '"\C-t":"tms\n"' +bind '"\C-n":"zk edit --interactive --sort modified-\n"' + # use lf to switch directories and bind it to ctrl-o function lfcd() { tmp="$(mktemp -uq)" diff --git a/.config/nvim/lua/chris/treesitter.lua b/.config/nvim/lua/chris/treesitter.lua index b0391fd..a7ac32f 100644 --- a/.config/nvim/lua/chris/treesitter.lua +++ b/.config/nvim/lua/chris/treesitter.lua @@ -1,111 +1,111 @@ local status_ok, configs = pcall(require, "nvim-treesitter.configs") if not status_ok then - return + return end -configs.setup { - ensure_installed = "all", -- one of "all" or a list of languages - sync_install = false, -- install languages synchronously (only applied to `ensure_installed`) - ignore_install = { "phpdoc" }, -- List of parsers to ignore installing - matchup = { - enable = true, -- mandatory, false will disable the whole extension - disable_virtual_text = true, - disable = { "html" }, -- optional, list of language that will be disabled - }, - highlight = { - enable = true, -- false will disable the whole extension - disable = { "markdown" }, -- list of language that will be disabled - }, - autopairs = { - enable = true, - }, - indent = { enable = true, disable = { "python", "css", "rust" } }, - context_commentstring = { - enable = true, - enable_autocmd = false, - }, - autotag = { - enable = true, - disable = { "xml", "markdown" }, - }, - rainbow = { - enable = true, - extended_mode = false, - colors = { - -- "#68a0b0", - -- "#946EaD", - -- "#c7aA6D", - "Gold", - "Orchid", - "DodgerBlue", - -- "Cornsilk", - -- "Salmon", - -- "LawnGreen", - }, - disable = { "html" }, - }, - playground = { - enable = true, - }, - textobjects = { - select = { - enable = true, - -- Automatically jump forward to textobj, similar to targets.vim - lookahead = true, - keymaps = { - -- You can use the capture groups defined in textobjects.scm - ["af"] = "@function.outer", - ["if"] = "@function.inner", - ["at"] = "@class.outer", - ["it"] = "@class.inner", - ["ac"] = "@call.outer", - ["ic"] = "@call.inner", - ["aa"] = "@parameter.outer", - ["ia"] = "@parameter.inner", - ["al"] = "@loop.outer", - ["il"] = "@loop.inner", - ["ai"] = "@conditional.outer", - ["ii"] = "@conditional.inner", - ["a/"] = "@comment.outer", - ["i/"] = "@comment.inner", - ["ab"] = "@block.outer", - ["ib"] = "@block.inner", - ["as"] = "@statement.outer", - ["is"] = "@scopename.inner", - ["aA"] = "@attribute.outer", - ["iA"] = "@attribute.inner", - ["aF"] = "@frame.outer", - ["iF"] = "@frame.inner", - }, - }, - move = { - enable = true, - set_jumps = true, -- whether to set jumps in the jumplist - goto_next_start = { - ["]m"] = "@function.outer", - ["]]"] = "@class.outer", - }, - goto_next_end = { - ["]M"] = "@function.outer", - ["]["] = "@class.outer", - }, - goto_previous_start = { - ["[m"] = "@function.outer", - ["[["] = "@class.outer", - }, - goto_previous_end = { - ["[M"] = "@function.outer", - ["[]"] = "@class.outer", - }, - }, - swap = { - enable = true, - swap_next = { - ["."] = "@parameter.inner", - }, - swap_previous = { - [","] = "@parameter.inner", - }, - }, - }, -} +configs.setup({ + ensure_installed = "all", -- one of "all" or a list of languages + sync_install = false, -- install languages synchronously (only applied to `ensure_installed`) + ignore_install = { "phpdoc" }, -- List of parsers to ignore installing + matchup = { + enable = true, -- mandatory, false will disable the whole extension + disable_virtual_text = true, + disable = { "html" }, -- optional, list of language that will be disabled + }, + highlight = { + enable = true, -- false will disable the whole extension + disable = { "markdown" }, -- list of language that will be disabled + }, + autopairs = { + enable = true, + }, + indent = { enable = true, disable = { "python", "css", "rust" } }, + context_commentstring = { + enable = true, + enable_autocmd = false, + }, + autotag = { + enable = true, + disable = { "xml", "markdown" }, + }, + rainbow = { + enable = true, + extended_mode = false, + colors = { + -- "#68a0b0", + -- "#946EaD", + -- "#c7aA6D", + "Gold", + "Orchid", + "DodgerBlue", + -- "Cornsilk", + -- "Salmon", + -- "LawnGreen", + }, + disable = { "html" }, + }, + playground = { + enable = true, + }, + textobjects = { + select = { + enable = true, + -- Automatically jump forward to textobj, similar to targets.vim + lookahead = true, + keymaps = { + -- You can use the capture groups defined in textobjects.scm + ["af"] = "@function.outer", + ["if"] = "@function.inner", + ["at"] = "@class.outer", + ["it"] = "@class.inner", + ["ac"] = "@call.outer", + ["ic"] = "@call.inner", + ["aa"] = "@parameter.outer", + ["ia"] = "@parameter.inner", + ["al"] = "@loop.outer", + ["il"] = "@loop.inner", + ["ai"] = "@conditional.outer", + ["ii"] = "@conditional.inner", + ["a/"] = "@comment.outer", + ["i/"] = "@comment.inner", + ["ab"] = "@block.outer", + ["ib"] = "@block.inner", + ["as"] = "@statement.outer", + ["is"] = "@scopename.inner", + ["aA"] = "@attribute.outer", + ["iA"] = "@attribute.inner", + ["aF"] = "@frame.outer", + ["iF"] = "@frame.inner", + }, + }, + move = { + enable = true, + set_jumps = true, -- whether to set jumps in the jumplist + goto_next_start = { + ["]m"] = "@function.outer", + ["]]"] = "@class.outer", + }, + goto_next_end = { + ["]M"] = "@function.outer", + ["]["] = "@class.outer", + }, + goto_previous_start = { + ["[m"] = "@function.outer", + ["[["] = "@class.outer", + }, + goto_previous_end = { + ["[M"] = "@function.outer", + ["[]"] = "@class.outer", + }, + }, + swap = { + enable = true, + swap_next = { + ["."] = "@parameter.inner", + }, + swap_previous = { + [","] = "@parameter.inner", + }, + }, + }, +}) diff --git a/.config/nvim/lua/lazyvim/plugins/treesitter.lua b/.config/nvim/lua/lazyvim/plugins/treesitter.lua index 24c6350..fa3f0d0 100644 --- a/.config/nvim/lua/lazyvim/plugins/treesitter.lua +++ b/.config/nvim/lua/lazyvim/plugins/treesitter.lua @@ -18,7 +18,6 @@ return { "help", "javascript", "typescript", - "sql", "html", "jsonc", }, diff --git a/.config/shell/inputrc b/.config/shell/inputrc index c77f394..116f88b 100644 --- a/.config/shell/inputrc +++ b/.config/shell/inputrc @@ -1,9 +1,5 @@ $include /etc/inputrc -Control-o: lfcd -Control-t: tms -Control-n: zk edit --interactive --sort modified- - set editing-mode vi $if mode=vi diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 25915d0..7025e91 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -35,7 +35,8 @@ export LANG=en_US.UTF-8 # Preferred editor for local and remote sessions if [[ -n $SSH_CONNECTION ]]; then - export EDITOR='nano' + # Probably shoud be vim or vi or even nano but it's annoying me. + export EDITOR='nvim' else export EDITOR='nvim' fi @@ -189,6 +190,8 @@ fi if [ "$HOST" = "holocene" ] ; then source /usr/share/zsh/site-functions/zsh-syntax-highlighting.zsh +elif [ "$HOST" = "boost" ] ; then + source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh else source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh fi