Mercurial > dotfiles
comparison .chezmoitemplates/init.lua @ 561:6f07ecae3810
Create Ag command in config step
author | Zeger Van de Vannet <zegervdv@me.com> |
---|---|
date | Wed, 16 Feb 2022 08:56:31 +0100 |
parents | c8b76a79611a |
children | fc435126a156 |
comparison
equal
deleted
inserted
replaced
560:c8b76a79611a | 561:6f07ecae3810 |
---|---|
203 ag = { | 203 ag = { |
204 grepprg = 'rg --vimgrep', | 204 grepprg = 'rg --vimgrep', |
205 }, | 205 }, |
206 } | 206 } |
207 | 207 |
208 vim.keymap.set({"x", "n"}, "gs", '<plug>(GrepperOperator)') | 208 vim.keymap.set({ 'x', 'n' }, 'gs', '<plug>(GrepperOperator)') |
209 end, | |
210 setup = function() | |
211 vim.api.nvim_add_user_command( | 209 vim.api.nvim_add_user_command( |
212 'Ag', | 210 'Ag', |
213 'Grepper -noprompt -tool ag -grepprg rg --vimgrep <args>', | 211 'Grepper -noprompt -tool ag -grepprg rg --vimgrep <args>', |
214 { complete = 'file', nargs = '*' } | 212 { complete = 'file', nargs = '*' } |
215 ) | 213 ) |
835 -- Expand snippet or jump to next placeholder | 833 -- Expand snippet or jump to next placeholder |
836 vim.keymap.set({ 'i', 's' }, '<c-k>', function() | 834 vim.keymap.set({ 'i', 's' }, '<c-k>', function() |
837 if ls.expand_or_jumpable() then | 835 if ls.expand_or_jumpable() then |
838 ls.expand_or_jump() | 836 ls.expand_or_jump() |
839 end | 837 end |
840 end, { silent = true }) | 838 end, { |
839 silent = true, | |
840 }) | |
841 | 841 |
842 -- Go back to previous placeholder | 842 -- Go back to previous placeholder |
843 vim.keymap.set({ 'i', 's' }, '<c-j>', function() | 843 vim.keymap.set({ 'i', 's' }, '<c-j>', function() |
844 if ls.jumpable(-1) then | 844 if ls.jumpable(-1) then |
845 ls.jump(-1) | 845 ls.jump(-1) |
846 end | 846 end |
847 end, { silent = true }) | 847 end, { |
848 silent = true, | |
849 }) | |
848 | 850 |
849 -- Toggle options in snippets | 851 -- Toggle options in snippets |
850 vim.keymap.set('i', '<c-l>', function() | 852 vim.keymap.set('i', '<c-l>', function() |
851 if ls.choice_active() then | 853 if ls.choice_active() then |
852 ls.change_choice() | 854 ls.change_choice() |