Mercurial > dotfiles
comparison .chezmoitemplates/init.lua @ 747:c0395223c18f
feat: add mapping to search for files
author | zegervdv <zegervdv@me.com> |
---|---|
date | Thu, 12 Jan 2023 10:11:01 +0100 |
parents | cc66c8f2d548 |
children | 300f45100370 |
comparison
equal
deleted
inserted
replaced
746:cc66c8f2d548 | 747:c0395223c18f |
---|---|
559 local line = vim.api.nvim_buf_get_lines(0, start_line, end_line, true) | 559 local line = vim.api.nvim_buf_get_lines(0, start_line, end_line, true) |
560 return line[1]:sub(start_col, end_col) | 560 return line[1]:sub(start_col, end_col) |
561 end | 561 end |
562 | 562 |
563 vim.keymap.set({ 'n' }, '<leader>fg', function() grep_opts() end, { desc = 'Live grep prompting for options' }) | 563 vim.keymap.set({ 'n' }, '<leader>fg', function() grep_opts() end, { desc = 'Live grep prompting for options' }) |
564 vim.keymap.set({ 'n' }, '<leader>ff', function() fzf.files() end, { desc = 'Search for files' }) | |
564 | 565 |
565 function _G.__live_grep(motion) | 566 function _G.__live_grep(motion) |
566 local word = get_selected_word() | 567 local word = get_selected_word() |
567 fzf.live_grep { search = word } | 568 fzf.live_grep { search = word } |
568 end | 569 end |