Mercurial > dotfiles
comparison .chezmoitemplates/init.lua @ 487:0252f9494d64
Remove deferred loading of packer plugins
author | Zeger Van de Vannet <zegervdv@me.com> |
---|---|
date | Wed, 10 Nov 2021 14:31:42 +0100 |
parents | 3449f059b93e |
children | 8edc5f86e9c3 |
comparison
equal
deleted
inserted
replaced
486:3449f059b93e | 487:0252f9494d64 |
---|---|
10 | 10 |
11 if fn.empty(fn.glob(install_path)) > 0 then | 11 if fn.empty(fn.glob(install_path)) > 0 then |
12 execute('!git clone https://github.com/wbthomason/packer.nvim ' .. install_path) | 12 execute('!git clone https://github.com/wbthomason/packer.nvim ' .. install_path) |
13 end | 13 end |
14 | 14 |
15 vim.defer_fn(function() | 15 -- Packer configuration is compiled and only needs to be loaded on changes |
16 -- Packer configuration is compiled and only needs to be loaded on changes | 16 vim.cmd 'packadd packer.nvim' |
17 vim.cmd 'packadd packer.nvim' | 17 |
18 | 18 require('packer').startup(function() |
19 require('packer').startup(function() | 19 use { 'wbthomason/packer.nvim', opt = true } |
20 use { 'wbthomason/packer.nvim', opt = true } | 20 |
21 | 21 -- General plugins |
22 -- General plugins | 22 use { 'tpope/vim-sensible' } |
23 use { 'tpope/vim-sensible' } | 23 use { 'tpope/vim-repeat' } |
24 use { 'tpope/vim-repeat' } | 24 use { 'tpope/vim-rsi' } |
25 use { 'tpope/vim-rsi' } | 25 use { 'sgur/vim-editorconfig' } |
26 use { 'sgur/vim-editorconfig' } | 26 use { 'ShikChen/osc52.vim' } |
27 use { 'ShikChen/osc52.vim' } | 27 use { 'einfachtoll/didyoumean' } |
28 use { 'einfachtoll/didyoumean' } | 28 |
29 | 29 use { |
30 use { | 30 'tpope/vim-eunuch', |
31 'tpope/vim-eunuch', | 31 cmd = { |
32 cmd = { | 32 'Delete', |
33 'Delete', | 33 'Unlink', |
34 'Unlink', | 34 'Move', |
35 'Move', | 35 'Rename', |
36 'Rename', | 36 'Mkdir', |
37 'Mkdir', | 37 'Chmod', |
38 'Chmod', | 38 'Cfind', |
39 'Cfind', | 39 'Clocate', |
40 'Clocate', | 40 'Lfind', |
41 'Lfind', | 41 'Llocate', |
42 'Llocate', | 42 'SudoEdit', |
43 'SudoEdit', | 43 'SudoWrite', |
44 'SudoWrite', | 44 'Wall', |
45 'Wall', | 45 }, |
46 }, | 46 } |
47 } | 47 |
48 | 48 use { 'psliwka/vim-smoothie' } |
49 use { 'psliwka/vim-smoothie' } | 49 |
50 | 50 use { 'lewis6991/impatient.nvim' } |
51 use { 'lewis6991/impatient.nvim' } | 51 |
52 | 52 use { 'nvim-lua/plenary.nvim' } |
53 use { 'nvim-lua/plenary.nvim' } | 53 |
54 | 54 -- Spelling/autocorrection |
55 -- Spelling/autocorrection | 55 use { 'tpope/vim-abolish' } |
56 use { 'tpope/vim-abolish' } | 56 |
57 | 57 -- Git/VCS |
58 -- Git/VCS | 58 use { 'vim-scripts/gitignore' } |
59 use { 'vim-scripts/gitignore' } | 59 use { |
60 use { | 60 'sjl/splice.vim', |
61 'sjl/splice.vim', | 61 opt = true, |
62 opt = true, | 62 cmd = { 'SpliceInit' }, |
63 cmd = { 'SpliceInit' }, | 63 config = function() |
64 vim.g.splice_initial_diff_grid = 1 | |
65 vim.g.splice_initial_diff_compare = 1 | |
66 vim.g.splice_initial_diff_path = 0 | |
67 vim.g.splice_initial_scrollbind_grid = 1 | |
68 vim.g.splice_initial_scrollbind_compare = 1 | |
69 vim.g.splice_initial_scrollbind_path = 1 | |
70 vim.g.splice_wrap = 'nowrap' | |
71 end, | |
72 } | |
73 use { 'tpope/vim-git', ft = { 'gitcommit', 'gitrebase' } } | |
74 | |
75 -- Comments | |
76 use { | |
77 'b3nj5m1n/kommentary', | |
78 config = function() | |
79 require('kommentary.config').configure_language('default', { prefer_single_line_comments = true }) | |
80 end, | |
81 keys = { | |
82 { 'n', 'gcc' }, | |
83 { 'v', 'gc' }, | |
84 }, | |
85 } | |
86 | |
87 -- Undoing | |
88 use { 'sjl/gundo.vim', cmd = { 'GundoToggle' } } | |
89 | |
90 -- Parentheses etc | |
91 use { 'tpope/vim-surround' } | |
92 use { | |
93 'windwp/nvim-autopairs', | |
94 config = function() | |
95 local npairs = require 'nvim-autopairs' | |
96 local Rule = require 'nvim-autopairs.rule' | |
97 | |
98 local cmp = require 'nvim-autopairs.completion.cmp' | |
99 | |
100 require('cmp').event:on('confirm_done', cmp.on_confirm_done()) | |
101 | |
102 npairs.setup { | |
103 ignored_next_char = string.gsub([[ [%w%%%'%[%.] ]], '%s+', ''), | |
104 } | |
105 | |
106 npairs.add_rules { | |
107 Rule(' ', ' '):with_pair(function(opts) | |
108 local pair = opts.line:sub(opts.col - 1, opts.col) | |
109 return vim.tbl_contains({ '()', '[]', '{}' }, pair) | |
110 end), | |
111 Rule('( ', ' )') | |
112 :with_pair(function() | |
113 return false | |
114 end) | |
115 :with_move(function(opts) | |
116 return opts.prev_char:match '.%)' ~= nil | |
117 end) | |
118 :use_key ')', | |
119 Rule('{ ', ' }') | |
120 :with_pair(function() | |
121 return false | |
122 end) | |
123 :with_move(function(opts) | |
124 return opts.prev_char:match '.%}' ~= nil | |
125 end) | |
126 :use_key '}', | |
127 Rule('[ ', ' ]') | |
128 :with_pair(function() | |
129 return false | |
130 end) | |
131 :with_move(function(opts) | |
132 return opts.prev_char:match '.%]' ~= nil | |
133 end) | |
134 :use_key ']', | |
135 } | |
136 | |
137 npairs.get_rule('`'):with_pair(function() | |
138 return vim.bo.filetype ~= 'systemverilog' | |
139 end) | |
140 | |
141 npairs.get_rule("'")[1]:with_pair(function() | |
142 return vim.bo.filetype ~= 'systemverilog' | |
143 end) | |
144 end, | |
145 after = { 'nvim-cmp' }, | |
146 } | |
147 | |
148 -- Moving around within lines | |
149 use { 'wellle/targets.vim', event = 'InsertEnter *' } | |
150 | |
151 -- Searching | |
152 use { 'mhinz/vim-grepper', cmd = { 'Grepper' } } | |
153 | |
154 -- Keymaps TODO: to be removed when #13823 is merged | |
155 use { | |
156 'tjdevries/astronauta.nvim', | |
157 config = function() | |
158 require 'astronauta.keymap' | |
159 end, | |
160 } | |
161 | |
162 -- Opening files | |
163 use { 'wsdjeg/vim-fetch' } | |
164 | |
165 -- session management | |
166 use { | |
167 'folke/persistence.nvim', | |
168 event = 'BufReadPre', | |
169 module = 'persistence', | |
170 config = function() | |
171 require('persistence').setup() | |
172 end, | |
173 } | |
174 | |
175 -- Indent lines | |
176 use { | |
177 'lukas-reineke/indent-blankline.nvim', | |
178 config = function() | |
179 vim.g.indent_blankline_buftype_exclude = { 'terminal', 'help', 'nofile' } | |
180 vim.g.indent_blankline_show_first_indent_level = false | |
181 vim.g.indent_blankline_char = '│' | |
182 end, | |
183 } | |
184 | |
185 -- Increment/decrement | |
186 use { | |
187 'zegervdv/nrpattern.nvim', | |
188 requires = 'tpope/vim-repeat', | |
189 config = function() | |
190 local nrpattern = require 'nrpattern' | |
191 local defaults = require 'nrpattern.default' | |
192 | |
193 defaults[{ 'input', 'output' }] = { priority = 12, filetypes = { 'verilog', 'systemverilog' } } | |
194 defaults[{ "'1", "'0" }] = { priority = 9, filetypes = { 'verilog', 'systemverilog' } } | |
195 | |
196 nrpattern.setup(defaults) | |
197 end, | |
198 } | |
199 | |
200 -- Tmux | |
201 use { | |
202 'numtostr/navigator.nvim', | |
203 config = function() | |
204 require('Navigator').setup { auto_save = 'current', disable_on_zoom = true } | |
205 | |
206 local nnoremap = vim.keymap.nnoremap | |
207 nnoremap { '<c-h>', require('Navigator').left, silent = true } | |
208 nnoremap { '<c-j>', require('Navigator').down, silent = true } | |
209 nnoremap { '<c-k>', require('Navigator').up, silent = true } | |
210 nnoremap { '<c-l>', require('Navigator').right, silent = true } | |
211 end, | |
212 requires = 'tjdevries/astronauta.nvim', | |
213 after = 'astronauta.nvim', | |
214 } | |
215 | |
216 -- Completion/snippets/LSP | |
217 use { 'neovim/nvim-lspconfig' } | |
218 use { | |
219 'hrsh7th/nvim-cmp', | |
220 requires = { 'hrsh7th/cmp-buffer', 'hrsh7th/cmp-nvim-lsp', 'saadparwaiz1/cmp_luasnip', 'hrsh7th/cmp-path' }, | |
221 config = function() | |
222 local cmp = require 'cmp' | |
223 local luasnip = require 'luasnip' | |
224 | |
225 local has_words_before = function() | |
226 local line, col = unpack(vim.api.nvim_win_get_cursor(0)) | |
227 return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match '%s' == nil | |
228 end | |
229 | |
230 cmp.setup { | |
231 snippet = { | |
232 expand = function(args) | |
233 luasnip.lsp_expand(args.body) | |
234 end, | |
235 }, | |
236 mapping = { | |
237 ['<C-p>'] = cmp.mapping.select_prev_item(), | |
238 ['<C-n>'] = cmp.mapping.select_next_item(), | |
239 ['<C-d>'] = cmp.mapping.scroll_docs(-4), | |
240 ['<C-y>'] = cmp.mapping.complete(), | |
241 ['<C-e>'] = cmp.mapping.close(), | |
242 ['<CR>'] = cmp.mapping.confirm { | |
243 behavior = cmp.ConfirmBehavior.Replace, | |
244 }, | |
245 ['<Tab>'] = cmp.mapping(function(fallback) | |
246 if cmp.visible() then | |
247 cmp.select_next_item() | |
248 elseif luasnip.expand_or_jumpable() then | |
249 luasnip.expand_or_jump() | |
250 elseif has_words_before() then | |
251 cmp.complete() | |
252 else | |
253 fallback() | |
254 end | |
255 end, { | |
256 'i', | |
257 's', | |
258 }), | |
259 | |
260 ['<S-Tab>'] = cmp.mapping(function(fallback) | |
261 if cmp.visible() then | |
262 cmp.select_prev_item() | |
263 elseif luasnip.jumpable(-1) then | |
264 luasnip.jump(-1) | |
265 else | |
266 fallback() | |
267 end | |
268 end, { | |
269 'i', | |
270 's', | |
271 }), | |
272 }, | |
273 sources = { | |
274 { name = 'nvim_lsp' }, | |
275 { name = 'buffer', keyword_length = 5 }, | |
276 { name = 'luasnip' }, | |
277 { name = 'path' }, | |
278 }, | |
279 experimental = { | |
280 native_menu = false, | |
281 ghost_text = true, | |
282 }, | |
283 } | |
284 end, | |
285 after = 'luasnip', | |
286 } | |
287 use { | |
288 { | |
289 'nvim-treesitter/nvim-treesitter', | |
64 config = function() | 290 config = function() |
65 vim.g.splice_initial_diff_grid = 1 | 291 require 'nvim-treesitter.highlight' |
66 vim.g.splice_initial_diff_compare = 1 | 292 |
67 vim.g.splice_initial_diff_path = 0 | 293 require('nvim-treesitter.configs').setup { |
68 vim.g.splice_initial_scrollbind_grid = 1 | 294 highlight = { enable = false }, |
69 vim.g.splice_initial_scrollbind_compare = 1 | 295 incremental_selection = { |
70 vim.g.splice_initial_scrollbind_path = 1 | 296 enable = true, |
71 vim.g.splice_wrap = 'nowrap' | 297 keymaps = { |
72 end, | 298 init_selection = 'gnn', |
73 } | 299 node_incremental = 'grn', |
74 use { 'tpope/vim-git', ft = { 'gitcommit', 'gitrebase' } } | 300 scope_incremental = 'grc', |
75 | 301 node_decremental = 'grm', |
76 -- Comments | 302 }, |
77 use { | |
78 'b3nj5m1n/kommentary', | |
79 config = function() | |
80 require('kommentary.config').configure_language('default', { prefer_single_line_comments = true }) | |
81 end, | |
82 keys = { | |
83 { 'n', 'gcc' }, | |
84 { 'v', 'gc' }, | |
85 }, | |
86 } | |
87 | |
88 -- Undoing | |
89 use { 'sjl/gundo.vim', cmd = { 'GundoToggle' } } | |
90 | |
91 -- Parentheses etc | |
92 use { 'tpope/vim-surround' } | |
93 use { | |
94 'windwp/nvim-autopairs', | |
95 config = function() | |
96 local npairs = require 'nvim-autopairs' | |
97 local Rule = require 'nvim-autopairs.rule' | |
98 | |
99 local cmp = require 'nvim-autopairs.completion.cmp' | |
100 | |
101 require('cmp').event:on('confirm_done', cmp.on_confirm_done()) | |
102 | |
103 npairs.setup { | |
104 ignored_next_char = string.gsub([[ [%w%%%'%[%.] ]], '%s+', ''), | |
105 } | |
106 | |
107 npairs.add_rules { | |
108 Rule(' ', ' '):with_pair(function(opts) | |
109 local pair = opts.line:sub(opts.col - 1, opts.col) | |
110 return vim.tbl_contains({ '()', '[]', '{}' }, pair) | |
111 end), | |
112 Rule('( ', ' )') | |
113 :with_pair(function() | |
114 return false | |
115 end) | |
116 :with_move(function(opts) | |
117 return opts.prev_char:match '.%)' ~= nil | |
118 end) | |
119 :use_key ')', | |
120 Rule('{ ', ' }') | |
121 :with_pair(function() | |
122 return false | |
123 end) | |
124 :with_move(function(opts) | |
125 return opts.prev_char:match '.%}' ~= nil | |
126 end) | |
127 :use_key '}', | |
128 Rule('[ ', ' ]') | |
129 :with_pair(function() | |
130 return false | |
131 end) | |
132 :with_move(function(opts) | |
133 return opts.prev_char:match '.%]' ~= nil | |
134 end) | |
135 :use_key ']', | |
136 } | |
137 | |
138 npairs.get_rule('`'):with_pair(function() | |
139 return vim.bo.filetype ~= 'systemverilog' | |
140 end) | |
141 | |
142 npairs.get_rule("'")[1]:with_pair(function() | |
143 return vim.bo.filetype ~= 'systemverilog' | |
144 end) | |
145 end, | |
146 after = { 'nvim-cmp' }, | |
147 } | |
148 | |
149 -- Moving around within lines | |
150 use { 'wellle/targets.vim', event = 'InsertEnter *' } | |
151 | |
152 -- Searching | |
153 use { 'mhinz/vim-grepper', cmd = { 'Grepper' } } | |
154 | |
155 -- Keymaps TODO: to be removed when #13823 is merged | |
156 use { | |
157 'tjdevries/astronauta.nvim', | |
158 config = function() | |
159 require 'astronauta.keymap' | |
160 end, | |
161 } | |
162 | |
163 -- Opening files | |
164 use { 'wsdjeg/vim-fetch' } | |
165 | |
166 -- session management | |
167 use { | |
168 'folke/persistence.nvim', | |
169 event = 'BufReadPre', | |
170 module = 'persistence', | |
171 config = function() | |
172 require('persistence').setup() | |
173 end, | |
174 } | |
175 | |
176 -- Indent lines | |
177 use { | |
178 'lukas-reineke/indent-blankline.nvim', | |
179 config = function() | |
180 vim.g.indent_blankline_buftype_exclude = { 'terminal', 'help', 'nofile' } | |
181 vim.g.indent_blankline_show_first_indent_level = false | |
182 vim.g.indent_blankline_char = '│' | |
183 end, | |
184 } | |
185 | |
186 -- Increment/decrement | |
187 use { | |
188 'zegervdv/nrpattern.nvim', | |
189 requires = 'tpope/vim-repeat', | |
190 config = function() | |
191 local nrpattern = require 'nrpattern' | |
192 local defaults = require 'nrpattern.default' | |
193 | |
194 defaults[{ 'input', 'output' }] = { priority = 12, filetypes = { 'verilog', 'systemverilog' } } | |
195 defaults[{ "'1", "'0" }] = { priority = 9, filetypes = { 'verilog', 'systemverilog' } } | |
196 | |
197 nrpattern.setup(defaults) | |
198 end, | |
199 } | |
200 | |
201 -- Tmux | |
202 use { | |
203 'numtostr/navigator.nvim', | |
204 config = function() | |
205 require('Navigator').setup { auto_save = 'current', disable_on_zoom = true } | |
206 | |
207 local nnoremap = vim.keymap.nnoremap | |
208 nnoremap { '<c-h>', require('Navigator').left, silent = true } | |
209 nnoremap { '<c-j>', require('Navigator').down, silent = true } | |
210 nnoremap { '<c-k>', require('Navigator').up, silent = true } | |
211 nnoremap { '<c-l>', require('Navigator').right, silent = true } | |
212 end, | |
213 requires = 'tjdevries/astronauta.nvim', | |
214 after = 'astronauta.nvim', | |
215 } | |
216 | |
217 -- Completion/snippets/LSP | |
218 use { 'neovim/nvim-lspconfig' } | |
219 use { | |
220 'hrsh7th/nvim-cmp', | |
221 requires = { 'hrsh7th/cmp-buffer', 'hrsh7th/cmp-nvim-lsp', 'saadparwaiz1/cmp_luasnip', 'hrsh7th/cmp-path' }, | |
222 config = function() | |
223 local cmp = require 'cmp' | |
224 local luasnip = require 'luasnip' | |
225 | |
226 local has_words_before = function() | |
227 local line, col = unpack(vim.api.nvim_win_get_cursor(0)) | |
228 return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match '%s' == nil | |
229 end | |
230 | |
231 cmp.setup { | |
232 snippet = { | |
233 expand = function(args) | |
234 luasnip.lsp_expand(args.body) | |
235 end, | |
236 }, | 303 }, |
237 mapping = { | 304 refactor = { |
238 ['<C-p>'] = cmp.mapping.select_prev_item(), | 305 highlight_definitions = { enable = true }, |
239 ['<C-n>'] = cmp.mapping.select_next_item(), | 306 smart_rename = { enable = true, keymaps = { smart_rename = 'gsr' } }, |
240 ['<C-d>'] = cmp.mapping.scroll_docs(-4), | 307 navigation = { |
241 ['<C-y>'] = cmp.mapping.complete(), | 308 enable = true, |
242 ['<C-e>'] = cmp.mapping.close(), | 309 keymaps = { goto_definition = 'gnd', list_definitions = 'gnD' }, |
243 ['<CR>'] = cmp.mapping.confirm { | |
244 behavior = cmp.ConfirmBehavior.Replace, | |
245 }, | 310 }, |
246 ['<Tab>'] = cmp.mapping(function(fallback) | |
247 if cmp.visible() then | |
248 cmp.select_next_item() | |
249 elseif luasnip.expand_or_jumpable() then | |
250 luasnip.expand_or_jump() | |
251 elseif has_words_before() then | |
252 cmp.complete() | |
253 else | |
254 fallback() | |
255 end | |
256 end, { | |
257 'i', | |
258 's', | |
259 }), | |
260 | |
261 ['<S-Tab>'] = cmp.mapping(function(fallback) | |
262 if cmp.visible() then | |
263 cmp.select_prev_item() | |
264 elseif luasnip.jumpable(-1) then | |
265 luasnip.jump(-1) | |
266 else | |
267 fallback() | |
268 end | |
269 end, { | |
270 'i', | |
271 's', | |
272 }), | |
273 }, | 311 }, |
274 sources = { | 312 textobjects = { |
275 { name = 'nvim_lsp' }, | 313 move = { |
276 { name = 'buffer', keyword_length = 5 }, | 314 enable = true, |
277 { name = 'luasnip' }, | 315 goto_next_start = { [']]'] = '@block.outer' }, |
278 { name = 'path' }, | 316 goto_previous_start = { ['[['] = '@block.outer' }, |
317 goto_next_end = { [']['] = '@block.outer' }, | |
318 goto_previous_end = { ['[]'] = '@block.outer' }, | |
319 }, | |
279 }, | 320 }, |
280 experimental = { | 321 playground = { enable = true, disable = {}, updatetime = 25, persist_queries = false }, |
281 native_menu = false, | |
282 ghost_text = true, | |
283 }, | |
284 } | 322 } |
285 end, | 323 end, |
286 after = 'luasnip', | 324 }, |
287 } | 325 'nvim-treesitter/nvim-treesitter-refactor', |
288 use { | 326 'nvim-treesitter/nvim-treesitter-textobjects', |
289 { | 327 { 'nvim-treesitter/playground', opt = true }, |
290 'nvim-treesitter/nvim-treesitter', | 328 } |
291 config = function() | 329 use { 'L3MON4D3/luasnip' } |
292 require 'nvim-treesitter.highlight' | 330 use { |
293 | 331 'rmagatti/goto-preview', |
294 require('nvim-treesitter.configs').setup { | 332 config = function() |
295 highlight = { enable = false }, | 333 require('goto-preview').setup {} |
296 incremental_selection = { | 334 end, |
297 enable = true, | 335 } |
298 keymaps = { | 336 use { |
299 init_selection = 'gnn', | 337 'jose-elias-alvarez/null-ls.nvim', |
300 node_incremental = 'grn', | 338 requires = 'nvim-lua/plenary.nvim', |
301 scope_incremental = 'grc', | 339 } |
302 node_decremental = 'grm', | 340 use { 'folke/lua-dev.nvim' } |
303 }, | 341 |
304 }, | 342 use { 'vimjas/vim-python-pep8-indent', ft = { 'python' } } |
305 refactor = { | 343 |
306 highlight_definitions = { enable = true }, | 344 -- Vanity |
307 smart_rename = { enable = true, keymaps = { smart_rename = 'gsr' } }, | 345 use { |
308 navigation = { | 346 'yamatsum/nvim-web-nonicons', |
309 enable = true, | 347 requires = 'kyazdani42/nvim-web-devicons', |
310 keymaps = { goto_definition = 'gnd', list_definitions = 'gnD' }, | 348 config = function() |
311 }, | 349 require 'nvim-nonicons' |
312 }, | 350 end, |
313 textobjects = { | 351 } |
314 move = { | 352 |
315 enable = true, | 353 use { |
316 goto_next_start = { [']]'] = '@block.outer' }, | 354 'NTBBloodbath/galaxyline.nvim', |
317 goto_previous_start = { ['[['] = '@block.outer' }, | 355 branch = 'main', |
318 goto_next_end = { [']['] = '@block.outer' }, | 356 -- your statusline |
319 goto_previous_end = { ['[]'] = '@block.outer' }, | 357 config = function() |
320 }, | 358 local gl = require 'galaxyline' |
321 }, | 359 local colors = require('galaxyline.themes.colors').default |
322 playground = { enable = true, disable = {}, updatetime = 25, persist_queries = false }, | 360 local condition = require 'galaxyline.condition' |
323 } | 361 local gls = gl.section |
324 end, | 362 |
325 }, | 363 colors.bg = '#2C323C' |
326 'nvim-treesitter/nvim-treesitter-refactor', | 364 |
327 'nvim-treesitter/nvim-treesitter-textobjects', | 365 gls.left[1] = { |
328 { 'nvim-treesitter/playground', opt = true }, | 366 RainbowRed = { |
329 } | 367 provider = function() |
330 use { 'L3MON4D3/luasnip' } | 368 return '▊ ' |
331 use { | 369 end, |
332 'rmagatti/goto-preview', | 370 highlight = { colors.blue, colors.bg }, |
333 config = function() | 371 }, |
334 require('goto-preview').setup {} | 372 } |
335 end, | 373 |
336 } | 374 gls.left[2] = { |
337 use { | 375 FileName = { |
338 'jose-elias-alvarez/null-ls.nvim', | 376 provider = function() |
339 requires = 'nvim-lua/plenary.nvim', | 377 return require('galaxyline.providers.fileinfo').get_current_file_name '⊙' |
340 } | 378 end, |
341 use { 'folke/lua-dev.nvim' } | 379 condition = condition.buffer_not_empty, |
342 | 380 highlight = { colors.magenta, colors.bg, 'bold' }, |
343 use { 'vimjas/vim-python-pep8-indent', ft = { 'python' } } | 381 }, |
344 | 382 } |
345 -- Vanity | 383 |
346 use { | 384 gls.right[1] = { |
347 'yamatsum/nvim-web-nonicons', | 385 ShowLspClient = { |
348 requires = 'kyazdani42/nvim-web-devicons', | 386 provider = 'GetLspClient', |
349 config = function() | 387 condition = function() |
350 require 'nvim-nonicons' | 388 local tbl = { ['dashboard'] = true, [''] = true } |
351 end, | 389 if tbl[vim.bo.filetype] then |
352 } | 390 return false |
353 | 391 end |
354 use { | 392 return true |
355 'NTBBloodbath/galaxyline.nvim', | 393 end, |
356 branch = 'main', | 394 highlight = { colors.green, colors.bg, 'bold' }, |
357 -- your statusline | 395 }, |
358 config = function() | 396 } |
359 local gl = require 'galaxyline' | 397 |
360 local colors = require('galaxyline.themes.colors').default | 398 gls.right[2] = { |
361 local condition = require 'galaxyline.condition' | 399 LineInfo = { |
362 local gls = gl.section | 400 provider = 'LineColumn', |
363 | 401 separator = ' ', |
364 colors.bg = '#2C323C' | 402 separator_highlight = { 'NONE', colors.bg }, |
365 | 403 highlight = { colors.fg, colors.bg }, |
366 gls.left[1] = { | 404 }, |
367 RainbowRed = { | 405 } |
368 provider = function() | 406 |
369 return '▊ ' | 407 gls.right[3] = { |
370 end, | 408 PerCent = { |
371 highlight = { colors.blue, colors.bg }, | 409 provider = 'LinePercent', |
372 }, | 410 separator = ' ', |
373 } | 411 separator_highlight = { 'NONE', colors.bg }, |
374 | 412 highlight = { colors.fg, colors.bg, 'bold' }, |
375 gls.left[2] = { | 413 }, |
376 FileName = { | 414 } |
377 provider = function() | 415 gls.right[8] = { |
378 return require('galaxyline.providers.fileinfo').get_current_file_name '⊙' | 416 RainbowBlue = { |
379 end, | 417 provider = function() |
380 condition = condition.buffer_not_empty, | 418 return ' ▊' |
381 highlight = { colors.magenta, colors.bg, 'bold' }, | 419 end, |
382 }, | 420 highlight = { colors.blue, colors.bg }, |
383 } | 421 }, |
384 | 422 } |
385 gls.right[1] = { | 423 |
386 ShowLspClient = { | 424 gls.short_line_left[1] = { |
387 provider = 'GetLspClient', | 425 BufferType = { |
388 condition = function() | 426 provider = 'FileTypeName', |
389 local tbl = { ['dashboard'] = true, [''] = true } | 427 separator = ' ', |
390 if tbl[vim.bo.filetype] then | 428 separator_highlight = { 'NONE', colors.bg }, |
391 return false | 429 highlight = { colors.blue, colors.bg, 'bold' }, |
392 end | 430 }, |
393 return true | 431 } |
394 end, | 432 |
395 highlight = { colors.green, colors.bg, 'bold' }, | 433 gls.short_line_left[2] = { |
396 }, | 434 SFileName = { |
397 } | 435 provider = 'SFileName', |
398 | 436 condition = condition.buffer_not_empty, |
399 gls.right[2] = { | 437 highlight = { colors.fg, colors.bg, 'bold' }, |
400 LineInfo = { | 438 }, |
401 provider = 'LineColumn', | 439 } |
402 separator = ' ', | 440 |
403 separator_highlight = { 'NONE', colors.bg }, | 441 gls.short_line_right[1] = { |
404 highlight = { colors.fg, colors.bg }, | 442 BufferIcon = { provider = 'BufferIcon', highlight = { colors.fg, colors.bg } }, |
405 }, | 443 } |
406 } | 444 end, |
407 | 445 } |
408 gls.right[3] = { | 446 |
409 PerCent = { | 447 -- File navigation |
410 provider = 'LinePercent', | 448 use { 'justinmk/vim-dirvish', opt = true } |
411 separator = ' ', | 449 |
412 separator_highlight = { 'NONE', colors.bg }, | 450 -- Colorscheme |
413 highlight = { colors.fg, colors.bg, 'bold' }, | 451 use { |
414 }, | 452 'zegervdv/one-lush', |
415 } | 453 requires = 'rktjmp/lush.nvim', |
416 gls.right[8] = { | 454 config = function() |
417 RainbowBlue = { | 455 require 'lush_theme.one-lush' |
418 provider = function() | 456 vim.cmd [[ colorscheme one-lush ]] |
419 return ' ▊' | 457 end, |
420 end, | 458 } |
421 highlight = { colors.blue, colors.bg }, | 459 |
422 }, | 460 -- Terminal |
423 } | 461 use { |
424 | 462 'akinsho/nvim-toggleterm.lua', |
425 gls.short_line_left[1] = { | 463 config = function() |
426 BufferType = { | 464 require('toggleterm').setup { |
427 provider = 'FileTypeName', | 465 size = 15, |
428 separator = ' ', | 466 open_mapping = [[<F12>]], |
429 separator_highlight = { 'NONE', colors.bg }, | 467 shade_filetypes = { 'none' }, |
430 highlight = { colors.blue, colors.bg, 'bold' }, | 468 shade_terminals = true, |
431 }, | 469 persist_size = true, |
432 } | 470 direction = 'horizontal', |
433 | 471 } |
434 gls.short_line_left[2] = { | 472 end, |
435 SFileName = { | 473 keys = { [[<F12>]] }, |
436 provider = 'SFileName', | 474 } |
437 condition = condition.buffer_not_empty, | 475 |
438 highlight = { colors.fg, colors.bg, 'bold' }, | 476 -- Filetypes |
439 }, | 477 use { 'lepture/vim-jinja' } |
440 } | 478 end) |
441 | |
442 gls.short_line_right[1] = { | |
443 BufferIcon = { provider = 'BufferIcon', highlight = { colors.fg, colors.bg } }, | |
444 } | |
445 end, | |
446 } | |
447 | |
448 -- File navigation | |
449 use { 'justinmk/vim-dirvish', opt = true } | |
450 | |
451 -- Colorscheme | |
452 use { | |
453 'zegervdv/one-lush', | |
454 requires = 'rktjmp/lush.nvim', | |
455 config = function() | |
456 require 'lush_theme.one-lush' | |
457 vim.cmd [[ colorscheme one-lush ]] | |
458 end, | |
459 } | |
460 | |
461 -- Terminal | |
462 use { | |
463 'akinsho/nvim-toggleterm.lua', | |
464 config = function() | |
465 require('toggleterm').setup { | |
466 size = 15, | |
467 open_mapping = [[<F12>]], | |
468 shade_filetypes = { 'none' }, | |
469 shade_terminals = true, | |
470 persist_size = true, | |
471 direction = 'horizontal', | |
472 } | |
473 end, | |
474 keys = { [[<F12>]] }, | |
475 } | |
476 | |
477 -- Filetypes | |
478 use { 'lepture/vim-jinja' } | |
479 end) | |
480 end, 0) | |
481 | 479 |
482 -- Configuration | 480 -- Configuration |
483 local opt = vim.opt | 481 local opt = vim.opt |
484 | 482 |
485 opt.backspace = { 'indent', 'eol', 'start' } -- Backspace everything | 483 opt.backspace = { 'indent', 'eol', 'start' } -- Backspace everything |