diff --git a/moduler/common/vim.nix b/moduler/common/vim.nix new file mode 100644 index 0000000..a03c739 --- /dev/null +++ b/moduler/common/vim.nix @@ -0,0 +1,41 @@ +{ pkgs, lib, ... }: +{ + environment.variables = { EDITOR = "vim"; }; + + environment.systemPackages = with pkgs; [ + ((vim_configurable.override { }).customize{ + name = "vim"; + # Install plugins for example for syntax highlighting of nix files + vimrcConfig.packages.myplugins = with pkgs.vimPlugins; { + start = [ + vim-nix + vim-lastplace + vim-dracula + vim-sensible + vim-commentary + vim-fugitive + fzf-vim + YouCompleteMe + ]; + opt = []; + }; + vimrcConfig.customRC = '' + nnoremap e :Files + nnoremap w :w + nnoremap q :q + nnoremap :bnext + nnoremap :bprev + inoremap pumvisible() ? "\" : "\" + inoremap pumvisible() ? "\" : "\" + inoremap pumvisible() ? asyncomplete#close_popup() : "\" + + set cmdheight=1 + set relativenumber + set wrap + set shiftwidth=4 + set tabstop=4 + set termguicolors + ''; + } + )]; +}