Add vim asterisk surround operator

This commit is contained in:
Talia 2020-05-11 11:17:30 +02:00
parent b943911c14
commit d5d5604ff7

11
vimrc
View file

@ -652,6 +652,13 @@ function! s:backtick_op(type)
endf
nnoremap <leader>` :<C-U>set operatorfunc=<SID>backtick_op<CR>g@
vnoremap <leader>` :<C-U>call <SID>vsurround("`", "`")<CR>
function! s:asterisk_op(type)
normal `[m<`]m>
call <SID>surround(a:type, "*", "*")
endf
nnoremap <leader>* :<C-U>set operatorfunc=<SID>asterisk_op<CR>g@
vnoremap <leader>* :<C-U>call <SID>vsurround("*", "*")<CR>
" --- END OF SURROUND MAPPINGS ---
nnoremap <S-l> :L<cr>
@ -715,10 +722,6 @@ nnoremap [p :let [content, type]=
nnoremap <leader><CR> o0
nnoremap <leader><leader><CR> O0
" Markdown Stuff
vnoremap * <C-c>`>a*<C-c>`<i*<C-c>
vnoremap _ <C-c>`>a__<C-c>`<i__<C-c>
" === GENERAL ABBREVIATIONS ===
cabbr rcpath fnamemodify($MYVIMRC, ":p:h")