style: removed a complex keymap to search visual selection. not ideal for new users

This commit is contained in:
Folke Lemaitre 2022-12-31 18:16:24 +01:00
parent 478f75cb76
commit 9b120aec36
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -52,19 +52,7 @@ vim.keymap.set("n", "<C-s>", "<cmd>:w<cr><esc>")
vim.keymap.set("v", "<", "<gv")
vim.keymap.set("v", ">", ">gv")
-- makes * and # work on visual mode too.
vim.cmd([[
function! g:VSetSearch(cmdtype)
let temp = @s
norm! gv"sy
let @/ = '\V' . substitute(escape(@s, a:cmdtype.'\'), '\n', '\\n', 'g')
let @s = temp
endfunction
xnoremap * :<C-u>call g:VSetSearch('/')<CR>/<C-R>=@/<CR><CR>
xnoremap # :<C-u>call g:VSetSearch('?')<CR>?<C-R>=@/<CR><CR>
]])
-- lazygit
vim.keymap.set("n", "<leader>gg", function()
require("lazy.util").open_cmd({ "lazygit" }, {
terminal = true,