comparison .chezmoitemplates/init.lua @ 589:6bb59cb7cdd4

update nvim api for 0.7
author zegervdv <zegervdv@me.com>
date Sat, 16 Apr 2022 18:03:37 +0200
parents 05e78f59392c
children 84209805e28f
comparison
equal deleted inserted replaced
588:7f2a18dd6b8f 589:6bb59cb7cdd4
220 grepprg = 'rg --vimgrep', 220 grepprg = 'rg --vimgrep',
221 }, 221 },
222 } 222 }
223 223
224 vim.keymap.set({ 'x', 'n' }, 'gs', '<plug>(GrepperOperator)') 224 vim.keymap.set({ 'x', 'n' }, 'gs', '<plug>(GrepperOperator)')
225 vim.api.nvim_add_user_command( 225 vim.api.nvim_create_user_command(
226 'Ag', 226 'Ag',
227 'Grepper -noprompt -tool ag -grepprg rg --vimgrep <args>', 227 'Grepper -noprompt -tool ag -grepprg rg --vimgrep <args>',
228 { complete = 'file', nargs = '*' } 228 { complete = 'file', nargs = '*' }
229 ) 229 )
230 end, 230 end,
1013 end 1013 end
1014 vim.fn.setqflist(changed, 'r') 1014 vim.fn.setqflist(changed, 'r')
1015 end) 1015 end)
1016 end 1016 end
1017 1017
1018 vim.api.nvim_add_user_command('LspRename', LspRename, {}) 1018 vim.api.nvim_create_user_command('LspRename', LspRename, {})
1019 1019
1020 local fd_quickfix = function(args) 1020 local fd_quickfix = function(args)
1021 local grepprg = vim.opt.grepprg 1021 local grepprg = vim.opt.grepprg
1022 local grepformat = vim.opt.grepformat 1022 local grepformat = vim.opt.grepformat
1023 1023
1027 vim.cmd 'copen' 1027 vim.cmd 'copen'
1028 1028
1029 vim.opt.grepprg = grepprg 1029 vim.opt.grepprg = grepprg
1030 vim.opt.grepformat = grepformat 1030 vim.opt.grepformat = grepformat
1031 end 1031 end
1032 vim.api.nvim_add_user_command('Cfd', fd_quickfix, { nargs = '+', complete = 'file' }) 1032 vim.api.nvim_create_user_command('Cfd', fd_quickfix, { nargs = '+', complete = 'file' })
1033 1033
1034 vim.diagnostic.config { 1034 vim.diagnostic.config {
1035 underline = true, 1035 underline = true,
1036 update_in_insert = false, 1036 update_in_insert = false,
1037 virtual_text = { severity = { min = vim.diagnostic.severity.WARN }, source = 'always' }, 1037 virtual_text = { severity = { min = vim.diagnostic.severity.WARN }, source = 'always' },