Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用以下插件来简化 Markdown 中的 URL 标记:tpope/vim-surround
这有效:
nmap <leader>l <Plug>Ysurroundiw]%a(<C-R>*)<Esc>
这不会(注意大写的“S”):
vmap <leader>l <Plug>YSurround]%a(<C-R>*)<Esc>
知道为什么吗?
尝试使用VSurround而不是,YSurround因为您使用的是vmap.
VSurround
YSurround
vmap
Surround很棒,但是更便携、与插件无关的解决方案呢?
xnoremap <leader>l <Esc>`>a](<C-r>*)<C-o>`<[<Esc>