{ pkgs, ... }: let vim-nix = pkgs.vimUtils.buildVimPlugin { name = "vim-nix"; src = pkgs.fetchFromGitHub { owner = "LnL7"; repo = "vim-nix"; rev = "d733cb96707a2a6bdc6102b6d89f947688e0e959"; sha256 = "12k2gwm8b1n02361gpjhsldql99yd7qsh80a3lbwc5c5gz5j8jsb"; }; }; vim-catppuccino = pkgs.vimUtils.buildVimPlugin { name = "vim-catppuccino"; src = pkgs.fetchFromGitHub { owner = "Pocco81"; repo = "Catppuccino.nvim"; rev = "014d8575acdd19ecef4ecb12fc82a2e21794b548"; sha256 = "0i0p21jkrx99n3dnm5xvnw8n963c67l4lgl4iwngz0psdzwxphkw"; }; }; copilot-lua = pkgs.vimUtils.buildVimPlugin { name = "copilot.lua"; version = "2022-05-28"; src = pkgs.fetchFromGitHub { owner = "zbirenbaum"; repo = "copilot.lua"; rev = "77e3a4907928f0813024e573b882dc879dfc0c6b"; sha256 = "sha256-jBTS8MeN7Ydf0ZY7JWbrxaGo/GeDoEClfULiJVfN8Wo"; }; }; copilot-cmp = pkgs.vimUtils.buildVimPlugin { name = "copilot-cmp"; version = "2022-05-11"; src = pkgs.fetchFromGitHub { owner = "zbirenbaum"; repo = "copilot-cmp"; rev = "c2cdb3c0f5078b0619055af192295830a7987790"; sha256 = "sha256-+MzEGnhlrYRvAfskOwmw69OC1CsPXt7s3z+xPe9XPqs"; }; }; in with builtins; { programs.neovim = { enable = true; vimAlias = true; plugins = with pkgs.vimPlugins; [ vim-sensible vim-startify vim-catppuccino { plugin = fzf-vim; config = '' noremap fc :BCommits ''; } vim-elixir alchemist-vim vim-nix vim-javascript vim-json vim-jsx-pretty vim-commentary vim-airline { plugin = rainbow; config = '' let g:rainbow_conf = { \ 'guifgs': ['RoyalBlue3', 'SeaGreen3', 'DarkOrchid3', 'firebrick3', 'RoyalBlue3', 'SeaGreen3', 'DarkOrchid3', 'firebrick3', 'RoyalBlue3', 'DarkOrchid3', 'firebrick3', 'RoyalBlue3', 'SeaGreen3', 'DarkOrchid3', 'firebrick3'], \ 'ctermfgs': ['red', 'brown', 'blue', 'gray', 'green', 'magenta', 'cyan', 'darkred', 'brown', 'darkblue', 'gray', 'darkgreen', 'darkmagenta', 'darkcyan', 'red'], \ 'parentheses': ['start=/(/ end=/)/ fold', 'start=/\[/ end=/\]/ fold', 'start=/{/ end=/}/ fold'] \} let g:rainbow_active = 1 ''; } { plugin = vim-indent-guides; config = '' let g:indent_guides_enable_on_vim_startup = 1 let g:indent_guides_start_level = 2 ''; } vim-surround { plugin = vim-fugitive; config = '' nnoremap gb :Git blame ''; } { plugin = git-blame-nvim; config = '' let g:gitblame_date_format = '%Y-%m-%d' nnoremap gC :GitBlameOpenCommitURL ''; } { plugin = neogit; config = '' noremap g :Neogit lua << EOF local neogit = require('neogit') neogit.setup {} EOF ''; } vinegar { plugin = gitsigns-nvim; config = '' lua << EOF require('gitsigns').setup() EOF ''; } { plugin = undotree; config = '' nnoremap u :UndotreeToggle let g:undotree_SetFocusWhenToggle = 1 if has("persistent_undo") let target_path = expand('~/.undodir') " create the directory and any parent directories " if the location does not exist. if !isdirectory(target_path) call mkdir(target_path, "p", 0700) endif let &undodir=target_path set undofile endif ''; } cmp-nvim-lsp { plugin = nvim-lspconfig; config = '' lua << EOF ${readFile ( pkgs.substituteAll { src = ./nvim-lspconfig.lua; # since both of these are used for actually configuring the system, # we'll probably always want them around. lua_ls = pkgs.sumneko-lua-language-server; rnix_lsp = pkgs.rnix-lsp; } ) } EOF ''; } { plugin = telescope-nvim; config = '' nnoremap ff lua require('telescope.builtin').find_files() nnoremap fg lua require('telescope.builtin').live_grep() nnoremap fb lua require('telescope.builtin').buffers() nnoremap fh lua require('telescope.builtin').help_tags() ''; } { plugin = copilot-lua; config = '' lua << EOF vim.defer_fn(function() require('copilot').setup({ -- Disable these features because we're also using copilot-cmp suggestion = { enabled = false }, panel = { enabled = false }, copilot_node_command = '${pkgs.nodejs-18_x}/bin/node', }) end, 100) EOF ''; } { plugin = copilot-cmp; config = '' lua << EOF require('copilot_cmp').setup({}) EOF ''; } # have the completion plugin get loaded last just in case anything above # needs to do setup work before completions get set up. { plugin = nvim-cmp; config = '' lua << EOF ${ readFile (./nvim-cmp.lua) } EOF ''; } ]; extraConfig = readFile ./init.vim; }; }