diff --git a/home-manager/modules/neovim.nix b/home-manager/modules/neovim.nix index 3ad9777..f91c967 100644 --- a/home-manager/modules/neovim.nix +++ b/home-manager/modules/neovim.nix @@ -1,6 +1,10 @@ { pkgs, ... }: { programs.neovim = { enable = true; + coc = { + enable = true; + }; + withPython3 = true; vimAlias = true; plugins = with pkgs.vimPlugins; [ @@ -11,7 +15,7 @@ neoformat # Colorscheme - vim-monokai + gruvbox-nvim # Fileexplorer in the sidebar nvim-tree-lua @@ -24,16 +28,74 @@ # git diff icons on the left sidebar vim-gitgutter + + # One languagepack to rule them all + vim-polyglot + + # blockcomments + tcomment_vim + + # Go plugin from fatih + vim-go ]; extraConfig = '' set mouse=a set termguicolors set background=dark set nu - colorscheme monokai + colorscheme gruvbox + set hlsearch + set tabstop=4 + set shiftwidth=4 + set softtabstop=4 + set expandtab + set cursorline + let mapleader = "," + + " Autosave when focus is lost + :au FocusLost * :wa + + ""Hotkeys + set pastetoggle= + nnoremap :nohlsearch + inoremap jj + + " Faster tab switching + map :bnext + map :bprevious + + " easier moving of code blocks + set hidden + vnoremap < >gv + + " Permanent undo history + set dir=~/.tmp/ + set backupdir=~/.tmp/bak + if v:version >= 703 + set undodir=~/.tmp/ + set undofile + set undolevels=100 + set undoreload=1000 + endif + + " Diasble polyglot for languages with their own plugin + let g:polyglot_disabled = ["go"] + + " vim-go + au FileType go nmap r (go-run) + au FileType go nmap b (go-build) + au FileType go nmap t (go-test) + let g:go_highlight_functions = 1 + let g:go_highlight_methods = 1 + let g:go_highlight_fields = 1 + let g:go_highlight_types = 1 + let g:go_highlight_operators = 1 + let g:go_highlight_build_constraints = 1 + lua << EOF - require("bufferline").setup{} - require("nvim-tree").setup{} + require("bufferline").setup{} + require("nvim-tree").setup{} EOF ''; };