New answers tagged

0

I was struggling with the system clipboard and vim inside tmux. It was solved by using xsel or xclip, like in this example: 1.) visually select a block text in normal mode: V<motionkey> 2.a) with xsel run ex: :'<,'>w !xsel -b 2.b) with xclip run ex: :'<,'>w !xclip -selection clipboard 3.) paste into another program ... and now nmap ...


5

If you don't mind using the plugin vim-surround it can be as short as ysa"": Put your cursor on the word you want to surround ys is the vim surround command a" is the text object to operate on, it could also be aW " is the character you want to use to surround the text object And as a bonus you can to the reverse operation i.e removing the surrounding ...


5

I would do: /" to search for the character yl to copy the character p to paste the character then alternate between n and . to search and replace


0

What about just remap ctrl-v in insert mode to paste from system clipboard? inoremap <c-v> <esc>"+p Does this work for you?


2

Let us be not too insane :-) and provide a different solution using mappings and netrw public API. Beware that the code is neither complete nor was tested properly! " our custom delete routine function! g:MyNetrw_DoDelete(flist) echom 'Deleting ' a:flist endfunction " setup netrw mappings (:h g:Netrw_UserMaps) let g:Netrw_UserMaps = [['D', 'g:...


1

Well, it's not supposed to be user-modifiable. But we can "hack" it: " helper function to find Script Number (aka SNR) function! GetSNR(sfile) " slash <-> bslash translation let l:sfile = exists('+shellslash') && !&shellslash ? \ tr(a:sfile, '/', '\') : tr(a:sfile, '\', '/') " get 'number:', 'scriptfile' pairs let l:...


Top 50 recent answers are included