From 1ca96a8ef255eec244f6c9406a75e3cb48dbaf08 Mon Sep 17 00:00:00 2001 From: Alejandro Angulo Date: Tue, 27 Sep 2022 18:51:29 -0700 Subject: [PATCH] wip --- users/alejandro/neovim.nix | 94 ++++++++++++++++++++++++++++---------- 1 file changed, 70 insertions(+), 24 deletions(-) diff --git a/users/alejandro/neovim.nix b/users/alejandro/neovim.nix index 3a4f57d..5508d75 100644 --- a/users/alejandro/neovim.nix +++ b/users/alejandro/neovim.nix @@ -17,10 +17,27 @@ # tree-sitter (code parser) (nvim-treesitter.withPlugins (_: pkgs.tree-sitter.allGrammars)) + # git integration + gitgutter + fugitive + rhubarb + + # coc plugins + coc-json + coc-yaml + coc-pyright + + # tmux integration + tmux-navigator + + vim-obsession + vim-nix + # Eye candy nvim-web-devicons # base16-vim nvim-base16 + { plugin = lualine-nvim; type = "lua"; @@ -261,23 +278,35 @@ + "''" + '' )} - " Mappings for CoCList - " Show all diagnostics. - nnoremap a :CocList diagnostics - " Manage extensions. - nnoremap e :CocList extensions - " Show commands. - nnoremap c :CocList commands - " Find symbol of current document. - nnoremap o :CocList outline - " Search workspace symbols. - nnoremap s :CocList -I symbols - " Do default action for next item. - nnoremap j :CocNext - " Do default action for previous item. - nnoremap k :CocPrev - " Resume latest coc list. - nnoremap p :CocListResume + " Mappings for CoCList + " Show all diagnostics. + nnoremap a :CocList diagnostics + " Manage extensions. + nnoremap e :CocList extensions + " Show commands. + nnoremap c :CocList commands + " Find symbol of current document. + nnoremap o :CocList outline + " Search workspace symbols. + nnoremap s :CocList -I symbols + " Do default action for next item. + nnoremap j :CocNext + " Do default action for previous item. + nnoremap k :CocPrev + " Resume latest coc list. + nnoremap p :CocListResume + + '' + # The below is custom and did not come from coc's README + + '' + " GoTo code navigation. + nmap gd (coc-definition) + nmap gs :call CocAction('jumpDefinition', 'split') + nmap gv :call CocAction('jumpDefinition', 'vsplit') + nmap gn :call CocAction('jumpDefinition', 'tabe') + nmap gy (coc-type-definition) + nmap gi (coc-implementation) + nmap gr (coc-references) ''; }; @@ -291,13 +320,17 @@ syntax on let mapleader = "`" - " Colorscheme - if !exists('g:colors_name') || g:colors_name != 'base16-darktooth' - set background=dark - let base16colorspace=256 - colorscheme base16-darktooth - hi Normal ctermbg=NONE guibg=NONE - endif + " Eye Candy (selects theme and sets up transparency) + colorscheme base16-darktooth + hi Normal guibg=none ctermbg=none + hi NormalNC guibg=NONE + hi LineNr guibg=none ctermbg=none + hi Folded guibg=none ctermbg=none + hi NonText guibg=none ctermbg=none + hi SpecialKey guibg=none ctermbg=none + hi VertSplit guibg=none ctermbg=none + hi SignColumn guibg=none ctermbg=none + hi EndOfBuffer guibg=none ctermbg=none " Toggle relative line numbers nmap num :set invrelativenumber @@ -307,6 +340,19 @@ nnoremap fg lua require('telescope.builtin').live_grep() nnoremap fb lua require('telescope.builtin').buffers() nnoremap fh lua require('telescope.builtin').help_tags() + + " coc + nnoremap cmd :CocCommand + nnoremap cfg :CocConfig + nnoremap def :call CocAction('jumpDefinition') + nnoremap fmt :call CocActionAsync('format') + + " rhubarb + noremap bro :GBrowse + + " Tab completion + set wildmode=longest,list,full + set wildmenu ''; }; }