diff options
author | Minijackson <minijackson@riseup.net> | 2024-12-10 21:34:32 +0100 |
---|---|---|
committer | Minijackson <minijackson@riseup.net> | 2024-12-10 21:34:32 +0100 |
commit | 5cc889d066862ed881361a9cec3a593ffab53842 (patch) | |
tree | 61f617cc696d558da3996f4bcffb64b76c5f2b15 /common/vim.nix | |
parent | e4f6f4f20c164f7a0576113d94c677fcb86ebc6b (diff) | |
download | nixos-config-reborn-5cc889d066862ed881361a9cec3a593ffab53842.tar.gz nixos-config-reborn-5cc889d066862ed881361a9cec3a593ffab53842.zip |
treewide: remove old vim optionsHEADnixos-24.05
they aren't used since the addition of nixvim
Diffstat (limited to 'common/vim.nix')
-rw-r--r-- | common/vim.nix | 190 |
1 files changed, 0 insertions, 190 deletions
diff --git a/common/vim.nix b/common/vim.nix deleted file mode 100644 index 10a8705..0000000 --- a/common/vim.nix +++ /dev/null | |||
@@ -1,190 +0,0 @@ | |||
1 | inputs: { | ||
2 | config, | ||
3 | pkgs, | ||
4 | lib, | ||
5 | ... | ||
6 | }: let | ||
7 | inherit (pkgs.unstable) neovim-unwrapped vimPlugins wrapNeovim; | ||
8 | |||
9 | luaFormat = inputs.self.lib.generators.lua {}; | ||
10 | |||
11 | cfg = config.vim; | ||
12 | |||
13 | variables = with lib; | ||
14 | pkgs.writeTextDir "lua/myVariables.lua" '' | ||
15 | -- Autogenerated variables from the NixOS configuration | ||
16 | |||
17 | ${(concatStringsSep | ||
18 | "\n" | ||
19 | (mapAttrsToList | ||
20 | (variable: value: "vim.g.${variable} = ${luaFormat.generate value}") | ||
21 | cfg.variables))} | ||
22 | ''; | ||
23 | |||
24 | extraConfig = pkgs.writeTextDir "lua/myExtraConfig.lua" '' | ||
25 | -- luaConfig from the NixOS configuration | ||
26 | |||
27 | ${cfg.luaConfig} | ||
28 | ''; | ||
29 | |||
30 | myGeneratedConfigPackage = pkgs.symlinkJoin { | ||
31 | name = "myGeneratedConfig-nvim"; | ||
32 | paths = [variables extraConfig]; | ||
33 | }; | ||
34 | |||
35 | myConfigPackage = pkgs.unstable.vimUtils.buildVimPlugin { | ||
36 | name = "myConfig-nvim"; | ||
37 | src = ../dotfiles/vim; | ||
38 | }; | ||
39 | |||
40 | myNeovim = wrapNeovim neovim-unwrapped { | ||
41 | configure = { | ||
42 | inherit (config.vim) beforePlugins; | ||
43 | |||
44 | customRC = '' | ||
45 | lua require("myVariables") | ||
46 | lua require("myConfig") | ||
47 | lua require("myExtraConfig") | ||
48 | |||
49 | ${cfg.extraConfig} | ||
50 | ''; | ||
51 | |||
52 | packages.myVimPackage = with vimPlugins; { | ||
53 | start = | ||
54 | [ | ||
55 | myGeneratedConfigPackage | ||
56 | myConfigPackage | ||
57 | |||
58 | # Dependencies | ||
59 | plenary-nvim | ||
60 | popup-nvim | ||
61 | |||
62 | # UI | ||
63 | undotree | ||
64 | gruvbox-community | ||
65 | lualine-nvim | ||
66 | gitsigns-nvim | ||
67 | diffview-nvim | ||
68 | fidget-nvim | ||
69 | indent-blankline-nvim | ||
70 | oil-nvim | ||
71 | dressing-nvim | ||
72 | highlight-undo-nvim | ||
73 | |||
74 | # Completion | ||
75 | nvim-cmp | ||
76 | cmp-buffer | ||
77 | cmp-calc | ||
78 | cmp-cmdline | ||
79 | cmp-latex-symbols | ||
80 | cmp-nvim-lsp | ||
81 | cmp-path | ||
82 | cmp-spell | ||
83 | cmp-tmux | ||
84 | cmp-treesitter | ||
85 | cmp-vsnip | ||
86 | |||
87 | # Snippets | ||
88 | vim-vsnip | ||
89 | vim-vsnip-integ | ||
90 | |||
91 | # Telescope | ||
92 | telescope-nvim | ||
93 | telescope-undo-nvim | ||
94 | |||
95 | # Treesitter | ||
96 | nvim-treesitter.withAllGrammars | ||
97 | nvim-treesitter-textobjects | ||
98 | nvim-treesitter-context | ||
99 | nvim-treesitter-refactor | ||
100 | |||
101 | vim-matchup | ||
102 | |||
103 | # Motions | ||
104 | camelcasemotion | ||
105 | vim-surround | ||
106 | targets-vim | ||
107 | |||
108 | neoformat | ||
109 | |||
110 | # Languages | ||
111 | vim-polyglot | ||
112 | refactoring-nvim | ||
113 | |||
114 | # Other | ||
115 | comment-nvim | ||
116 | fugitive-gitlab-vim | ||
117 | none-ls-nvim | ||
118 | tabular | ||
119 | tmux-complete-vim | ||
120 | vim-abolish | ||
121 | vim-fugitive | ||
122 | vim-oscyank | ||
123 | vim-repeat | ||
124 | vim-rhubarb | ||
125 | vim-unimpaired | ||
126 | ] | ||
127 | ++ config.vim.extraPlugins; | ||
128 | }; | ||
129 | }; | ||
130 | }; | ||
131 | in { | ||
132 | options.vim = with lib; { | ||
133 | variables = mkOption { | ||
134 | type = types.attrsOf luaFormat.type; | ||
135 | default = {}; | ||
136 | description = "Extra global variables to add at the beginning of the vim configuration."; | ||
137 | }; | ||
138 | |||
139 | extraPlugins = mkOption { | ||
140 | type = with types; listOf package; | ||
141 | default = []; | ||
142 | description = "Names of extra plugins to add"; | ||
143 | }; | ||
144 | |||
145 | beforePlugins = mkOption { | ||
146 | type = types.lines; | ||
147 | default = ""; | ||
148 | description = "Extra lines to add in the vim configuration before loading plugins"; | ||
149 | }; | ||
150 | |||
151 | extraConfig = mkOption { | ||
152 | type = types.lines; | ||
153 | default = ""; | ||
154 | description = "Extra lines to add at the end of the vim configuration"; | ||
155 | }; | ||
156 | |||
157 | luaConfig = mkOption { | ||
158 | type = types.lines; | ||
159 | default = ""; | ||
160 | description = "Lua Neovim configuration"; | ||
161 | }; | ||
162 | |||
163 | wrappedPackage = mkOption { | ||
164 | type = types.package; | ||
165 | description = "Resulting wrapped Neovim package"; | ||
166 | readOnly = true; | ||
167 | }; | ||
168 | }; | ||
169 | |||
170 | config = { | ||
171 | vim = { | ||
172 | wrappedPackage = myNeovim; | ||
173 | variables = { | ||
174 | dominant_color = "${config.theme.colors.dominant}"; | ||
175 | ripgrep_path = "${pkgs.ripgrep}/bin/rg"; | ||
176 | fd_path = "${pkgs.fd}/bin/fd"; | ||
177 | }; | ||
178 | }; | ||
179 | |||
180 | # environment.systemPackages = [myNeovim]; | ||
181 | |||
182 | environment.variables = { | ||
183 | EDITOR = "nvim"; | ||
184 | MANPAGER = "nvim +Man!"; | ||
185 | }; | ||
186 | |||
187 | home-manager.users.minijackson.xdg.dataFile."nvim/backup/.keep".text = ""; | ||
188 | home-manager.users.root.xdg.dataFile."nvim/backup/.keep".text = ""; | ||
189 | }; | ||
190 | } | ||