From e8618900ab82b8b2297d69c23352e2f57fe269a0 Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Tue, 4 Jul 2023 15:42:14 +0200 Subject: [PATCH] a ton of vim ricing --- home/.config/nvim/ale.vim | 5 ++++ home/.config/nvim/alpha.vim | 4 --- home/.config/nvim/coc-settings.json | 3 ++- home/.config/nvim/coc.vim | 8 ++++++ home/.config/nvim/common.vim | 3 +++ home/.config/nvim/main.vim | 38 +++++++++-------------------- home/.config/nvim/nvim-tree.vim | 7 ------ home/.config/nvim/plugs.vim | 27 ++++++++++++++++++++ home/.config/nvim/rust.vim | 2 ++ home/.config/nvim/tagbar.vim | 1 + 10 files changed, 59 insertions(+), 39 deletions(-) create mode 100644 home/.config/nvim/ale.vim create mode 100644 home/.config/nvim/coc.vim create mode 100644 home/.config/nvim/plugs.vim create mode 100644 home/.config/nvim/rust.vim create mode 100644 home/.config/nvim/tagbar.vim diff --git a/home/.config/nvim/ale.vim b/home/.config/nvim/ale.vim new file mode 100644 index 0000000..5325264 --- /dev/null +++ b/home/.config/nvim/ale.vim @@ -0,0 +1,5 @@ +" navigate between errors quickly +nmap (ale_previous_wrap) +nmap (ale_next_wrap) +let g:ale_disable_lsp = 1 +let g:ale_use_neovim_diagnostics_api = 1 diff --git a/home/.config/nvim/alpha.vim b/home/.config/nvim/alpha.vim index 85b0ce3..2cffe0a 100644 --- a/home/.config/nvim/alpha.vim +++ b/home/.config/nvim/alpha.vim @@ -1,7 +1,3 @@ -call plug#begin() -Plug 'goolord/alpha-nvim' -call plug#end() - lua << EOF require('alpha').setup(require('alpha.themes.startify').config) EOF diff --git a/home/.config/nvim/coc-settings.json b/home/.config/nvim/coc-settings.json index e2bc1ae..fe45780 100644 --- a/home/.config/nvim/coc-settings.json +++ b/home/.config/nvim/coc-settings.json @@ -1,4 +1,5 @@ { "rust-analyzer.server.path": "/usr/bin/rust-analyzer", - "suggest.acceptSuggestionOnCommitCharacter": true + "suggest.acceptSuggestionOnCommitCharacter": true, + "diagnostic.displayByAle": true } diff --git a/home/.config/nvim/coc.vim b/home/.config/nvim/coc.vim new file mode 100644 index 0000000..5c6f517 --- /dev/null +++ b/home/.config/nvim/coc.vim @@ -0,0 +1,8 @@ +inoremap coc#pum#visible() ? coc#_select_confirm() : "\u\" +inoremap coc#pum#visible() ? coc#pum#next(1) : "\" +inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" + + +"CocInstall coc-clangd coc-cmake coc-css coc-floaterm coc-fzf-preview coc-git coc-html coc-json +"CocInstall coc-lists coc-lua coc-pyright coc-rust-analyzer coc-sh coc-snippets coc-sql +let g:coc_global_extensions = ['coc-json', 'coc-git', 'coc-clangd', 'coc-cmake', 'coc-css', 'coc-floaterm', 'coc-fzf-preview', 'coc-html', 'coc-json', 'coc-lists', 'coc-lua', 'coc-pyright', 'coc-rust-analyzer', 'coc-sh', 'coc-snippets', 'coc-sql', ] diff --git a/home/.config/nvim/common.vim b/home/.config/nvim/common.vim index 754d66b..4f78669 100644 --- a/home/.config/nvim/common.vim +++ b/home/.config/nvim/common.vim @@ -95,3 +95,6 @@ nnoremap :vertical resize -1 nnoremap :vertical resize +1 nnoremap :resize -1 nnoremap :resize +1 + +" remove extra gutter width for line numbers +set numberwidth=5 diff --git a/home/.config/nvim/main.vim b/home/.config/nvim/main.vim index 4021015..0e17e50 100644 --- a/home/.config/nvim/main.vim +++ b/home/.config/nvim/main.vim @@ -19,37 +19,24 @@ set completeopt=menuone,noinsert,noselect " Set completeopt to have a better completion experience" set completeopt=menuone,noinsert,noselect +" load vim plugged stuff +runtime plugs.vim " load plugins from extra files runtime nvim-tree.vim -call plug#begin() - -Plug 'glacambre/firenvim', { 'do': { _ -> firenvim#install(0) } } -Plug 'jiangmiao/auto-pairs' -Plug 'mhinz/vim-startify' -Plug 'neoclide/coc.nvim', {'branch': 'release'} -Plug 'psliwka/vim-smoothie' " scorll with STRG + d or STRG + u -Plug 'romgrk/barbar.nvim' " tabs for buffers -Plug 'EdenEast/nightfox.nvim' " Vim-Plug -Plug 'numToStr/FTerm.nvim' " floating terminal, toggle with -Plug 'kdheepak/lazygit.nvim' -Plug 'nvim-lualine/lualine.nvim' " nicer status line -Plug 'goolord/alpha-nvim' -Plug 'dhruvasagar/vim-table-mode' -Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } -Plug 'junegunn/fzf.vim' -Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app && yarn install' } -Plug 'nanotee/zoxide.vim' -Plug 'jpalardy/vim-slime', { 'for': 'python' } -Plug 'hanschen/vim-ipython-cell', { 'for': 'python' } +" plugin specific configs runtime markdownpreview.vim -call plug#end() - " load plugins from extra files runtime nvim-table-mode.vim +" load tabbar +runtime tagbar.vim + +" load ALE (another language server or something that works with COC) +runtime ale.vim + " no default mappings for vim smoothie (fancy scrolling) let g:smoothie_no_default_mappings = 1 @@ -108,7 +95,7 @@ nnoremap bw BufferOrderByWindowNumber " :BarbarEnable - enables barbar (enabled by default) " :BarbarDisable - very bad command, should never be used " -color terafox +color nightfox let g:lazygit_floating_window_winblend = 0 " transparency of floating window let g:lazygit_floating_window_scaling_factor = 0.9 " scaling factor for floating window @@ -122,11 +109,8 @@ let g:lazygit_config_file_path = '' " custom config file path " setup mapping to call :LazyGit nnoremap gg :LazyGit - " coc language server configs -inoremap coc#pum#visible() ? coc#_select_confirm() : "\u\" -inoremap coc#pum#visible() ? coc#pum#next(1) : "\" -inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" +runtime coc.vim " do these commands manually, they dont like being scripted. "CocInstall coc-clangd coc-cmake coc-css coc-floaterm coc-fzf-preview coc-git coc-html coc-json diff --git a/home/.config/nvim/nvim-tree.vim b/home/.config/nvim/nvim-tree.vim index 7149f3d..8775af1 100644 --- a/home/.config/nvim/nvim-tree.vim +++ b/home/.config/nvim/nvim-tree.vim @@ -1,13 +1,6 @@ -call plug#begin() -Plug 'nvim-tree/nvim-tree.lua' -Plug 'nvim-tree/nvim-web-devicons' -call plug#end() - - " Open NvimTree with f5" nnoremap :NvimTreeToggle - lua << EOF local HEIGHT_RATIO = 0.8 -- You can change this diff --git a/home/.config/nvim/plugs.vim b/home/.config/nvim/plugs.vim new file mode 100644 index 0000000..f279b71 --- /dev/null +++ b/home/.config/nvim/plugs.vim @@ -0,0 +1,27 @@ +call plug#begin() + +Plug 'glacambre/firenvim', { 'do': { _ -> firenvim#install(0) } } +Plug 'jiangmiao/auto-pairs' +Plug 'mhinz/vim-startify' +Plug 'neoclide/coc.nvim', {'branch': 'release'} +Plug 'psliwka/vim-smoothie' " scorll with STRG + d or STRG + u +Plug 'romgrk/barbar.nvim' " tabs for buffers +Plug 'EdenEast/nightfox.nvim' " Vim-Plug +Plug 'numToStr/FTerm.nvim' " floating terminal, toggle with +Plug 'kdheepak/lazygit.nvim' +Plug 'nvim-lualine/lualine.nvim' " nicer status line +Plug 'goolord/alpha-nvim' +Plug 'dhruvasagar/vim-table-mode' +Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } +Plug 'junegunn/fzf.vim' +Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app && yarn install' } +Plug 'nanotee/zoxide.vim' +Plug 'jpalardy/vim-slime', { 'for': 'python' } +Plug 'hanschen/vim-ipython-cell', { 'for': 'python' } +Plug 'nvim-tree/nvim-tree.lua' +Plug 'nvim-tree/nvim-web-devicons' +Plug 'rust-lang/rust.vim' +Plug 'preservim/tagbar' +Plug 'dense-analysis/ale' + +call plug#end() diff --git a/home/.config/nvim/rust.vim b/home/.config/nvim/rust.vim new file mode 100644 index 0000000..a983e6a --- /dev/null +++ b/home/.config/nvim/rust.vim @@ -0,0 +1,2 @@ +syntax enable +filetype plugin indent on diff --git a/home/.config/nvim/tagbar.vim b/home/.config/nvim/tagbar.vim new file mode 100644 index 0000000..d4fd1ba --- /dev/null +++ b/home/.config/nvim/tagbar.vim @@ -0,0 +1 @@ +nmap :TagbarToggle