updates for headless server

This commit is contained in:
Solomon Laing 2023-02-07 07:41:12 +10:30
parent d66226015b
commit aee457eb35
5 changed files with 119 additions and 113 deletions

View File

@ -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)"

View File

@ -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 = {
["<leader>."] = "@parameter.inner",
},
swap_previous = {
["<leader>,"] = "@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 = {
["<leader>."] = "@parameter.inner",
},
swap_previous = {
["<leader>,"] = "@parameter.inner",
},
},
},
})

View File

@ -18,7 +18,6 @@ return {
"help",
"javascript",
"typescript",
"sql",
"html",
"jsonc",
},

View File

@ -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

View File

@ -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