comparison .chezmoitemplates/init.lua @ 762:67df970646c1

fix: clean up after lazy migration
author zegervdv <zegervdv@me.com>
date Sun, 12 Mar 2023 21:54:33 +0100
parents ec5b57266af2
children 04b8d569ff9d
comparison
equal deleted inserted replaced
761:ec5b57266af2 762:67df970646c1
64 -- Smooth scrolling 64 -- Smooth scrolling
65 { 65 {
66 'karb94/neoscroll.nvim', 66 'karb94/neoscroll.nvim',
67 config = function() require('neoscroll').setup {} end, 67 config = function() require('neoscroll').setup {} end,
68 }, 68 },
69
70 -- Faster lua package loading (until 15436 is merged)
71 -- {
72 -- 'lewis6991/impatient.nvim',
73 -- module = { 'impatient' },
74 -- setup = function() require 'impatient' end,
75 -- },
76 69
77 -- Library with lua functions 70 -- Library with lua functions
78 { 'nvim-lua/plenary.nvim' }, 71 { 'nvim-lua/plenary.nvim' },
79 72
80 -- Spelling/autocorrection 73 -- Spelling/autocorrection
195 188
196 -- session management 189 -- session management
197 { 190 {
198 'folke/persistence.nvim', 191 'folke/persistence.nvim',
199 event = 'BufReadPre', 192 event = 'BufReadPre',
200 module = 'persistence',
201 config = function() require('persistence').setup() end, 193 config = function() require('persistence').setup() end,
202 }, 194 },
203 195
204 -- Indent lines 196 -- Indent lines
205 { 197 {
317 }), 309 }),
318 }) 310 })
319 end, 311 end,
320 }, 312 },
321 { 313 {
322 { 314 'nvim-treesitter/nvim-treesitter',
323 'nvim-treesitter/nvim-treesitter', 315 config = function()
324 config = function() 316 require 'nvim-treesitter.highlight'
325 require 'nvim-treesitter.highlight' 317
326 318 require('nvim-treesitter.configs').setup {
327 require('nvim-treesitter.configs').setup { 319 ensure_installed = {
328 ensure_installed = { 320 'python',
329 'python', 321 'lua',
330 'lua', 322 'verilog',
331 'verilog', 323 'json',
332 'json', 324 'yaml',
333 'yaml', 325 'bash',
334 'bash', 326 'dockerfile',
335 'dockerfile', 327 'c',
336 'c', 328 'cpp',
337 'cpp', 329 'regex',
338 'regex', 330 'markdown',
339 'markdown', 331 'rst',
340 'rst', 332 'beancount',
341 'beancount', 333 },
334 indent = {
335 enable = false,
336 },
337 highlight = {
338 enable = true,
339 disable = { 'systemverilog', 'verilog' },
340 },
341 incremental_selection = {
342 enable = true,
343 keymaps = {
344 init_selection = 'gnn',
345 node_incremental = 'grn',
346 scope_incremental = 'grc',
347 node_decremental = 'grm',
342 }, 348 },
343 indent = { 349 },
344 enable = false, 350 refactor = {
351 highlight_definitions = { enable = true },
352 smart_rename = { enable = true, keymaps = { smart_rename = 'gsr' } },
353 navigation = {
354 enable = true,
355 keymaps = { goto_definition = 'gnd', list_definitions = 'gnD' },
345 }, 356 },
346 highlight = { 357 },
358 textobjects = {
359 move = {
347 enable = true, 360 enable = true,
348 disable = { 'systemverilog', 'verilog' }, 361 goto_next_start = { [']]'] = '@block.outer' },
362 goto_previous_start = { ['[['] = '@block.outer' },
363 goto_next_end = { [']['] = '@block.outer' },
364 goto_previous_end = { ['[]'] = '@block.outer' },
349 }, 365 },
350 incremental_selection = { 366 select = {
351 enable = true, 367 enable = true,
368 lookahead = true,
352 keymaps = { 369 keymaps = {
353 init_selection = 'gnn', 370 ['af'] = '@function.outer',
354 node_incremental = 'grn', 371 ['if'] = '@function.inner',
355 scope_incremental = 'grc', 372 ['ab'] = '@block.outer',
356 node_decremental = 'grm', 373 ['ib'] = '@block.inner',
357 }, 374 },
358 }, 375 },
359 refactor = { 376 },
360 highlight_definitions = { enable = true }, 377 playground = { enable = true, disable = {}, updatetime = 25, persist_queries = false },
361 smart_rename = { enable = true, keymaps = { smart_rename = 'gsr' } }, 378 }
362 navigation = { 379 end,
363 enable = true, 380 },
364 keymaps = { goto_definition = 'gnd', list_definitions = 'gnD' }, 381 'nvim-treesitter/nvim-treesitter-refactor',
365 }, 382 'nvim-treesitter/nvim-treesitter-textobjects',
366 }, 383 { 'nvim-treesitter/playground', command = 'TSPlaygroundToggle' },
367 textobjects = {
368 move = {
369 enable = true,
370 goto_next_start = { [']]'] = '@block.outer' },
371 goto_previous_start = { ['[['] = '@block.outer' },
372 goto_next_end = { [']['] = '@block.outer' },
373 goto_previous_end = { ['[]'] = '@block.outer' },
374 },
375 select = {
376 enable = true,
377 lookahead = true,
378 keymaps = {
379 ['af'] = '@function.outer',
380 ['if'] = '@function.inner',
381 ['ab'] = '@block.outer',
382 ['ib'] = '@block.inner',
383 },
384 },
385 },
386 playground = { enable = true, disable = {}, updatetime = 25, persist_queries = false },
387 }
388 end,
389 },
390 'nvim-treesitter/nvim-treesitter-refactor',
391 'nvim-treesitter/nvim-treesitter-textobjects',
392 { 'nvim-treesitter/playground' },
393 },
394 { 'L3MON4D3/luasnip' }, 384 { 'L3MON4D3/luasnip' },
395 { 385 {
396 'rmagatti/goto-preview', 386 'rmagatti/goto-preview',
397 config = function() require('goto-preview').setup {} end, 387 config = function() require('goto-preview').setup {} end,
398 }, 388 },
900 890
901 function _G.qftf(info) 891 function _G.qftf(info)
902 local items 892 local items
903 local ret = {} 893 local ret = {}
904 if info.quickfix == 1 then 894 if info.quickfix == 1 then
905 items = fn.getqflist({ id = info.id, items = 0 }).items 895 items = vim.fn.getqflist({ id = info.id, items = 0 }).items
906 else 896 else
907 items = fn.getloclist(info.winid, { id = info.id, items = 0 }).items 897 items = vim.fn.getloclist(info.winid, { id = info.id, items = 0 }).items
908 end 898 end
909 local limit = 31 899 local limit = 31
910 local fnameFmt1, fnameFmt2 = '%-' .. limit .. 's', '…%.' .. (limit - 1) .. 's' 900 local fnameFmt1, fnameFmt2 = '%-' .. limit .. 's', '…%.' .. (limit - 1) .. 's'
911 local validFmt = '%s │%5d:%-3d│%s %s' 901 local validFmt = '%s │%5d:%-3d│%s %s'
912 for i = info.start_idx, info.end_idx do 902 for i = info.start_idx, info.end_idx do
913 local e = items[i] 903 local e = items[i]
914 local fname = '' 904 local fname = ''
915 local str 905 local str
916 if e.valid == 1 then 906 if e.valid == 1 then
917 if e.bufnr > 0 then 907 if e.bufnr > 0 then
918 fname = fn.bufname(e.bufnr) 908 fname = vim.fn.bufname(e.bufnr)
919 if fname == '' then 909 if fname == '' then
920 fname = '[No Name]' 910 fname = '[No Name]'
921 else 911 else
922 fname = fname:gsub('^' .. vim.env.HOME, '~') 912 fname = fname:gsub('^' .. vim.env.HOME, '~')
923 end 913 end