diff --git a/home/private_dot_config/astronvim/executable_install.sh b/home/private_dot_config/astronvim/executable_install.sh index 807a3cc..1e281db 100644 --- a/home/private_dot_config/astronvim/executable_install.sh +++ b/home/private_dot_config/astronvim/executable_install.sh @@ -3,55 +3,55 @@ set -e deps=( - rg # ripgrep - lazygit - gdu - btm # bottom - python - node - tree-sitter + rg # ripgrep + lazygit + gdu + btm # bottom + python + node + tree-sitter ) # TODO: make sure tree-sitter is rust version? is-cmd() { - if [ -x "$(command -v "$1")" ]; then - return 0 - else - return 1 - fi + if [ -x "$(command -v "$1")" ]; then + return 0 + else + return 1 + fi } -install-astronvim(){ - echo "Installing astronvim" +install-astronvim() { + echo "Installing astronvim" - if [[ -d ~/.config/nvim ]]; then - echo "backing up old nvim config" - mv ~/.config/nvim ~/.config/nvim.bak-$(date +'%s') - fi + if [[ -d ~/.config/nvim ]]; then + echo "backing up old nvim config" + mv ~/.config/nvim ~/.config/nvim.bak-"$(date +'%s')" + fi - if [[ -d ~/.local/share/nvim ]]; then - echo "backing up old nvim directory" - mv ~/.local/share/nvim ~/.local/share/nvim-$(date +'%s') - mkdir ~/.local/share/nvim - fi + if [[ -d ~/.local/share/nvim ]]; then + echo "backing up old nvim directory" + mv ~/.local/share/nvim ~/.local/share/nvim-"$(date +'%s')" + mkdir ~/.local/share/nvim + fi - git clone https://github.com/AstroNvim/AstroNvim ~/.config/nvim + git clone https://github.com/AstroNvim/AstroNvim ~/.config/nvim - echo "add brute force method of ignoring version complaints" - git -C "$HOME/.config/nvim" am "$HOME/.config/astronvim/patches/0001-remove-version-check.patch" + echo "add brute force method of ignoring version complaints" + git -C "$HOME/.config/nvim" am "$HOME/.config/astronvim/patches/0001-remove-version-check.patch" - nvim --headless -c 'autocmd User PackerComplete quitall' + nvim --headless -c 'autocmd User PackerComplete quitall' } echo "Checking for optional dependencies" -check-dep(){ - if is-cmd "$1"; then - printf '%15s \033[32m%s\033[0m\n' "$1" 'yes' - else - printf '%15s \033[31m%s\033[0m\n' "$1" 'no' - fi +check-dep() { + if is-cmd "$1"; then + printf '%15s \033[32m%s\033[0m\n' "$1" 'yes' + else + printf '%15s \033[31m%s\033[0m\n' "$1" 'no' + fi } install-astronvim @@ -60,5 +60,5 @@ echo echo "checking for dependencies" for dep in "${deps[@]}"; do - check-dep "$dep" + check-dep "$dep" done diff --git a/home/private_dot_config/astronvim/lua/user/mappings.lua b/home/private_dot_config/astronvim/lua/user/mappings.lua index 5a7369c..43fe0ef 100644 --- a/home/private_dot_config/astronvim/lua/user/mappings.lua +++ b/home/private_dot_config/astronvim/lua/user/mappings.lua @@ -13,9 +13,36 @@ return { ["bj"] = { "BufferLinePick", desc = "Pick to jump" }, ["bt"] = { "BufferLineSortByTabs", desc = "Sort by tabs" }, ["bp"] = { ":bp", desc = "Previous Buffer" }, + -- disable default bindings + [""] = false, + [""] = false, + [""] = false, + [""] = false, + [""] = false, + [""] = false, + ["fh"] = false, + ["fm"] = false, + ["fn"] = false, + ["fo"] = false, + ["sb"] = false, + ["sc"] = false, + ["sh"] = false, + ["sk"] = false, + ["sm"] = false, + ["sn"] = false, + ["sr"] = false, + ["q:"] = "", + -- navigating wrapped lines + j = { "gj", desc = "Navigate down" }, + k = { "gk", desc = "Navigate down" }, }, t = { -- setting a mapping to false will disable it -- [""] = false, }, } + +-- map('n', 'j', "v:count ? 'j' : 'gj'", { expr = true, noremap = true }) +-- map('n', 'k', "v:count ? 'k' : 'gk'", { expr = true, noremap = true }) +-- map('n', "","}",{noremap = true}) +-- map('n', "","{",{noremap = true}) diff --git a/home/private_dot_config/astronvim/lua/user/options.lua b/home/private_dot_config/astronvim/lua/user/options.lua index 2467d9f..ad7fe40 100644 --- a/home/private_dot_config/astronvim/lua/user/options.lua +++ b/home/private_dot_config/astronvim/lua/user/options.lua @@ -1,4 +1,4 @@ --- from https://code.mehalter.com/projects/68/files-- from https://code.mehalter.com/projects/68/files +-- from https://code.mehalter.com/projects/68/files return { opt = { conceallevel = 2, -- enable conceal @@ -9,8 +9,9 @@ return { list = true, -- show whitespace characters listchars = { tab = "│→", extends = "⟩", precedes = "⟨", trail = "·", nbsp = "␣" }, showbreak = "↪ ", - spellfile = vim.fn.expand "~/.config/astronvim/lua/user/spell/en.utf-8.add", - thesaurus = vim.fn.expand "~/.config/astronvim/lua/user/spell/mthesaur.txt", + spellfile = vim.fn.expand("~/.config/astronvim/lua/user/spell/en.utf-8.add"), + timeoutlen = 300, + thesaurus = vim.fn.expand("~/.config/astronvim/lua/user/spell/mthesaur.txt"), wrap = true, -- soft wrap lines }, g = { diff --git a/home/private_dot_config/astronvim/lua/user/plugins/mason-lspconfig.lua b/home/private_dot_config/astronvim/lua/user/plugins/mason-lspconfig.lua new file mode 100644 index 0000000..3de9ccc --- /dev/null +++ b/home/private_dot_config/astronvim/lua/user/plugins/mason-lspconfig.lua @@ -0,0 +1,12 @@ +return { + ensure_installed = { + "cssls", + "gopls", + "html", + "jsonls", + "pyright", + "sumneko_lua", + "texlab", + "yamlls", + }, +} diff --git a/home/private_dot_config/astronvim/lua/user/plugins/mason-null-ls.lua b/home/private_dot_config/astronvim/lua/user/plugins/mason-null-ls.lua new file mode 100644 index 0000000..62dcc14 --- /dev/null +++ b/home/private_dot_config/astronvim/lua/user/plugins/mason-null-ls.lua @@ -0,0 +1,10 @@ +return { + ensure_installed = { + "shellcheck", + "stylua", + "black", + "isort", + "shfmt", + "shellcheck", + }, +} diff --git a/home/private_dot_config/astronvim/lua/user/plugins/which-key.lua b/home/private_dot_config/astronvim/lua/user/plugins/which-key.lua new file mode 100644 index 0000000..e8ac79a --- /dev/null +++ b/home/private_dot_config/astronvim/lua/user/plugins/which-key.lua @@ -0,0 +1 @@ +return { window = { border = "none" } } diff --git a/home/private_dot_config/astronvim/lua/user/polish.lua b/home/private_dot_config/astronvim/lua/user/polish.lua index 6ac1380..3af46e9 100644 --- a/home/private_dot_config/astronvim/lua/user/polish.lua +++ b/home/private_dot_config/astronvim/lua/user/polish.lua @@ -1,5 +1,5 @@ return function() - vim.cmd [[ + vim.cmd([[ autocmd BufNewFile,BufRead Knitfile set syntax=lua - ]] + ]]) end