123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- { lib
- , writeTextFile
- , neovim
- , fd
- , ripgrep
- , nodePackages
- , vimPlugins
- , vimUtils
- , fetchFromGitHub
- , withPlayground ? false
- }:
- let
- plenary-nvim = vimUtils.buildVimPluginFrom2Nix {
- name = "plenary-nvim";
- src = fetchFromGitHub {
- owner = "nvim-lua";
- repo = "plenary.nvim";
- rev = "986ad71ae930c7d96e812734540511b4ca838aa2";
- sha256 = "sha256-eBZTFEi7b2CBUakcamhwPcqjzaKg9tAGHNdc4XYUv78=";
- };
- };
- typescript-nvim = vimUtils.buildVimPluginFrom2Nix {
- name = "typescript-nvim";
- src = fetchFromGitHub {
- owner = "jose-elias-alvarez";
- repo = "typescript.nvim";
- rev = "e4b780d6b686585cb345e16d444fd3d303da91bb";
- sha256 = "sha256-7ZL7dqYUWW+JDeUjR5/ipnESpN/lG2HFz9BYgVNpJfk=";
- };
- dependencies = ["plenary-nvim"];
- };
- extra-treesitter-textobjects = writeTextFile {
- name = "extra-treesitter-textobjects";
- destination = "/after/queries/javascript/textobjects.scm";
- text = ''
- ; support swapping elements inside arrays too
- (array "," . (_) @parameter.inner)
- (array . (_) @parameter.inner ",")
- '';
- };
- extraPath = [
- fd
- ripgrep
- nodePackages.typescript-language-server
- nodePackages.eslint_d
- ];
- in
- neovim.override {
- extraMakeWrapperArgs = "--prefix PATH : ${lib.makeBinPath extraPath}";
- configure = {
- customRC = ''
- source ${./settings.lua}
- source ${./plugins.lua}
- source ${./mappings.lua}
- source ${./autocmd.lua}
- source ${./lsp.lua}
- source ${./theme.lua}
- '' + lib.optionalString withPlayground ''
- source ${./playground.lua}
- '';
- packages.myVimPackage = with vimPlugins; {
- start = [
- vim-sensible
- vim-sleuth
- vim-fugitive
- vim-rhubarb
- vim-surround
- vim-abolish
- undotree
- telescope-nvim
- telescope-fzf-native-nvim
- mini-nvim
- gitsigns-nvim
- sonokai
- plenary-nvim
- (nvim-treesitter.withPlugins (p: with p; [
- tree-sitter-bash
- tree-sitter-css
- tree-sitter-go
- tree-sitter-javascript
- tree-sitter-json
- tree-sitter-lua
- tree-sitter-nix
- tree-sitter-ruby
- tree-sitter-tsx
- tree-sitter-typescript
- ] ++ lib.optionals withPlayground [
- tree-sitter-query
- ]))
- nvim-treesitter-textobjects
- extra-treesitter-textobjects
- nvim-lspconfig
- typescript-nvim
- null-ls-nvim
- fidget-nvim
- ] ++ lib.optionals withPlayground [
- playground
- ];
- };
- };
- }
|