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 ...
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 ...
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
echom 'Deleting ' a:flist
" setup netrw mappings (:h g:Netrw_UserMaps)
let g:Netrw_UserMaps = [['D', 'g:...
Well, it's not supposed to be user-modifiable. But we can "hack" it:
" helper function to find Script Number (aka SNR)
" slash <-> bslash translation
let l:sfile = exists('+shellslash') && !&shellslash ?
\ tr(a:sfile, '/', '\') : tr(a:sfile, '\', '/')
" get 'number:', 'scriptfile' pairs