diff options
-rw-r--r-- | nvim/.config/nvim/after/plugin/lsp.lua | 69 | ||||
-rw-r--r-- | nvim/.config/nvim/after/plugin/treesitter.lua | 23 | ||||
-rwxr-xr-x | nvim/.config/nvim/coc-settings.json | 14 | ||||
-rwxr-xr-x | nvim/.config/nvim/colors/jellybeans.vim | 748 | ||||
-rw-r--r--[-rwxr-xr-x] | nvim/.config/nvim/colors/pencil.vim | 0 | ||||
-rw-r--r-- | nvim/.config/nvim/colors/plain.vim | 85 | ||||
-rw-r--r-- | nvim/.config/nvim/init.lua | 3 | ||||
-rwxr-xr-x | nvim/.config/nvim/init.vim | 281 | ||||
-rw-r--r-- | nvim/.config/nvim/lua/map.lua | 47 | ||||
-rw-r--r-- | nvim/.config/nvim/lua/plugins.lua | 40 | ||||
-rw-r--r-- | nvim/.config/nvim/lua/set.lua | 55 | ||||
-rw-r--r-- | nvim/.config/nvim/lua/statusline/git.lua | 45 | ||||
-rw-r--r-- | nvim/.config/nvim/lua/statusline/line.lua | 32 | ||||
-rw-r--r-- | nvim/.config/nvim/lua/utils.lua | 18 | ||||
-rw-r--r-- | nvim/.config/nvim/plugin/packer_compiled.lua | 194 |
15 files changed, 578 insertions, 1076 deletions
diff --git a/nvim/.config/nvim/after/plugin/lsp.lua b/nvim/.config/nvim/after/plugin/lsp.lua new file mode 100644 index 0000000..675c2bd --- /dev/null +++ b/nvim/.config/nvim/after/plugin/lsp.lua | |||
@@ -0,0 +1,69 @@ | |||
1 | local lsp = require("lsp-zero") | ||
2 | |||
3 | lsp.preset("recommended") | ||
4 | |||
5 | lsp.ensure_installed({ | ||
6 | 'rust_analyzer', | ||
7 | }) | ||
8 | |||
9 | -- Fix Undefined global 'vim' | ||
10 | lsp.configure('sumneko_lua', { | ||
11 | settings = { | ||
12 | Lua = { | ||
13 | diagnostics = { | ||
14 | globals = { 'vim' } | ||
15 | } | ||
16 | } | ||
17 | } | ||
18 | }) | ||
19 | |||
20 | |||
21 | local cmp = require('cmp') | ||
22 | local cmp_select = {behavior = cmp.SelectBehavior.Select} | ||
23 | local cmp_mappings = lsp.defaults.cmp_mappings({ | ||
24 | ['<C-p>'] = cmp.mapping.select_prev_item(cmp_select), | ||
25 | ['<C-n>'] = cmp.mapping.select_next_item(cmp_select), | ||
26 | ['<C-y>'] = cmp.mapping.confirm({ select = true }), | ||
27 | ["<C-Space>"] = cmp.mapping.complete(), | ||
28 | }) | ||
29 | |||
30 | -- disable completion with tab | ||
31 | -- this helps with copilot setup | ||
32 | cmp_mappings['<Tab>'] = nil | ||
33 | cmp_mappings['<S-Tab>'] = nil | ||
34 | |||
35 | lsp.setup_nvim_cmp({ | ||
36 | mapping = cmp_mappings | ||
37 | }) | ||
38 | |||
39 | lsp.set_preferences({ | ||
40 | suggest_lsp_servers = false, | ||
41 | sign_icons = { | ||
42 | error = 'E', | ||
43 | warn = 'W', | ||
44 | hint = 'H', | ||
45 | info = 'I' | ||
46 | } | ||
47 | }) | ||
48 | |||
49 | lsp.on_attach(function(client, bufnr) | ||
50 | local opts = {buffer = bufnr, remap = false} | ||
51 | |||
52 | vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) | ||
53 | vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts) | ||
54 | vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts) | ||
55 | vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts) | ||
56 | vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts) | ||
57 | vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts) | ||
58 | vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts) | ||
59 | vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts) | ||
60 | vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts) | ||
61 | vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts) | ||
62 | end) | ||
63 | |||
64 | lsp.setup() | ||
65 | |||
66 | vim.diagnostic.config({ | ||
67 | virtual_text = true, | ||
68 | }) | ||
69 | |||
diff --git a/nvim/.config/nvim/after/plugin/treesitter.lua b/nvim/.config/nvim/after/plugin/treesitter.lua new file mode 100644 index 0000000..9d5d923 --- /dev/null +++ b/nvim/.config/nvim/after/plugin/treesitter.lua | |||
@@ -0,0 +1,23 @@ | |||
1 | require'nvim-treesitter.configs'.setup { | ||
2 | -- A list of parser names, or "all" | ||
3 | ensure_installed = { "help", "javascript", "typescript", "c", "lua", "rust" }, | ||
4 | |||
5 | -- Install parsers synchronously (only applied to `ensure_installed`) | ||
6 | sync_install = false, | ||
7 | |||
8 | -- Automatically install missing parsers when entering buffer | ||
9 | -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally | ||
10 | auto_install = true, | ||
11 | |||
12 | highlight = { | ||
13 | -- `false` will disable the whole extension | ||
14 | enable = true, | ||
15 | |||
16 | -- Setting this to true will run `:h syntax` and tree-sitter at the same time. | ||
17 | -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). | ||
18 | -- Using this option may slow down your editor, and you may see some duplicate highlights. | ||
19 | -- Instead of true it can also be a list of languages | ||
20 | additional_vim_regex_highlighting = false, | ||
21 | }, | ||
22 | } | ||
23 | |||
diff --git a/nvim/.config/nvim/coc-settings.json b/nvim/.config/nvim/coc-settings.json deleted file mode 100755 index 90df22a..0000000 --- a/nvim/.config/nvim/coc-settings.json +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | { | ||
2 | "pairs.enableCharacters": ["(", "[", "{", "'", "\"", "`"], | ||
3 | "suggest.noselect": false, | ||
4 | "coc.preferences.formatOnSaveFiletypes": [ | ||
5 | "javascript", | ||
6 | "typescript", | ||
7 | "typescriptreact", | ||
8 | "json", | ||
9 | "javascriptreact", | ||
10 | "typescript.tsx", | ||
11 | "graphql" | ||
12 | ], | ||
13 | "clangd.path": "/home/x/.config/coc/extensions/coc-clangd-data/install/10.0.0/clangd_10.0.0/bin/clangd" | ||
14 | } | ||
diff --git a/nvim/.config/nvim/colors/jellybeans.vim b/nvim/.config/nvim/colors/jellybeans.vim deleted file mode 100755 index bae6c69..0000000 --- a/nvim/.config/nvim/colors/jellybeans.vim +++ /dev/null | |||
@@ -1,748 +0,0 @@ | |||
1 | " Vim color file | ||
2 | " | ||
3 | " " __ _ _ _ " | ||
4 | " " \ \ ___| | |_ _| |__ ___ __ _ _ __ ___ " | ||
5 | " " \ \/ _ \ | | | | | _ \ / _ \/ _ | _ \/ __| " | ||
6 | " " /\_/ / __/ | | |_| | |_| | __/ |_| | | | \__ \ " | ||
7 | " " \___/ \___|_|_|\__ |____/ \___|\____|_| |_|___/ " | ||
8 | " " \___/ " | ||
9 | " | ||
10 | " "A colorful, dark color scheme for Vim." | ||
11 | " | ||
12 | " File: jellybeans.vim | ||
13 | " URL: github.com/nanotech/jellybeans.vim | ||
14 | " Scripts URL: vim.org/scripts/script.php?script_id=2555 | ||
15 | " Maintainer: NanoTech (nanotech.nanotechcorp.net) | ||
16 | " Version: 1.7 | ||
17 | " Last Change: June 21st, 2019 | ||
18 | " License: MIT | ||
19 | " Contributors: Andrew Wong (w0ng) | ||
20 | " Benjamin R. Haskell (benizi) | ||
21 | " Brian Marshall (bmars) | ||
22 | " Daniel Herbert (pocketninja) | ||
23 | " David Liang <bmdavll at gmail dot com> | ||
24 | " Filipe Silva (ninrod) | ||
25 | " Henry So, Jr. <henryso@panix.com> | ||
26 | " Ihor Kalnytskyi (ikalnytskyi) | ||
27 | " Joe Doherty (docapotamus) | ||
28 | " Karl Litterfeldt (Litterfeldt) | ||
29 | " Keith Pitt (keithpitt) | ||
30 | " Mike Schreifels (schreifels) | ||
31 | " Philipp Rustemeier (12foo) | ||
32 | " Rafael Bicalho (rbika) | ||
33 | " Rich Healey (richo) | ||
34 | " Siwen Yu (yusiwen) | ||
35 | " Tim Willis (willist) | ||
36 | " Tom McLaughlin (tmcoma) | ||
37 | " | ||
38 | " Copyright (c) 2009-2019 NanoTech | ||
39 | " | ||
40 | " Permission is hereby granted, free of charge, to any per‐ | ||
41 | " son obtaining a copy of this software and associated doc‐ | ||
42 | " umentation files (the “Software”), to deal in the Soft‐ | ||
43 | " ware without restriction, including without limitation | ||
44 | " the rights to use, copy, modify, merge, publish, distrib‐ | ||
45 | " ute, sublicense, and/or sell copies of the Software, and | ||
46 | " to permit persons to whom the Software is furnished to do | ||
47 | " so, subject to the following conditions: | ||
48 | " | ||
49 | " The above copyright notice and this permission notice | ||
50 | " shall be included in all copies or substantial portions | ||
51 | " of the Software. | ||
52 | " | ||
53 | " THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY | ||
54 | " KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO | ||
55 | " THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICU‐ | ||
56 | " LAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
57 | " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, | ||
58 | " DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CON‐ | ||
59 | " TRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON‐ | ||
60 | " NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
61 | " THE SOFTWARE. | ||
62 | |||
63 | set background=dark | ||
64 | |||
65 | hi clear | ||
66 | |||
67 | if exists("syntax_on") | ||
68 | syntax reset | ||
69 | endif | ||
70 | |||
71 | let colors_name = "jellybeans" | ||
72 | |||
73 | if has("gui_running") || (has('termguicolors') && &termguicolors) | ||
74 | let s:true_color = 1 | ||
75 | else | ||
76 | let s:true_color = 0 | ||
77 | endif | ||
78 | |||
79 | if s:true_color || &t_Co >= 88 | ||
80 | let s:low_color = 0 | ||
81 | else | ||
82 | let s:low_color = 1 | ||
83 | endif | ||
84 | |||
85 | " Configuration Variables: | ||
86 | " - g:jellybeans_overrides (default = {}) | ||
87 | " - g:jellybeans_use_lowcolor_black (default = 0) | ||
88 | " - g:jellybeans_use_gui_italics (default = 1) | ||
89 | " - g:jellybeans_use_term_italics (default = 0) | ||
90 | |||
91 | let s:background_color = "NONE" | ||
92 | let s:background_color = "000000" | ||
93 | |||
94 | if exists("g:jellybeans_overrides") | ||
95 | let s:overrides = g:jellybeans_overrides | ||
96 | else | ||
97 | let s:overrides = {} | ||
98 | endif | ||
99 | |||
100 | " Backwards compatibility | ||
101 | if exists("g:jellybeans_background_color") | ||
102 | \ || exists("g:jellybeans_background_color_256") | ||
103 | \ || exists("g:jellybeans_use_term_background_color") | ||
104 | |||
105 | let s:overrides = deepcopy(s:overrides) | ||
106 | |||
107 | if !has_key(s:overrides, "background") | ||
108 | let s:overrides["background"] = {} | ||
109 | endif | ||
110 | |||
111 | if exists("g:jellybeans_background_color") | ||
112 | let s:overrides["background"]["guibg"] = g:jellybeans_background_color | ||
113 | endif | ||
114 | |||
115 | if exists("g:jellybeans_background_color_256") | ||
116 | let s:overrides["background"]["256ctermbg"] = g:jellybeans_background_color_256 | ||
117 | endif | ||
118 | |||
119 | if exists("g:jellybeans_use_term_background_color") | ||
120 | \ && g:jellybeans_use_term_background_color | ||
121 | let s:overrides["background"]["ctermbg"] = "NONE" | ||
122 | let s:overrides["background"]["256ctermbg"] = "NONE" | ||
123 | endif | ||
124 | endif | ||
125 | |||
126 | if exists("g:jellybeans_use_lowcolor_black") && g:jellybeans_use_lowcolor_black | ||
127 | let s:termBlack = "Black" | ||
128 | else | ||
129 | let s:termBlack = "Grey" | ||
130 | endif | ||
131 | |||
132 | " When `termguicolors` is set, Vim[^1] ignores `hi Normal guibg=NONE` | ||
133 | " after Normal's `guibg` is already set to a color. See: | ||
134 | " | ||
135 | " - https://github.com/vim/vim/issues/981 | ||
136 | " - https://github.com/nanotech/jellybeans.vim/issues/64 | ||
137 | " | ||
138 | " To work around this, ensure we don't set the default background | ||
139 | " color before an override changes it to `NONE` by ensuring that the | ||
140 | " background color isn't set to a value different from its override. | ||
141 | " | ||
142 | " [^1]: Tested on 8.0.567. Does not apply to Neovim. | ||
143 | " | ||
144 | if has_key(s:overrides, "background") && has_key(s:overrides["background"], "guibg") | ||
145 | let s:background_color = s:overrides["background"]["guibg"] | ||
146 | endif | ||
147 | |||
148 | " Color approximation functions by Henry So, Jr. and David Liang {{{ | ||
149 | " Added to jellybeans.vim by Daniel Herbert | ||
150 | |||
151 | if &t_Co == 88 | ||
152 | |||
153 | " returns an approximate grey index for the given grey level | ||
154 | fun! s:grey_number(x) | ||
155 | if a:x < 23 | ||
156 | return 0 | ||
157 | elseif a:x < 69 | ||
158 | return 1 | ||
159 | elseif a:x < 103 | ||
160 | return 2 | ||
161 | elseif a:x < 127 | ||
162 | return 3 | ||
163 | elseif a:x < 150 | ||
164 | return 4 | ||
165 | elseif a:x < 173 | ||
166 | return 5 | ||
167 | elseif a:x < 196 | ||
168 | return 6 | ||
169 | elseif a:x < 219 | ||
170 | return 7 | ||
171 | elseif a:x < 243 | ||
172 | return 8 | ||
173 | else | ||
174 | return 9 | ||
175 | endif | ||
176 | endfun | ||
177 | |||
178 | " returns the actual grey level represented by the grey index | ||
179 | fun! s:grey_level(n) | ||
180 | if a:n == 0 | ||
181 | return 0 | ||
182 | elseif a:n == 1 | ||
183 | return 46 | ||
184 | elseif a:n == 2 | ||
185 | return 92 | ||
186 | elseif a:n == 3 | ||
187 | return 115 | ||
188 | elseif a:n == 4 | ||
189 | return 139 | ||
190 | elseif a:n == 5 | ||
191 | return 162 | ||
192 | elseif a:n == 6 | ||
193 | return 185 | ||
194 | elseif a:n == 7 | ||
195 | return 208 | ||
196 | elseif a:n == 8 | ||
197 | return 231 | ||
198 | else | ||
199 | return 255 | ||
200 | endif | ||
201 | endfun | ||
202 | |||
203 | " returns the palette index for the given grey index | ||
204 | fun! s:grey_color(n) | ||
205 | if a:n == 0 | ||
206 | return 16 | ||
207 | elseif a:n == 9 | ||
208 | return 79 | ||
209 | else | ||
210 | return 79 + a:n | ||
211 | endif | ||
212 | endfun | ||
213 | |||
214 | " returns an approximate color index for the given color level | ||
215 | fun! s:rgb_number(x) | ||
216 | if a:x < 69 | ||
217 | return 0 | ||
218 | elseif a:x < 172 | ||
219 | return 1 | ||
220 | elseif a:x < 230 | ||
221 | return 2 | ||
222 | else | ||
223 | return 3 | ||
224 | endif | ||
225 | endfun | ||
226 | |||
227 | " returns the actual color level for the given color index | ||
228 | fun! s:rgb_level(n) | ||
229 | if a:n == 0 | ||
230 | return 0 | ||
231 | elseif a:n == 1 | ||
232 | return 139 | ||
233 | elseif a:n == 2 | ||
234 | return 205 | ||
235 | else | ||
236 | return 255 | ||
237 | endif | ||
238 | endfun | ||
239 | |||
240 | " returns the palette index for the given R/G/B color indices | ||
241 | fun! s:rgb_color(x, y, z) | ||
242 | return 16 + (a:x * 16) + (a:y * 4) + a:z | ||
243 | endfun | ||
244 | |||
245 | else " assuming &t_Co == 256 | ||
246 | |||
247 | " returns an approximate grey index for the given grey level | ||
248 | fun! s:grey_number(x) | ||
249 | if a:x < 14 | ||
250 | return 0 | ||
251 | else | ||
252 | let l:n = (a:x - 8) / 10 | ||
253 | let l:m = (a:x - 8) % 10 | ||
254 | if l:m < 5 | ||
255 | return l:n | ||
256 | else | ||
257 | return l:n + 1 | ||
258 | endif | ||
259 | endif | ||
260 | endfun | ||
261 | |||
262 | " returns the actual grey level represented by the grey index | ||
263 | fun! s:grey_level(n) | ||
264 | if a:n == 0 | ||
265 | return 0 | ||
266 | else | ||
267 | return 8 + (a:n * 10) | ||
268 | endif | ||
269 | endfun | ||
270 | |||
271 | " returns the palette index for the given grey index | ||
272 | fun! s:grey_color(n) | ||
273 | if a:n == 0 | ||
274 | return 16 | ||
275 | elseif a:n == 25 | ||
276 | return 231 | ||
277 | else | ||
278 | return 231 + a:n | ||
279 | endif | ||
280 | endfun | ||
281 | |||
282 | " returns an approximate color index for the given color level | ||
283 | fun! s:rgb_number(x) | ||
284 | if a:x < 75 | ||
285 | return 0 | ||
286 | else | ||
287 | let l:n = (a:x - 55) / 40 | ||
288 | let l:m = (a:x - 55) % 40 | ||
289 | if l:m < 20 | ||
290 | return l:n | ||
291 | else | ||
292 | return l:n + 1 | ||
293 | endif | ||
294 | endif | ||
295 | endfun | ||
296 | |||
297 | " returns the actual color level for the given color index | ||
298 | fun! s:rgb_level(n) | ||
299 | if a:n == 0 | ||
300 | return 0 | ||
301 | else | ||
302 | return 55 + (a:n * 40) | ||
303 | endif | ||
304 | endfun | ||
305 | |||
306 | " returns the palette index for the given R/G/B color indices | ||
307 | fun! s:rgb_color(x, y, z) | ||
308 | return 16 + (a:x * 36) + (a:y * 6) + a:z | ||
309 | endfun | ||
310 | |||
311 | endif | ||
312 | |||
313 | " returns the palette index to approximate the given R/G/B color levels | ||
314 | fun! s:color(r, g, b) | ||
315 | " map greys directly (see xterm's 256colres.pl) | ||
316 | if &t_Co == 256 && a:r == a:g && a:g == a:b && a:r > 3 && a:r < 243 | ||
317 | return (a:r - 8) / 10 + 232 | ||
318 | endif | ||
319 | |||
320 | " get the closest grey | ||
321 | let l:gx = s:grey_number(a:r) | ||
322 | let l:gy = s:grey_number(a:g) | ||
323 | let l:gz = s:grey_number(a:b) | ||
324 | |||
325 | " get the closest color | ||
326 | let l:x = s:rgb_number(a:r) | ||
327 | let l:y = s:rgb_number(a:g) | ||
328 | let l:z = s:rgb_number(a:b) | ||
329 | |||
330 | if l:gx == l:gy && l:gy == l:gz | ||
331 | " there are two possibilities | ||
332 | let l:dgr = s:grey_level(l:gx) - a:r | ||
333 | let l:dgg = s:grey_level(l:gy) - a:g | ||
334 | let l:dgb = s:grey_level(l:gz) - a:b | ||
335 | let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb) | ||
336 | let l:dr = s:rgb_level(l:gx) - a:r | ||
337 | let l:dg = s:rgb_level(l:gy) - a:g | ||
338 | let l:db = s:rgb_level(l:gz) - a:b | ||
339 | let l:drgb = (l:dr * l:dr) + (l:dg * l:dg) + (l:db * l:db) | ||
340 | if l:dgrey < l:drgb | ||
341 | " use the grey | ||
342 | return s:grey_color(l:gx) | ||
343 | else | ||
344 | " use the color | ||
345 | return s:rgb_color(l:x, l:y, l:z) | ||
346 | endif | ||
347 | else | ||
348 | " only one possibility | ||
349 | return s:rgb_color(l:x, l:y, l:z) | ||
350 | endif | ||
351 | endfun | ||
352 | |||
353 | fun! s:is_empty_or_none(str) | ||
354 | return empty(a:str) || a:str ==? "NONE" | ||
355 | endfun | ||
356 | |||
357 | " returns the palette index to approximate the 'rrggbb' hex string | ||
358 | fun! s:rgb(rgb) | ||
359 | if s:is_empty_or_none(a:rgb) | ||
360 | return "NONE" | ||
361 | endif | ||
362 | let l:r = ("0x" . strpart(a:rgb, 0, 2)) + 0 | ||
363 | let l:g = ("0x" . strpart(a:rgb, 2, 2)) + 0 | ||
364 | let l:b = ("0x" . strpart(a:rgb, 4, 2)) + 0 | ||
365 | return s:color(l:r, l:g, l:b) | ||
366 | endfun | ||
367 | |||
368 | fun! s:prefix_highlight_value_with(prefix, color) | ||
369 | if s:is_empty_or_none(a:color) | ||
370 | return "NONE" | ||
371 | else | ||
372 | return a:prefix . a:color | ||
373 | endif | ||
374 | endfun | ||
375 | |||
376 | fun! s:remove_italic_attr(attr) | ||
377 | let l:attr = join(filter(split(a:attr, ","), "v:val !=? 'italic'"), ",") | ||
378 | if empty(l:attr) | ||
379 | let l:attr = "NONE" | ||
380 | endif | ||
381 | return l:attr | ||
382 | endfun | ||
383 | |||
384 | " sets the highlighting for the given group | ||
385 | fun! s:X(group, fg, bg, attr, lcfg, lcbg) | ||
386 | if s:low_color | ||
387 | let l:cmd = "hi ".a:group. | ||
388 | \ " ctermfg=".s:prefix_highlight_value_with("", a:lcfg). | ||
389 | \ " ctermbg=".s:prefix_highlight_value_with("", a:lcbg) | ||
390 | else | ||
391 | let l:cmd = "hi ".a:group. | ||
392 | \ " guifg=".s:prefix_highlight_value_with("#", a:fg). | ||
393 | \ " guibg=".s:prefix_highlight_value_with("#", a:bg) | ||
394 | if !s:true_color | ||
395 | let l:cmd = l:cmd. | ||
396 | \ " ctermfg=".s:rgb(a:fg). | ||
397 | \ " ctermbg=".s:rgb(a:bg) | ||
398 | endif | ||
399 | endif | ||
400 | |||
401 | let l:attr = s:prefix_highlight_value_with("", a:attr) | ||
402 | |||
403 | if exists("g:jellybeans_use_term_italics") && g:jellybeans_use_term_italics | ||
404 | let l:cterm_attr = l:attr | ||
405 | else | ||
406 | let l:cterm_attr = s:remove_italic_attr(l:attr) | ||
407 | endif | ||
408 | |||
409 | if !exists("g:jellybeans_use_gui_italics") || g:jellybeans_use_gui_italics | ||
410 | let l:gui_attr = l:attr | ||
411 | else | ||
412 | let l:gui_attr = s:remove_italic_attr(l:attr) | ||
413 | endif | ||
414 | |||
415 | let l:cmd = l:cmd." gui=".l:gui_attr." cterm=".l:cterm_attr | ||
416 | exec l:cmd | ||
417 | endfun | ||
418 | " }}} | ||
419 | |||
420 | call s:X("Normal","e8e8d3",s:background_color,"","White","") | ||
421 | set background=dark | ||
422 | |||
423 | call s:X("CursorLine","","1c1c1c","","",s:termBlack) | ||
424 | call s:X("CursorColumn","","1c1c1c","","",s:termBlack) | ||
425 | |||
426 | " Some of Terminal.app's default themes have a cursor color | ||
427 | " too close to Jellybeans' preferred MatchParen background | ||
428 | " color to be easily distinguishable. Other terminals tend | ||
429 | " to use a brighter cursor color. | ||
430 | " | ||
431 | " Use a more distinct color in Terminal.app, and also in | ||
432 | " low-color terminals if the preferred background color is | ||
433 | " not available. | ||
434 | if !has('gui_running') && $TERM_PROGRAM == "Apple_Terminal" | ||
435 | let s:matchParenGuiFg = "dd0093" | ||
436 | let s:matchParenGuiBg = "000000" | ||
437 | else | ||
438 | let s:matchParenGuiFg = "ffffff" | ||
439 | let s:matchParenGuiBg = "556779" | ||
440 | endif | ||
441 | if s:termBlack != "Black" | ||
442 | let s:matchParenTermFg = "Magenta" | ||
443 | let s:matchParenTermBg = "" | ||
444 | else | ||
445 | let s:matchParenTermFg = "" | ||
446 | let s:matchParenTermBg = s:termBlack | ||
447 | endif | ||
448 | call s:X("MatchParen",s:matchParenGuiFg,s:matchParenGuiBg,"bold", | ||
449 | \ s:matchParenTermFg,s:matchParenTermBg) | ||
450 | |||
451 | call s:X("TabLine","000000","b0b8c0","italic","",s:termBlack) | ||
452 | call s:X("TabLineFill","9098a0","","","",s:termBlack) | ||
453 | call s:X("TabLineSel","000000","f0f0f0","italic,bold",s:termBlack,"White") | ||
454 | |||
455 | " Auto-completion | ||
456 | call s:X("Pmenu","ffffff","606060","","White",s:termBlack) | ||
457 | call s:X("PmenuSel","101010","eeeeee","",s:termBlack,"White") | ||
458 | |||
459 | call s:X("Visual","","404040","","",s:termBlack) | ||
460 | call s:X("Cursor",s:background_color,"b0d0f0","","","") | ||
461 | |||
462 | call s:X("LineNr","605958",s:background_color,"NONE",s:termBlack,"") | ||
463 | call s:X("CursorLineNr","ccc5c4","","NONE","White","") | ||
464 | call s:X("Comment","888888","","italic","Grey","") | ||
465 | call s:X("Todo","c7c7c7","","bold","White",s:termBlack) | ||
466 | |||
467 | call s:X("StatusLine","000000","dddddd","italic","","White") | ||
468 | call s:X("StatusLineNC","ffffff","403c41","italic","White","Black") | ||
469 | call s:X("VertSplit","282828","403c41","",s:termBlack,s:termBlack) | ||
470 | call s:X("WildMenu","f0a0c0","302028","","Magenta","") | ||
471 | |||
472 | call s:X("Folded","a0a8b0","384048","italic",s:termBlack,"") | ||
473 | call s:X("FoldColumn","535D66","1f1f1f","","",s:termBlack) | ||
474 | call s:X("SignColumn","777777","333333","","",s:termBlack) | ||
475 | call s:X("ColorColumn","","000000","","",s:termBlack) | ||
476 | |||
477 | call s:X("Title","70b950","","bold","Green","") | ||
478 | |||
479 | call s:X("Constant","cf6a4c","","","Red","") | ||
480 | call s:X("Special","799d6a","","","Green","") | ||
481 | call s:X("Delimiter","668799","","","Grey","") | ||
482 | |||
483 | call s:X("String","99ad6a","","","Green","") | ||
484 | call s:X("StringDelimiter","556633","","","DarkGreen","") | ||
485 | |||
486 | call s:X("Identifier","c6b6ee","","","LightCyan","") | ||
487 | call s:X("Structure","8fbfdc","","","LightCyan","") | ||
488 | call s:X("Function","fad07a","","","Yellow","") | ||
489 | call s:X("Statement","8197bf","","","DarkBlue","") | ||
490 | call s:X("PreProc","8fbfdc","","","LightBlue","") | ||
491 | |||
492 | hi! link Operator Structure | ||
493 | hi! link Conceal Operator | ||
494 | |||
495 | call s:X("Type","ffb964","","","Yellow","") | ||
496 | call s:X("NonText","606060",s:background_color,"",s:termBlack,"") | ||
497 | |||
498 | call s:X("SpecialKey","444444","1c1c1c","",s:termBlack,"") | ||
499 | |||
500 | call s:X("Search","f0a0c0","302028","underline","Magenta","") | ||
501 | |||
502 | call s:X("Directory","dad085","","","Yellow","") | ||
503 | call s:X("ErrorMsg","","a03949","","","DarkRed") | ||
504 | hi! link Error ErrorMsg | ||
505 | hi! link MoreMsg Special | ||
506 | call s:X("Question","65C254","","","Green","") | ||
507 | |||
508 | |||
509 | " Spell Checking | ||
510 | |||
511 | call s:X("SpellBad","","902020","underline","","DarkRed") | ||
512 | call s:X("SpellCap","","0000df","underline","","Blue") | ||
513 | call s:X("SpellRare","","540063","underline","","DarkMagenta") | ||
514 | call s:X("SpellLocal","","2D7067","underline","","Green") | ||
515 | |||
516 | " Diff | ||
517 | |||
518 | hi! link diffRemoved Constant | ||
519 | hi! link diffAdded String | ||
520 | |||
521 | " VimDiff | ||
522 | |||
523 | call s:X("DiffAdd","D2EBBE","437019","","White","DarkGreen") | ||
524 | call s:X("DiffDelete","40000A","700009","","DarkRed","DarkRed") | ||
525 | call s:X("DiffChange","","2B5B77","","White","DarkBlue") | ||
526 | call s:X("DiffText","8fbfdc","000000","reverse","Yellow","") | ||
527 | |||
528 | " PHP | ||
529 | |||
530 | hi! link phpFunctions Function | ||
531 | call s:X("StorageClass","c59f6f","","","Red","") | ||
532 | hi! link phpSuperglobal Identifier | ||
533 | hi! link phpQuoteSingle StringDelimiter | ||
534 | hi! link phpQuoteDouble StringDelimiter | ||
535 | hi! link phpBoolean Constant | ||
536 | hi! link phpNull Constant | ||
537 | hi! link phpArrayPair Operator | ||
538 | hi! link phpOperator Normal | ||
539 | hi! link phpRelation Normal | ||
540 | hi! link phpVarSelector Identifier | ||
541 | |||
542 | " Python | ||
543 | |||
544 | hi! link pythonOperator Statement | ||
545 | |||
546 | " Ruby | ||
547 | |||
548 | hi! link rubySharpBang Comment | ||
549 | call s:X("rubyClass","447799","","","DarkBlue","") | ||
550 | call s:X("rubyIdentifier","c6b6fe","","","Cyan","") | ||
551 | hi! link rubyConstant Type | ||
552 | hi! link rubyFunction Function | ||
553 | |||
554 | call s:X("rubyInstanceVariable","c6b6fe","","","Cyan","") | ||
555 | call s:X("rubySymbol","7697d6","","","Blue","") | ||
556 | hi! link rubyGlobalVariable rubyInstanceVariable | ||
557 | hi! link rubyModule rubyClass | ||
558 | call s:X("rubyControl","7597c6","","","Blue","") | ||
559 | |||
560 | hi! link rubyString String | ||
561 | hi! link rubyStringDelimiter StringDelimiter | ||
562 | hi! link rubyInterpolationDelimiter Identifier | ||
563 | |||
564 | call s:X("rubyRegexpDelimiter","540063","","","Magenta","") | ||
565 | call s:X("rubyRegexp","dd0093","","","DarkMagenta","") | ||
566 | call s:X("rubyRegexpSpecial","a40073","","","Magenta","") | ||
567 | |||
568 | call s:X("rubyPredefinedIdentifier","de5577","","","Red","") | ||
569 | |||
570 | " Erlang | ||
571 | |||
572 | hi! link erlangAtom rubySymbol | ||
573 | hi! link erlangBIF rubyPredefinedIdentifier | ||
574 | hi! link erlangFunction rubyPredefinedIdentifier | ||
575 | hi! link erlangDirective Statement | ||
576 | hi! link erlangNode Identifier | ||
577 | |||
578 | " Elixir | ||
579 | |||
580 | hi! link elixirAtom rubySymbol | ||
581 | |||
582 | |||
583 | " JavaScript | ||
584 | |||
585 | hi! link javaScriptValue Constant | ||
586 | hi! link javaScriptRegexpString rubyRegexp | ||
587 | hi! link javaScriptTemplateVar StringDelim | ||
588 | hi! link javaScriptTemplateDelim Identifier | ||
589 | hi! link javaScriptTemplateString String | ||
590 | |||
591 | " CoffeeScript | ||
592 | |||
593 | hi! link coffeeRegExp javaScriptRegexpString | ||
594 | |||
595 | " Lua | ||
596 | |||
597 | hi! link luaOperator Conditional | ||
598 | |||
599 | " C | ||
600 | |||
601 | hi! link cFormat Identifier | ||
602 | hi! link cOperator Constant | ||
603 | |||
604 | " Objective-C/Cocoa | ||
605 | |||
606 | hi! link objcClass Type | ||
607 | hi! link cocoaClass objcClass | ||
608 | hi! link objcSubclass objcClass | ||
609 | hi! link objcSuperclass objcClass | ||
610 | hi! link objcDirective rubyClass | ||
611 | hi! link objcStatement Constant | ||
612 | hi! link cocoaFunction Function | ||
613 | hi! link objcMethodName Identifier | ||
614 | hi! link objcMethodArg Normal | ||
615 | hi! link objcMessageName Identifier | ||
616 | |||
617 | " Vimscript | ||
618 | |||
619 | hi! link vimOper Normal | ||
620 | |||
621 | " HTML | ||
622 | |||
623 | hi! link htmlTag Statement | ||
624 | hi! link htmlEndTag htmlTag | ||
625 | hi! link htmlTagName htmlTag | ||
626 | |||
627 | " XML | ||
628 | |||
629 | hi! link xmlTag Statement | ||
630 | hi! link xmlEndTag xmlTag | ||
631 | hi! link xmlTagName xmlTag | ||
632 | hi! link xmlEqual xmlTag | ||
633 | hi! link xmlEntity Special | ||
634 | hi! link xmlEntityPunct xmlEntity | ||
635 | hi! link xmlDocTypeDecl PreProc | ||
636 | hi! link xmlDocTypeKeyword PreProc | ||
637 | hi! link xmlProcessingDelim xmlAttrib | ||
638 | |||
639 | " Debugger.vim | ||
640 | |||
641 | call s:X("DbgCurrent","DEEBFE","345FA8","","White","DarkBlue") | ||
642 | call s:X("DbgBreakPt","","4F0037","","","DarkMagenta") | ||
643 | |||
644 | " vim-indent-guides | ||
645 | |||
646 | if !exists("g:indent_guides_auto_colors") | ||
647 | let g:indent_guides_auto_colors = 0 | ||
648 | endif | ||
649 | call s:X("IndentGuidesOdd","","232323","","","") | ||
650 | call s:X("IndentGuidesEven","","1b1b1b","","","") | ||
651 | |||
652 | " Plugins, etc. | ||
653 | |||
654 | hi! link TagListFileName Directory | ||
655 | call s:X("PreciseJumpTarget","B9ED67","405026","","White","Green") | ||
656 | |||
657 | " Manual overrides for 256-color terminals. Dark colors auto-map badly. | ||
658 | if !s:low_color | ||
659 | hi StatusLineNC ctermbg=235 | ||
660 | hi Folded ctermbg=236 | ||
661 | hi DiffText ctermfg=81 | ||
662 | hi DbgBreakPt ctermbg=53 | ||
663 | hi IndentGuidesOdd ctermbg=235 | ||
664 | hi IndentGuidesEven ctermbg=234 | ||
665 | endif | ||
666 | |||
667 | if !empty("s:overrides") | ||
668 | fun! s:current_attr(group) | ||
669 | let l:synid = synIDtrans(hlID(a:group)) | ||
670 | let l:attrs = [] | ||
671 | for l:attr in ["bold", "italic", "reverse", "standout", "underline", "undercurl"] | ||
672 | if synIDattr(l:synid, l:attr, "gui") == 1 | ||
673 | call add(l:attrs, l:attr) | ||
674 | endif | ||
675 | endfor | ||
676 | return join(l:attrs, ",") | ||
677 | endfun | ||
678 | fun! s:current_color(group, what, mode) | ||
679 | let l:color = synIDattr(synIDtrans(hlID(a:group)), a:what, a:mode) | ||
680 | if l:color == -1 | ||
681 | return "" | ||
682 | else | ||
683 | return substitute(l:color, "^#", "", "") | ||
684 | endif | ||
685 | endfun | ||
686 | fun! s:load_color_def(group, def) | ||
687 | call s:X(a:group, get(a:def, "guifg", s:current_color(a:group, "fg", "gui")), | ||
688 | \ get(a:def, "guibg", s:current_color(a:group, "bg", "gui")), | ||
689 | \ get(a:def, "attr", s:current_attr(a:group)), | ||
690 | \ get(a:def, "ctermfg", s:current_color(a:group, "fg", "cterm")), | ||
691 | \ get(a:def, "ctermbg", s:current_color(a:group, "bg", "cterm"))) | ||
692 | if !s:low_color | ||
693 | for l:prop in ["ctermfg", "ctermbg"] | ||
694 | let l:override_key = "256".l:prop | ||
695 | if has_key(a:def, l:override_key) | ||
696 | exec "hi ".a:group." ".l:prop."=".a:def[l:override_key] | ||
697 | endif | ||
698 | endfor | ||
699 | endif | ||
700 | endfun | ||
701 | fun! s:load_colors(defs) | ||
702 | for [l:group, l:def] in items(a:defs) | ||
703 | if l:group == "background" | ||
704 | call s:load_color_def("LineNr", l:def) | ||
705 | call s:load_color_def("NonText", l:def) | ||
706 | call s:load_color_def("Normal", l:def) | ||
707 | else | ||
708 | call s:load_color_def(l:group, l:def) | ||
709 | endif | ||
710 | unlet l:group | ||
711 | unlet l:def | ||
712 | endfor | ||
713 | endfun | ||
714 | call s:load_colors(s:overrides) | ||
715 | delf s:load_colors | ||
716 | delf s:load_color_def | ||
717 | delf s:current_color | ||
718 | delf s:current_attr | ||
719 | endif | ||
720 | |||
721 | " delete functions {{{ | ||
722 | delf s:X | ||
723 | delf s:remove_italic_attr | ||
724 | delf s:prefix_highlight_value_with | ||
725 | delf s:rgb | ||
726 | delf s:is_empty_or_none | ||
727 | delf s:color | ||
728 | delf s:rgb_color | ||
729 | delf s:rgb_level | ||
730 | delf s:rgb_number | ||
731 | delf s:grey_color | ||
732 | delf s:grey_level | ||
733 | delf s:grey_number | ||
734 | " }}} | ||
735 | |||
736 | " extras | ||
737 | hi NERDTreeHelp guifg=#eeeeee ctermfg=255 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE | ||
738 | hi NERDTreeHelpKey guifg=#c9d05c ctermfg=185 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE | ||
739 | hi NERDTreeHelpCommand guifg=#ffc24b ctermfg=215 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE | ||
740 | hi NERDTreeHelpTitle guifg=#b3deef ctermfg=153 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE | ||
741 | hi NERDTreeUp guifg=#c9d05c ctermfg=185 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE | ||
742 | hi NERDTreeCWD guifg=#73cef4 ctermfg=81 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE | ||
743 | hi NERDTreeOpenable guifg=#f43753 ctermfg=203 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE | ||
744 | hi NERDTreeClosable guifg=#ffc24b ctermfg=215 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE | ||
745 | hi GitGutterAdd guifg=#c9d05c ctermfg=185 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE | ||
746 | hi GitGutterChange guifg=#b3deef ctermfg=153 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE | ||
747 | hi GitGutterDelete guifg=#f43753 ctermfg=203 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE | ||
748 | hi GitGutterChangeDelete guifg=#f43753 ctermfg=203 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE | ||
diff --git a/nvim/.config/nvim/colors/pencil.vim b/nvim/.config/nvim/colors/pencil.vim index 6ec59a5..6ec59a5 100755..100644 --- a/nvim/.config/nvim/colors/pencil.vim +++ b/nvim/.config/nvim/colors/pencil.vim | |||
diff --git a/nvim/.config/nvim/colors/plain.vim b/nvim/.config/nvim/colors/plain.vim index 4b712bd..80f0b0e 100644 --- a/nvim/.config/nvim/colors/plain.vim +++ b/nvim/.config/nvim/colors/plain.vim | |||
@@ -1,3 +1,17 @@ | |||
1 | " Name: plain.vim | ||
2 | " Version: 0.1 | ||
3 | " Maintainer: github.com/andreypopp | ||
4 | " License: The MIT License (MIT) | ||
5 | " | ||
6 | " Based on | ||
7 | " | ||
8 | " https://github.com/pbrisbin/vim-colors-off (MIT License) | ||
9 | " | ||
10 | " which in turn based on | ||
11 | " | ||
12 | " https://github.com/reedes/vim-colors-pencil (MIT License) | ||
13 | " | ||
14 | """ | ||
1 | hi clear | 15 | hi clear |
2 | 16 | ||
3 | if exists('syntax on') | 17 | if exists('syntax on') |
@@ -10,8 +24,8 @@ let s:black = { "gui": "#222222", "cterm": "0" } | |||
10 | let s:medium_gray = { "gui": "#767676", "cterm": "8" } | 24 | let s:medium_gray = { "gui": "#767676", "cterm": "8" } |
11 | let s:white = { "gui": "#F1F1F1", "cterm": "7" } | 25 | let s:white = { "gui": "#F1F1F1", "cterm": "7" } |
12 | let s:actual_white = { "gui": "#FFFFFF", "cterm": "15" } | 26 | let s:actual_white = { "gui": "#FFFFFF", "cterm": "15" } |
13 | let s:light_black = { "gui": "#424242", "cterm": "11" } | 27 | let s:light_black = { "gui": "#424242", "cterm": "8" } |
14 | let s:lighter_black = { "gui": "#545454", "cterm": "12" } | 28 | let s:lighter_black = { "gui": "#545454", "cterm": "8" } |
15 | let s:subtle_black = { "gui": "#303030", "cterm": "11" } | 29 | let s:subtle_black = { "gui": "#303030", "cterm": "11" } |
16 | let s:light_gray = { "gui": "#999999", "cterm": "12" } | 30 | let s:light_gray = { "gui": "#999999", "cterm": "12" } |
17 | let s:lighter_gray = { "gui": "#CCCCCC", "cterm": "7" } | 31 | let s:lighter_gray = { "gui": "#CCCCCC", "cterm": "7" } |
@@ -34,25 +48,6 @@ let s:light_yellow = { "gui": "#F3E430", "cterm": "3" } | |||
34 | let s:dark_yellow = { "gui": "#A89C14", "cterm": "3" } | 48 | let s:dark_yellow = { "gui": "#A89C14", "cterm": "3" } |
35 | 49 | ||
36 | if &background == "dark" | 50 | if &background == "dark" |
37 | let s:bg = s:white | ||
38 | let s:bg_subtle = s:lighter_gray | ||
39 | let s:bg_very_subtle = s:light_gray | ||
40 | let s:norm = s:light_black | ||
41 | let s:norm_subtle = s:lighter_black | ||
42 | let s:purple = s:dark_purple | ||
43 | let s:cyan = s:dark_cyan | ||
44 | let s:green = s:dark_green | ||
45 | let s:red = s:dark_red | ||
46 | let s:yellow = s:dark_yellow | ||
47 | let s:visual = s:light_blue | ||
48 | let s:cursor_line = s:medium_gray | ||
49 | let s:status_line = s:lighter_gray | ||
50 | let s:status_line_nc = s:lighter_black | ||
51 | let s:constant = s:dark_blue | ||
52 | let s:comment = s:light_gray | ||
53 | let s:selection = s:light_yellow | ||
54 | let s:warning = s:yellow | ||
55 | else | ||
56 | let s:bg = s:black | 51 | let s:bg = s:black |
57 | let s:bg_subtle = s:light_black | 52 | let s:bg_subtle = s:light_black |
58 | let s:bg_very_subtle = s:subtle_black | 53 | let s:bg_very_subtle = s:subtle_black |
@@ -71,6 +66,25 @@ else | |||
71 | let s:comment = s:lighter_black | 66 | let s:comment = s:lighter_black |
72 | let s:selection = s:light_purple | 67 | let s:selection = s:light_purple |
73 | let s:warning = s:yellow | 68 | let s:warning = s:yellow |
69 | else | ||
70 | let s:bg = s:white | ||
71 | let s:bg_subtle = s:lighter_gray | ||
72 | let s:bg_very_subtle = s:light_gray | ||
73 | let s:norm = s:light_black | ||
74 | let s:norm_subtle = s:lighter_black | ||
75 | let s:purple = s:dark_purple | ||
76 | let s:cyan = s:dark_cyan | ||
77 | let s:green = s:dark_green | ||
78 | let s:red = s:dark_red | ||
79 | let s:yellow = s:dark_yellow | ||
80 | let s:visual = s:light_blue | ||
81 | let s:cursor_line = s:medium_gray | ||
82 | let s:status_line = s:lighter_gray | ||
83 | let s:status_line_nc = s:lighter_black | ||
84 | let s:constant = s:dark_blue | ||
85 | let s:comment = s:light_gray | ||
86 | let s:selection = s:light_yellow | ||
87 | let s:warning = s:yellow | ||
74 | endif | 88 | endif |
75 | 89 | ||
76 | " https://github.com/noahfrederick/vim-hemisu/ | 90 | " https://github.com/noahfrederick/vim-hemisu/ |
@@ -93,7 +107,6 @@ call s:h("Noise", {"fg": s:norm_subtle}) | |||
93 | call s:h("Cursor", {"bg": s:green, "fg": s:norm}) | 107 | call s:h("Cursor", {"bg": s:green, "fg": s:norm}) |
94 | call s:h("Comment", {"fg": s:comment, "cterm": "italic"}) | 108 | call s:h("Comment", {"fg": s:comment, "cterm": "italic"}) |
95 | call s:h("Function", {"fg": s:norm, "cterm": "bold"}) | 109 | call s:h("Function", {"fg": s:norm, "cterm": "bold"}) |
96 | call s:h("FloatWin", {"fg": s:norm, "bg": s:black}) | ||
97 | 110 | ||
98 | hi! link Constant firstAccent | 111 | hi! link Constant firstAccent |
99 | hi! link Character Constant | 112 | hi! link Character Constant |
@@ -193,7 +206,7 @@ call s:h("StatusLineOk", {"gui": "underline", "bg": s:bg, "fg": s:green}) | |||
193 | call s:h("StatusLineError", {"gui": "underline", "bg": s:bg, "fg": s:pink}) | 206 | call s:h("StatusLineError", {"gui": "underline", "bg": s:bg, "fg": s:pink}) |
194 | call s:h("StatusLineWarning", {"gui": "underline", "bg": s:bg, "fg": s:warning}) | 207 | call s:h("StatusLineWarning", {"gui": "underline", "bg": s:bg, "fg": s:warning}) |
195 | 208 | ||
196 | call s:h("Pmenu", {"fg": s:norm, "bg": s:bg_subtle}) | 209 | call s:h("Pmenu", {"fg": s:norm, "bg": s:bg_very_subtle}) |
197 | call s:h("PmenuSel", {"fg": s:green, "bg": s:bg_very_subtle, "gui": "bold"}) | 210 | call s:h("PmenuSel", {"fg": s:green, "bg": s:bg_very_subtle, "gui": "bold"}) |
198 | call s:h("PmenuSbar", {"fg": s:norm, "bg": s:bg_subtle}) | 211 | call s:h("PmenuSbar", {"fg": s:norm, "bg": s:bg_subtle}) |
199 | call s:h("PmenuThumb", {"fg": s:norm, "bg": s:bg_subtle}) | 212 | call s:h("PmenuThumb", {"fg": s:norm, "bg": s:bg_subtle}) |
@@ -239,7 +252,7 @@ hi link TSBoolean Constant | |||
239 | hi link TSCharacter Constant | 252 | hi link TSCharacter Constant |
240 | hi link TSComment Comment | 253 | hi link TSComment Comment |
241 | hi link TSConstructor Normal | 254 | hi link TSConstructor Normal |
242 | hi link TSConditional Statement | 255 | hi link TSConditional Normal |
243 | hi link TSConstant Constant | 256 | hi link TSConstant Constant |
244 | hi link TSConstBuiltin secondAccent | 257 | hi link TSConstBuiltin secondAccent |
245 | hi link TSConstMacro secondAccent | 258 | hi link TSConstMacro secondAccent |
@@ -248,18 +261,18 @@ hi link TSException Error | |||
248 | hi link TSField Normal | 261 | hi link TSField Normal |
249 | hi link TSFloat Constant | 262 | hi link TSFloat Constant |
250 | hi link TSFunction Normal | 263 | hi link TSFunction Normal |
251 | hi link TSFuncBuiltin secondAccent | 264 | hi link TSFuncBuiltin Noise |
252 | hi link TSFuncMacro secondAccent | 265 | hi link TSFuncMacro secondAccent |
253 | hi link TSInclude Noise | 266 | hi link TSInclude Noise |
254 | hi link TSKeyword Statement | 267 | hi link TSKeyword Noise |
255 | hi link TSKeywordFunction Statement | 268 | hi link TSKeywordFunction Noise |
256 | hi link TSLabel Noise | 269 | hi link TSLabel Noise |
257 | hi link TSMethod Normal | 270 | hi link TSMethod Normal |
258 | hi link TSNamespace Noise | 271 | hi link TSNamespace Noise |
259 | hi link TSNone Noise | 272 | hi link TSNone Noise |
260 | hi link TSNumber Constant | 273 | hi link TSNumber Constant |
261 | hi link TSOperator Normal | 274 | hi link TSOperator Normal |
262 | hi link TSParameter Noise | 275 | hi link TSParameter Statement |
263 | hi link TSParameterReference Statement | 276 | hi link TSParameterReference Statement |
264 | hi link TSProperty TSField | 277 | hi link TSProperty TSField |
265 | hi link TSPunctDelimiter Noise | 278 | hi link TSPunctDelimiter Noise |
@@ -269,6 +282,7 @@ hi link TSRepeat Normal | |||
269 | hi link TSString Constant | 282 | hi link TSString Constant |
270 | hi link TSStringRegex secondAccent | 283 | hi link TSStringRegex secondAccent |
271 | hi link TSStringEscape secondAccent | 284 | hi link TSStringEscape secondAccent |
285 | hi link TSStringSpecial secondAccent | ||
272 | hi link TSTag Statement | 286 | hi link TSTag Statement |
273 | hi link TSTagDelimiter Noise | 287 | hi link TSTagDelimiter Noise |
274 | hi link TSText Normal | 288 | hi link TSText Normal |
@@ -278,11 +292,10 @@ hi link TSStrike Underlined | |||
278 | hi link TSTitle Statement | 292 | hi link TSTitle Statement |
279 | hi link TSLiteral Noise | 293 | hi link TSLiteral Noise |
280 | hi link TSURI Constant | 294 | hi link TSURI Constant |
281 | hi link TSType Noise | 295 | hi link TSType secondAccent |
282 | hi link TSTypeBuiltin secondAccent | 296 | hi link TSTypeBuiltin secondAccent |
283 | hi link TSVariable Normal | 297 | hi link TSVariable Normal |
284 | hi link TSVariableBuiltin Normal | 298 | hi link TSVariableBuiltin Normal |
285 | hi link TSRepeat Statement | ||
286 | 299 | ||
287 | " nvim-lsp diagnostics | 300 | " nvim-lsp diagnostics |
288 | hi link LspDiagnosticsDefaultError Error | 301 | hi link LspDiagnosticsDefaultError Error |
@@ -332,6 +345,15 @@ hi link cFormat secondAccent | |||
332 | hi link nixBuiltin secondAccent | 345 | hi link nixBuiltin secondAccent |
333 | hi link nixNamespacedBuiltin secondAccent | 346 | hi link nixNamespacedBuiltin secondAccent |
334 | 347 | ||
348 | hi link awkPatterns secondAccent | ||
349 | hi link awkVariables Normal | ||
350 | hi link awkOperator Normal | ||
351 | hi link awkExpression Noise | ||
352 | hi link awkArrayElement Noise | ||
353 | hi link awkFieldVars firstAccent | ||
354 | hi link awkSpecialPrintf secondAccent | ||
355 | hi link awkSpecialCharacter Noise | ||
356 | |||
335 | hi link sqlSpecial firstAccent | 357 | hi link sqlSpecial firstAccent |
336 | hi link sqlKeyword secondAccent | 358 | hi link sqlKeyword secondAccent |
337 | 359 | ||
@@ -364,6 +386,3 @@ hi link markdownHeadingDelimiter Constant | |||
364 | call s:h("cssBraces", {"bg": s:bg, "fg": s:selection}) | 386 | call s:h("cssBraces", {"bg": s:bg, "fg": s:selection}) |
365 | hi link cssTextProp Noise | 387 | hi link cssTextProp Noise |
366 | hi link cssTagName Normal | 388 | hi link cssTagName Normal |
367 | |||
368 | " floatwin | ||
369 | hi link NormalFloat FloatWin | ||
diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua new file mode 100644 index 0000000..af18fe3 --- /dev/null +++ b/nvim/.config/nvim/init.lua | |||
@@ -0,0 +1,3 @@ | |||
1 | require("map") | ||
2 | require("set") | ||
3 | require("plugins") | ||
diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim deleted file mode 100755 index 31f8aa2..0000000 --- a/nvim/.config/nvim/init.vim +++ /dev/null | |||
@@ -1,281 +0,0 @@ | |||
1 | " vimplug | ||
2 | call plug#begin() | ||
3 | Plug 'neoclide/coc.nvim', {'branch': 'release'} | ||
4 | Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } | ||
5 | Plug 'junegunn/fzf.vim' | ||
6 | Plug 'Shougo/deol.nvim' | ||
7 | Plug 'ap/vim-css-color' | ||
8 | Plug 'tpope/vim-eunuch' | ||
9 | Plug 'tpope/vim-commentary' | ||
10 | Plug 'scrooloose/nerdtree' | ||
11 | Plug 'junegunn/goyo.vim' | ||
12 | Plug 'airblade/vim-gitgutter' | ||
13 | Plug 'godlygeek/tabular' | ||
14 | Plug 'plasticboy/vim-markdown' | ||
15 | Plug 'sh-ubh/vim-bujo' | ||
16 | Plug 'lervag/vimtex' | ||
17 | Plug 'metakirby5/codi.vim' | ||
18 | Plug 'hashivim/vim-terraform' | ||
19 | call plug#end() | ||
20 | |||
21 | " sets | ||
22 | set guicursor= | ||
23 | set number relativenumber | ||
24 | set mouse=a | ||
25 | set background=dark | ||
26 | syntax enable | ||
27 | set cursorline | ||
28 | set ignorecase | ||
29 | set smartcase | ||
30 | set wildmenu " Tab autocomplete in command mode | ||
31 | set autoread " Auto reload changed files | ||
32 | |||
33 | " Spaces & Tabs | ||
34 | set tabstop=4 " number of visual spaces per TAB | ||
35 | set softtabstop=4 " number of spaces in tab when editing | ||
36 | set shiftwidth=4 " number of spaces to use for autoindent | ||
37 | set expandtab " tabs are space | ||
38 | set autoindent | ||
39 | set copyindent " copy indent from the previous line | ||
40 | colorscheme pencil | ||
41 | "hi Normal ctermbg=16 guibg=#000000 | ||
42 | "hi LineNr ctermbg=16 guibg=#000000 | ||
43 | |||
44 | " Change background based on macos theme | ||
45 | " let output = system("defaults read -g AppleInterfaceStyle") | ||
46 | " if v:shell_error != 0 | ||
47 | " set background=light | ||
48 | " colorscheme plain | ||
49 | " else | ||
50 | " set background=dark | ||
51 | " colorscheme pencil | ||
52 | " endif | ||
53 | |||
54 | let mapleader=" " | ||
55 | |||
56 | " Reload vimrc | ||
57 | nnoremap <leader>sv :source $VIMRC<CR> | ||
58 | |||
59 | " Alias write and quit to Q | ||
60 | nnoremap <leader>q :wq<CR> | ||
61 | nnoremap <leader>w :w<CR> | ||
62 | |||
63 | " toggle fzf | ||
64 | nnoremap <leader><tab> :FZF<CR> | ||
65 | |||
66 | " Save file as sudo when no sudo permissions | ||
67 | cmap w!! w !sudo tee > /dev/null % | ||
68 | |||
69 | " vim-bujo | ||
70 | nmap <C-N> <Plug>BujoAddnormal | ||
71 | imap <C-N> <Plug>BujoAddinsert | ||
72 | nmap <C-P> <Plug>BujoChecknormal | ||
73 | imap <C-P> <Plug>BujoCheckinsert | ||
74 | |||
75 | " nerdtree | ||
76 | let g:NERDTreeWinPos = "right" | ||
77 | map <leader>n :NERDTreeToggle<CR> | ||
78 | autocmd StdinReadPre * let s:std_in=1 | ||
79 | autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif | ||
80 | autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif | ||
81 | |||
82 | " system clipboard | ||
83 | " set clipboard+=unnamedplus | ||
84 | |||
85 | " Fix indenting visual block | ||
86 | vmap < <gv | ||
87 | vmap > >gv | ||
88 | |||
89 | " git gutter settings | ||
90 | highlight GitGutterAdd guifg=#009900 ctermfg=Green | ||
91 | highlight GitGutterChange guifg=#bbbb00 ctermfg=Yellow | ||
92 | highlight GitGutterDelete guifg=#ff2222 ctermfg=Red | ||
93 | nmap ) <Plug>(GitGutterNextHunk) | ||
94 | nmap ( <Plug>(GitGutterPrevHunk) | ||
95 | let g:gitgutter_enabled = 1 | ||
96 | let g:gitgutter_map_keys = 0 | ||
97 | let g:gitgutter_highlight_linenrs = 1 | ||
98 | |||
99 | " vim-markdown | ||
100 | let g:vim_markdown_no_default_key_mappings=1 | ||
101 | let g:vim_markdown_toml_frontmatter=1 | ||
102 | let g:vim_markdown_yaml_frontmatter=1 | ||
103 | let g:vim_markdown_folding_disabled=1 | ||
104 | let g:vim_markdown_conceal=0 | ||
105 | |||
106 | " vimtex | ||
107 | let g:tex_flavor = 'latex' | ||
108 | |||
109 | " insert centered | ||
110 | autocmd InsertEnter * norm zz | ||
111 | |||
112 | " shortcut split navigation | ||
113 | map <C-h> <C-w>h | ||
114 | map <C-j> <C-w>j | ||
115 | map <C-k> <C-w>k | ||
116 | map <C-l> <C-w>l | ||
117 | |||
118 | " replace all using S | ||
119 | nnoremap S :%s//gI<Left><Left><Left> | ||
120 | |||
121 | " italic comments | ||
122 | hi Comment cterm=italic | ||
123 | |||
124 | " statusbar | ||
125 | scriptencoding utf-8 | ||
126 | |||
127 | " templates | ||
128 | autocmd BufNewFile * silent! 0r $HOME/.config/nvim/templates/skelton.%:e | ||
129 | |||
130 | " statusline | ||
131 | hi PrimaryBlock ctermbg=NONE ctermfg=237 | ||
132 | hi ModeBlock ctermbg=NONE ctermfg=2 | ||
133 | hi SecondaryBlock ctermbg=NONE ctermfg=237 | ||
134 | hi TeritaryBlock ctermbg=NONE ctermfg=9 | ||
135 | hi Blanks ctermbg=NONE | ||
136 | hi statusline ctermbg=NONE | ||
137 | let g:currentmode={ | ||
138 | \ 'n' : 'NORMAL ', | ||
139 | \ 'no' : 'N·OPERATOR PENDING ', | ||
140 | \ 'v' : 'VISUAL ', | ||
141 | \ 'V' : 'V·LINE ', | ||
142 | \ '' : 'V·BLOCK ', | ||
143 | \ 's' : 'SELECT ', | ||
144 | \ 'S' : 'S·LINE ', | ||
145 | \ '' : 'S·BLOCK ', | ||
146 | \ 'i' : 'INSERT ', | ||
147 | \ 'R' : 'REPLACE ', | ||
148 | \ 'Rv' : 'V·REPLACE ', | ||
149 | \ 'c' : 'COMMAND ', | ||
150 | \ 'cv' : 'VIM EX ', | ||
151 | \ 'ce' : 'EX ', | ||
152 | \ 'r' : 'PROMPT ', | ||
153 | \ 'rm' : 'MORE ', | ||
154 | \ 'r?' : 'CONFIRM ', | ||
155 | \ '!' : 'SHELL ', | ||
156 | \ 't' : 'TERMINAL '} | ||
157 | set statusline= | ||
158 | set statusline+=%#ModeBlock# | ||
159 | set statusline+=\ %{g:currentmode[mode()]} | ||
160 | set statusline+=%#TeritaryBlock# | ||
161 | set statusline+=\ %f\ | ||
162 | set statusline+=%M\ | ||
163 | set statusline+=%#Blanks# | ||
164 | set statusline+=%= | ||
165 | set statusline+=%#PrimaryBlock# | ||
166 | set statusline+=\ %Y\ | ||
167 | set statusline+=%#SecondaryBlock# | ||
168 | set statusline+=\ %P\ | ||
169 | |||
170 | " ------COC SETTINGS------ | ||
171 | " prettier command for coc | ||
172 | command! -nargs=0 Prettier :CocCommand prettier.formatFile | ||
173 | let g:coc_global_extensions = [ | ||
174 | \ 'coc-snippets', | ||
175 | \ 'coc-pairs', | ||
176 | \ 'coc-prettier', | ||
177 | \ 'coc-tsserver', | ||
178 | \ 'coc-html', | ||
179 | \ 'coc-css', | ||
180 | \ 'coc-json', | ||
181 | \ 'coc-clangd', | ||
182 | \ 'coc-python', | ||
183 | \ 'coc-sh', | ||
184 | \ 'coc-vimtex', | ||
185 | \ 'coc-go' | ||
186 | \ ] | ||
187 | |||
188 | " From Coc Readme | ||
189 | set updatetime=300 | ||
190 | |||
191 | " Some servers have issues with backup files, see #649 | ||
192 | set nobackup | ||
193 | set nowritebackup | ||
194 | |||
195 | " don't give |ins-completion-menu| messages. | ||
196 | set shortmess+=c | ||
197 | |||
198 | " always show signcolumns | ||
199 | set signcolumn=yes | ||
200 | |||
201 | " Use tab for trigger completion with characters ahead and navigate. | ||
202 | " Use command ':verbose imap <tab>' to make sure tab is not mapped by other plugin. | ||
203 | inoremap <silent><expr> <TAB> | ||
204 | \ pumvisible() ? "\<C-n>" : | ||
205 | \ <SID>check_back_space() ? "\<TAB>" : | ||
206 | \ coc#refresh() | ||
207 | inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>" | ||
208 | |||
209 | function! s:check_back_space() abort | ||
210 | let col = col('.') - 1 | ||
211 | return !col || getline('.')[col - 1] =~# '\s' | ||
212 | endfunction | ||
213 | |||
214 | " Use <c-space> to trigger completion. | ||
215 | inoremap <silent><expr> <c-space> coc#refresh() | ||
216 | |||
217 | " Use <cr> to confirm completion, `<C-g>u` means break undo chain at current position. | ||
218 | " Coc only does snippet and additional edit on confirm. | ||
219 | inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>" | ||
220 | " Or use `complete_info` if your vim support it, like: | ||
221 | " inoremap <expr> <cr> complete_info()["selected"] != "-1" ? "\<C-y>" : "\<C-g>u\<CR>" | ||
222 | |||
223 | " Use `[g` and `]g` to navigate diagnostics | ||
224 | nmap <silent> [g <Plug>(coc-diagnostic-prev) | ||
225 | nmap <silent> ]g <Plug>(coc-diagnostic-next) | ||
226 | |||
227 | " Remap keys for gotos | ||
228 | nmap <silent> gd <Plug>(coc-definition) | ||
229 | nmap <silent> gy <Plug>(coc-type-definition) | ||
230 | nmap <silent> gi <Plug>(coc-implementation) | ||
231 | nmap <silent> gr <Plug>(coc-references) | ||
232 | |||
233 | function! s:show_documentation() | ||
234 | if (index(['vim','help'], &filetype) >= 0) | ||
235 | execute 'h '.expand('<cword>') | ||
236 | else | ||
237 | call CocAction('doHover') | ||
238 | endif | ||
239 | endfunction | ||
240 | |||
241 | " Remap for rename current word | ||
242 | nmap <rn> <Plug>(coc-rename) | ||
243 | |||
244 | " Remap for format selected region | ||
245 | xmap <leader>f <Plug>(coc-format-selected) | ||
246 | nmap <leader>f <Plug>(coc-format-selected) | ||
247 | |||
248 | augroup mygroup | ||
249 | autocmd! | ||
250 | " Setup formatexpr specified filetype(s). | ||
251 | autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected') | ||
252 | " Update signature help on jump placeholder | ||
253 | autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') | ||
254 | augroup end | ||
255 | |||
256 | " Remap for do codeAction of selected region, ex: `<leader>aap` for current paragraph | ||
257 | xmap <leader>a <Plug>(coc-codeaction-selected) | ||
258 | nmap <leader>a <Plug>(coc-codeaction-selected) | ||
259 | |||
260 | " Remap for do codeAction of current line | ||
261 | nmap <leader>ac <Plug>(coc-codeaction) | ||
262 | " Fix autofix problem of current line | ||
263 | nmap <leader>qf <Plug>(coc-fix-current) | ||
264 | |||
265 | " Create mappings for function text object, requires document symbols feature of languageserver. | ||
266 | xmap if <Plug>(coc-funcobj-i) | ||
267 | xmap af <Plug>(coc-funcobj-a) | ||
268 | omap if <Plug>(coc-funcobj-i) | ||
269 | omap af <Plug>(coc-funcobj-a) | ||
270 | |||
271 | " Use `:Format` to format current buffer | ||
272 | command! -nargs=0 Format :call CocAction('format') | ||
273 | |||
274 | " Use `:Fold` to fold current buffer | ||
275 | command! -nargs=? Fold :call CocAction('fold', <f-args>) | ||
276 | |||
277 | " use `:OR` for organize import of current buffer | ||
278 | command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport') | ||
279 | |||
280 | " Add status line support, for integration with other plugin, checkout `:h coc-status` | ||
281 | set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')} | ||
diff --git a/nvim/.config/nvim/lua/map.lua b/nvim/.config/nvim/lua/map.lua new file mode 100644 index 0000000..b158332 --- /dev/null +++ b/nvim/.config/nvim/lua/map.lua | |||
@@ -0,0 +1,47 @@ | |||
1 | vim.g.mapleader = " " | ||
2 | vim.keymap.set("n", "<leader>n", vim.cmd.Ex) | ||
3 | |||
4 | vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv") | ||
5 | vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv") | ||
6 | |||
7 | vim.keymap.set("n", "J", "mzJ`z") | ||
8 | vim.keymap.set("n", "<C-d>", "<C-d>zz") | ||
9 | vim.keymap.set("n", "<C-u>", "<C-u>zz") | ||
10 | vim.keymap.set("n", "n", "nzzzv") | ||
11 | vim.keymap.set("n", "N", "Nzzzv") | ||
12 | |||
13 | -- greatest remap ever | ||
14 | vim.keymap.set("x", "<leader>p", [["_dP]]) | ||
15 | |||
16 | -- next greatest remap ever : asbjornHaland | ||
17 | vim.keymap.set({"n", "v"}, "<leader>y", [["+y]]) | ||
18 | vim.keymap.set("n", "<leader>Y", [["+Y]]) | ||
19 | |||
20 | vim.keymap.set({"n", "v"}, "<leader>d", [["_d]]) | ||
21 | |||
22 | vim.keymap.set("n", "<leader>f", vim.lsp.buf.format) | ||
23 | |||
24 | vim.keymap.set("n", "<C-k>", "<cmd>cnext<CR>zz") | ||
25 | vim.keymap.set("n", "<C-j>", "<cmd>cprev<CR>zz") | ||
26 | vim.keymap.set("n", "<leader>k", "<cmd>lnext<CR>zz") | ||
27 | vim.keymap.set("n", "<leader>j", "<cmd>lprev<CR>zz") | ||
28 | |||
29 | vim.keymap.set("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]]) | ||
30 | vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>", { silent = true }) | ||
31 | |||
32 | vim.keymap.set("n", "<leader><tab>", ":FZF<CR>") | ||
33 | vim.keymap.set("n", "<leader>q", ":wq<CR>") | ||
34 | vim.keymap.set("n", "<leader>w", ":w<CR>") | ||
35 | |||
36 | vim.keymap.set("n", "<C-h>", "<C-w>h") | ||
37 | vim.keymap.set("n", "<C-j>", "<C-w>j") | ||
38 | vim.keymap.set("n", "<C-k>", "<C-w>k") | ||
39 | vim.keymap.set("n", "<C-l>", "<C-w>l") | ||
40 | |||
41 | vim.keymap.set("n", "S", ":%s//gI<Left><Left><Left>") | ||
42 | |||
43 | -- bujo | ||
44 | vim.keymap.set("n", "<C-n>", "<Plug>BujoAddnormal") | ||
45 | vim.keymap.set("i", "<C-n>", "<Plug>BujoAddinsert") | ||
46 | vim.keymap.set("n", "<C-p>", "<Plug>BujoChecknormal") | ||
47 | vim.keymap.set("i", "<C-p>", "<Plug>BujoCheckinsert") | ||
diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua new file mode 100644 index 0000000..569a7fc --- /dev/null +++ b/nvim/.config/nvim/lua/plugins.lua | |||
@@ -0,0 +1,40 @@ | |||
1 | -- This file can be loaded by calling `lua require('plugins')` from your init.vim | ||
2 | |||
3 | -- Only required if you have packer configured as `opt` | ||
4 | vim.cmd [[packadd packer.nvim]] | ||
5 | |||
6 | return require('packer').startup(function(use) | ||
7 | -- Packer can manage itself | ||
8 | use 'wbthomason/packer.nvim' | ||
9 | use({'nvim-treesitter/nvim-treesitter', run = ':TSUpdate'}) | ||
10 | use { | ||
11 | 'VonHeikemen/lsp-zero.nvim', | ||
12 | requires = { | ||
13 | -- LSP Support | ||
14 | {'neovim/nvim-lspconfig'}, | ||
15 | {'williamboman/mason.nvim'}, | ||
16 | {'williamboman/mason-lspconfig.nvim'}, | ||
17 | |||
18 | -- Autocompletion | ||
19 | {'hrsh7th/nvim-cmp'}, | ||
20 | {'hrsh7th/cmp-buffer'}, | ||
21 | {'hrsh7th/cmp-path'}, | ||
22 | {'saadparwaiz1/cmp_luasnip'}, | ||
23 | {'hrsh7th/cmp-nvim-lsp'}, | ||
24 | {'hrsh7th/cmp-nvim-lua'}, | ||
25 | |||
26 | -- Snippets | ||
27 | {'L3MON4D3/LuaSnip'}, | ||
28 | {'rafamadriz/friendly-snippets'}, | ||
29 | } | ||
30 | } | ||
31 | use { "junegunn/fzf", run = ":call fzf#install()" } | ||
32 | use 'airblade/vim-gitgutter' | ||
33 | use 'tpope/vim-commentary' | ||
34 | use 'sh-ubh/vim-bujo' | ||
35 | use { | ||
36 | 'windwp/nvim-autopairs', | ||
37 | config = function() require("nvim-autopairs").setup {} end | ||
38 | } | ||
39 | |||
40 | end) | ||
diff --git a/nvim/.config/nvim/lua/set.lua b/nvim/.config/nvim/lua/set.lua new file mode 100644 index 0000000..923eb9a --- /dev/null +++ b/nvim/.config/nvim/lua/set.lua | |||
@@ -0,0 +1,55 @@ | |||
1 | vim.opt.guicursor = "" | ||
2 | |||
3 | vim.opt.nu = true | ||
4 | vim.opt.relativenumber = true | ||
5 | |||
6 | vim.opt.tabstop = 4 | ||
7 | vim.opt.softtabstop = 4 | ||
8 | vim.opt.shiftwidth = 4 | ||
9 | vim.opt.expandtab = true | ||
10 | |||
11 | vim.opt.smartindent = true | ||
12 | |||
13 | vim.opt.wrap = false | ||
14 | |||
15 | vim.opt.swapfile = false | ||
16 | vim.opt.backup = false | ||
17 | vim.opt.undodir = os.getenv("HOME") .. "/.cache/nvim/undodir" | ||
18 | vim.opt.undofile = true | ||
19 | |||
20 | vim.opt.hlsearch = false | ||
21 | vim.opt.incsearch = true | ||
22 | |||
23 | vim.opt.termguicolors = true | ||
24 | |||
25 | vim.opt.scrolloff = 8 | ||
26 | vim.opt.signcolumn = "yes" | ||
27 | vim.opt.isfname:append("@-@") | ||
28 | |||
29 | vim.opt.updatetime = 50 | ||
30 | |||
31 | vim.opt.syntax = "enable" | ||
32 | vim.opt.cursorline = true | ||
33 | vim.opt.ignorecase = true | ||
34 | vim.opt.smartcase = true | ||
35 | vim.opt.wildmenu = true | ||
36 | vim.opt.autoread = true | ||
37 | |||
38 | vim.cmd('colorscheme plain') | ||
39 | |||
40 | -- gitgutter options | ||
41 | vim.g.gitgutter_override_sign_column_highlight = 0 | ||
42 | vim.g.gitgutter_sign_added = '+' | ||
43 | vim.g.gitgutter_sign_modified = '±' | ||
44 | vim.g.gitgutter_sign_removed = '-' | ||
45 | vim.g.gitgutter_sign_removed_first_line = '^' | ||
46 | vim.g.gitgutter_sign_modified_removed = '#' | ||
47 | |||
48 | -- netrw options | ||
49 | vim.g.netrw_browse_split = 0 | ||
50 | vim.g.netrw_banner = 0 | ||
51 | vim.g.netrw_winsize = 25 | ||
52 | |||
53 | -- set statusline | ||
54 | stl = require('statusline.line') | ||
55 | vim.opt.statusline = '%!luaeval("stl.statusline()")' | ||
diff --git a/nvim/.config/nvim/lua/statusline/git.lua b/nvim/.config/nvim/lua/statusline/git.lua new file mode 100644 index 0000000..4d3492c --- /dev/null +++ b/nvim/.config/nvim/lua/statusline/git.lua | |||
@@ -0,0 +1,45 @@ | |||
1 | local M = {} | ||
2 | |||
3 | local sep = package.config:sub(1,1) | ||
4 | |||
5 | local function find_git_dir() | ||
6 | local file_dir = vim.fn.expand('%:p:h') .. ';' | ||
7 | local git_dir = vim.fn.finddir('.git', file_dir) | ||
8 | if #git_dir > 0 then | ||
9 | M.in_git = true | ||
10 | end | ||
11 | return git_dir | ||
12 | end | ||
13 | |||
14 | local function get_git_head(head_file) | ||
15 | local f_head = io.open(head_file) | ||
16 | if f_head then | ||
17 | local HEAD = f_head:read() | ||
18 | f_head:close() | ||
19 | local branch = HEAD:match('ref: refs/heads/(.+)$') | ||
20 | if branch then M.git_branch = branch | ||
21 | else M.git_branch = HEAD:sub(1,7) end | ||
22 | end | ||
23 | return nil | ||
24 | end | ||
25 | |||
26 | -- event watcher to watch head file | ||
27 | local file_changed = vim.loop.new_fs_event() | ||
28 | local function watch_head() | ||
29 | file_changed:stop() | ||
30 | local git_dir = find_git_dir() | ||
31 | if #git_dir > 0 then | ||
32 | local head_file = git_dir..sep..'HEAD' | ||
33 | get_git_head(head_file) | ||
34 | file_changed:start(head_file, {}, vim.schedule_wrap(function() | ||
35 | -- reset file-watch | ||
36 | watch_head() | ||
37 | end)) | ||
38 | else | ||
39 | M.git_branch = '' | ||
40 | end | ||
41 | end | ||
42 | |||
43 | watch_head() | ||
44 | |||
45 | return M | ||
diff --git a/nvim/.config/nvim/lua/statusline/line.lua b/nvim/.config/nvim/lua/statusline/line.lua new file mode 100644 index 0000000..f70c2f8 --- /dev/null +++ b/nvim/.config/nvim/lua/statusline/line.lua | |||
@@ -0,0 +1,32 @@ | |||
1 | local git = require('statusline.git') | ||
2 | local utils = require('utils') | ||
3 | local M = {} | ||
4 | |||
5 | -- set highlights for statusline sections | ||
6 | vim.api.nvim_exec( | ||
7 | [[ | ||
8 | hi PrimaryBlock ctermfg=06 ctermbg=00 | ||
9 | hi SecondaryBlock ctermfg=07 ctermbg=00 | ||
10 | hi Blanks ctermfg=08 ctermbg=00 | ||
11 | hi GitClean ctermfg=02 ctermbg=00 | ||
12 | hi GitDirty ctermfg=01 ctermbg=00 | ||
13 | ]], false) | ||
14 | |||
15 | function M.statusline() | ||
16 | local stl = { | ||
17 | '%#PrimaryBlock#', | ||
18 | '%f', | ||
19 | '%#Blanks#', | ||
20 | '%m', | ||
21 | '%#SecondaryBlock#', | ||
22 | ' '..git.git_branch, | ||
23 | '%=', | ||
24 | '%#SecondaryBlock#', | ||
25 | '%l,%c ', | ||
26 | '%#PrimaryBlock#', | ||
27 | '%{&filetype}', | ||
28 | } | ||
29 | return table.concat(stl) | ||
30 | end | ||
31 | |||
32 | return M | ||
diff --git a/nvim/.config/nvim/lua/utils.lua b/nvim/.config/nvim/lua/utils.lua new file mode 100644 index 0000000..84b4b8d --- /dev/null +++ b/nvim/.config/nvim/lua/utils.lua | |||
@@ -0,0 +1,18 @@ | |||
1 | local M = {} | ||
2 | local cmd = vim.cmd | ||
3 | |||
4 | function M.create_augroup(autocmds, name) | ||
5 | cmd('augroup ' .. name) | ||
6 | cmd('autocmd!') | ||
7 | for _, autocmd in ipairs(autocmds) do | ||
8 | cmd('autocmd ' .. table.concat(autocmd, ' ')) | ||
9 | end | ||
10 | cmd('augroup END') | ||
11 | end | ||
12 | |||
13 | function M.iabbrev(a, b) | ||
14 | cmd(string.format('iabbrev %s %s', a, b)) | ||
15 | end | ||
16 | |||
17 | return M | ||
18 | |||
diff --git a/nvim/.config/nvim/plugin/packer_compiled.lua b/nvim/.config/nvim/plugin/packer_compiled.lua new file mode 100644 index 0000000..9d2bf07 --- /dev/null +++ b/nvim/.config/nvim/plugin/packer_compiled.lua | |||
@@ -0,0 +1,194 @@ | |||
1 | -- Automatically generated packer.nvim plugin loader code | ||
2 | |||
3 | if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then | ||
4 | vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"') | ||
5 | return | ||
6 | end | ||
7 | |||
8 | vim.api.nvim_command('packadd packer.nvim') | ||
9 | |||
10 | local no_errors, error_msg = pcall(function() | ||
11 | |||
12 | _G._packer = _G._packer or {} | ||
13 | _G._packer.inside_compile = true | ||
14 | |||
15 | local time | ||
16 | local profile_info | ||
17 | local should_profile = false | ||
18 | if should_profile then | ||
19 | local hrtime = vim.loop.hrtime | ||
20 | profile_info = {} | ||
21 | time = function(chunk, start) | ||
22 | if start then | ||
23 | profile_info[chunk] = hrtime() | ||
24 | else | ||
25 | profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6 | ||
26 | end | ||
27 | end | ||
28 | else | ||
29 | time = function(chunk, start) end | ||
30 | end | ||
31 | |||
32 | local function save_profiles(threshold) | ||
33 | local sorted_times = {} | ||
34 | for chunk_name, time_taken in pairs(profile_info) do | ||
35 | sorted_times[#sorted_times + 1] = {chunk_name, time_taken} | ||
36 | end | ||
37 | table.sort(sorted_times, function(a, b) return a[2] > b[2] end) | ||
38 | local results = {} | ||
39 | for i, elem in ipairs(sorted_times) do | ||
40 | if not threshold or threshold and elem[2] > threshold then | ||
41 | results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms' | ||
42 | end | ||
43 | end | ||
44 | if threshold then | ||
45 | table.insert(results, '(Only showing plugins that took longer than ' .. threshold .. ' ms ' .. 'to load)') | ||
46 | end | ||
47 | |||
48 | _G._packer.profile_output = results | ||
49 | end | ||
50 | |||
51 | time([[Luarocks path setup]], true) | ||
52 | local package_path_str = "/var/home/shubh/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/var/home/shubh/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/var/home/shubh/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/var/home/shubh/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua" | ||
53 | local install_cpath_pattern = "/var/home/shubh/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so" | ||
54 | if not string.find(package.path, package_path_str, 1, true) then | ||
55 | package.path = package.path .. ';' .. package_path_str | ||
56 | end | ||
57 | |||
58 | if not string.find(package.cpath, install_cpath_pattern, 1, true) then | ||
59 | package.cpath = package.cpath .. ';' .. install_cpath_pattern | ||
60 | end | ||
61 | |||
62 | time([[Luarocks path setup]], false) | ||
63 | time([[try_loadstring definition]], true) | ||
64 | local function try_loadstring(s, component, name) | ||
65 | local success, result = pcall(loadstring(s), name, _G.packer_plugins[name]) | ||
66 | if not success then | ||
67 | vim.schedule(function() | ||
68 | vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {}) | ||
69 | end) | ||
70 | end | ||
71 | return result | ||
72 | end | ||
73 | |||
74 | time([[try_loadstring definition]], false) | ||
75 | time([[Defining packer_plugins]], true) | ||
76 | _G.packer_plugins = { | ||
77 | LuaSnip = { | ||
78 | loaded = true, | ||
79 | path = "/var/home/shubh/.local/share/nvim/site/pack/packer/start/LuaSnip", | ||
80 | url = "https://github.com/L3MON4D3/LuaSnip" | ||
81 | }, | ||
82 | ["cmp-buffer"] = { | ||
83 | loaded = true, | ||
84 | path = "/var/home/shubh/.local/share/nvim/site/pack/packer/start/cmp-buffer", | ||
85 | url = "https://github.com/hrsh7th/cmp-buffer" | ||
86 | }, | ||
87 | ["cmp-nvim-lsp"] = { | ||
88 | loaded = true, | ||
89 | path = "/var/home/shubh/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp", | ||
90 | url = "https://github.com/hrsh7th/cmp-nvim-lsp" | ||
91 | }, | ||
92 | ["cmp-nvim-lua"] = { | ||
93 | loaded = true, | ||
94 | path = "/var/home/shubh/.local/share/nvim/site/pack/packer/start/cmp-nvim-lua", | ||
95 | url = "https://github.com/hrsh7th/cmp-nvim-lua" | ||
96 | }, | ||
97 | ["cmp-path"] = { | ||
98 | loaded = true, | ||
99 | path = "/var/home/shubh/.local/share/nvim/site/pack/packer/start/cmp-path", | ||
100 | url = "https://github.com/hrsh7th/cmp-path" | ||
101 | }, | ||
102 | cmp_luasnip = { | ||
103 | loaded = true, | ||
104 | path = "/var/home/shubh/.local/share/nvim/site/pack/packer/start/cmp_luasnip", | ||
105 | url = "https://github.com/saadparwaiz1/cmp_luasnip" | ||
106 | }, | ||
107 | ["friendly-snippets"] = { | ||
108 | loaded = true, | ||
109 | path = "/var/home/shubh/.local/share/nvim/site/pack/packer/start/friendly-snippets", | ||
110 | url = "https://github.com/rafamadriz/friendly-snippets" | ||
111 | }, | ||
112 | fzf = { | ||
113 | loaded = true, | ||
114 | path = "/var/home/shubh/.local/share/nvim/site/pack/packer/start/fzf", | ||
115 | url = "https://github.com/junegunn/fzf" | ||
116 | }, | ||
117 | ["lsp-zero.nvim"] = { | ||
118 | loaded = true, | ||
119 | path = "/var/home/shubh/.local/share/nvim/site/pack/packer/start/lsp-zero.nvim", | ||
120 | url = "https://github.com/VonHeikemen/lsp-zero.nvim" | ||
121 | }, | ||
122 | ["mason-lspconfig.nvim"] = { | ||
123 | loaded = true, | ||
124 | path = "/var/home/shubh/.local/share/nvim/site/pack/packer/start/mason-lspconfig.nvim", | ||
125 | url = "https://github.com/williamboman/mason-lspconfig.nvim" | ||
126 | }, | ||
127 | ["mason.nvim"] = { | ||
128 | loaded = true, | ||
129 | path = "/var/home/shubh/.local/share/nvim/site/pack/packer/start/mason.nvim", | ||
130 | url = "https://github.com/williamboman/mason.nvim" | ||
131 | }, | ||
132 | ["nvim-autopairs"] = { | ||
133 | config = { "\27LJ\2\n@\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\19nvim-autopairs\frequire\0" }, | ||
134 | loaded = true, | ||
135 | path = "/var/home/shubh/.local/share/nvim/site/pack/packer/start/nvim-autopairs", | ||
136 | url = "https://github.com/windwp/nvim-autopairs" | ||
137 | }, | ||
138 | ["nvim-cmp"] = { | ||
139 | loaded = true, | ||
140 | path = "/var/home/shubh/.local/share/nvim/site/pack/packer/start/nvim-cmp", | ||
141 | url = "https://github.com/hrsh7th/nvim-cmp" | ||
142 | }, | ||
143 | ["nvim-lspconfig"] = { | ||
144 | loaded = true, | ||
145 | path = "/var/home/shubh/.local/share/nvim/site/pack/packer/start/nvim-lspconfig", | ||
146 | url = "https://github.com/neovim/nvim-lspconfig" | ||
147 | }, | ||
148 | ["nvim-treesitter"] = { | ||
149 | loaded = true, | ||
150 | path = "/var/home/shubh/.local/share/nvim/site/pack/packer/start/nvim-treesitter", | ||
151 | url = "https://github.com/nvim-treesitter/nvim-treesitter" | ||
152 | }, | ||
153 | ["packer.nvim"] = { | ||
154 | loaded = true, | ||
155 | path = "/var/home/shubh/.local/share/nvim/site/pack/packer/start/packer.nvim", | ||
156 | url = "https://github.com/wbthomason/packer.nvim" | ||
157 | }, | ||
158 | ["vim-bujo"] = { | ||
159 | loaded = true, | ||
160 | path = "/var/home/shubh/.local/share/nvim/site/pack/packer/start/vim-bujo", | ||
161 | url = "https://github.com/sh-ubh/vim-bujo" | ||
162 | }, | ||
163 | ["vim-commentary"] = { | ||
164 | loaded = true, | ||
165 | path = "/var/home/shubh/.local/share/nvim/site/pack/packer/start/vim-commentary", | ||
166 | url = "https://github.com/tpope/vim-commentary" | ||
167 | }, | ||
168 | ["vim-gitgutter"] = { | ||
169 | loaded = true, | ||
170 | path = "/var/home/shubh/.local/share/nvim/site/pack/packer/start/vim-gitgutter", | ||
171 | url = "https://github.com/airblade/vim-gitgutter" | ||
172 | } | ||
173 | } | ||
174 | |||
175 | time([[Defining packer_plugins]], false) | ||
176 | -- Config for: nvim-autopairs | ||
177 | time([[Config for nvim-autopairs]], true) | ||
178 | try_loadstring("\27LJ\2\n@\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\19nvim-autopairs\frequire\0", "config", "nvim-autopairs") | ||
179 | time([[Config for nvim-autopairs]], false) | ||
180 | |||
181 | _G._packer.inside_compile = false | ||
182 | if _G._packer.needs_bufread == true then | ||
183 | vim.cmd("doautocmd BufRead") | ||
184 | end | ||
185 | _G._packer.needs_bufread = false | ||
186 | |||
187 | if should_profile then save_profiles() end | ||
188 | |||
189 | end) | ||
190 | |||
191 | if not no_errors then | ||
192 | error_msg = error_msg:gsub('"', '\\"') | ||
193 | vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None') | ||
194 | end | ||