How to configure leap.nvim to work with (n)vim-surround? #38
Answered
by
ggandor
nullchilly
asked this question in
Q&A
-
Originally asked in lightspeed: ggandor/lightspeed.nvim#83 Linked here for convenience. Could I ask for your config snippet if you also use surround? To be honest I am lazy to read all the opinions 🙃 |
Beta Was this translation helpful? Give feedback.
Answered by
ggandor
Aug 7, 2022
Replies: 2 comments 1 reply
-
I'm totally open for better ideas! let g:surround_no_mappings = 1
" Just the defaults copied here.
nmap ds <Plug>Dsurround
nmap cs <Plug>Csurround
nmap cS <Plug>CSurround
nmap ys <Plug>Ysurround
nmap yS <Plug>YSurround
nmap yss <Plug>Yssurround
nmap ySs <Plug>YSsurround
nmap ySS <Plug>YSsurround
" The conflicting ones. Note that `<Plug>(leap-cross-window)`
" _does_ work in Visual mode, if jumping to the same buffer,
" so in theory, `gs` could be useful for Leap too...
xmap gs <Plug>VSurround
xmap gS <Plug>VgSurround |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
nullchilly
-
equivalent lua config vim.g["surround_no_mappings"] = 1
-- Just the defaults copied here.
vim.keymap.set("n", "ds", "<Plug>Dsurround")
vim.keymap.set("n", "cs", "<Plug>Csurround")
vim.keymap.set("n", "cS", "<Plug>CSurround")
vim.keymap.set("n", "ys", "<Plug>Ysurround")
vim.keymap.set("n", "yS", "<Plug>YSurround")
vim.keymap.set("n", "yss", "<Plug>Yssurround")
vim.keymap.set("n", "ySs", "<Plug>YSsurround")
vim.keymap.set("n", "ySS", "<Plug>YSsurround")
-- The conflicting ones. Note that `<Plug>(leap-cross-window)`
-- _does_ work in Visual mode, if jumping to the same buffer,
-- so in theory, `gs` could be useful for Leap too...
vim.keymap.set("x", "gs", "<Plug>VSurround")
vim.keymap.set("x", "gS", "<Plug>VgSurround") |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm totally open for better ideas!