By biggest vim annoyance: having to do “:set paste” just to be able to paste stuff in without screwing up my indents.
So then I found this: https://github.com/ConradIrwin/vim-bracketed-paste
I have these three lines in my ~/.vimrc, which bind the normal Ctrl-C, Ctrl-X, and Ctrl-V to work with the clipboard as they do in other applications.
~/.vimrc
vmap <C-c> y:call system("xclip -i -selection clipboard", getreg("\""))<CR>:call system("xclip -i", getreg("\""))<CR> vmap <C-x> d:call system("xclip -i -selection clipboard", getreg("\""))<CR>:call system("xclip -i", getreg("\""))<CR> nmap <C-v> :call setreg("\"",system("xclip -o -selection clipboard"))<CR>p
Ctrl-V pastes text directly, bypassing any auto-formatting.
Note that this relies on xclip being installed.
xclip
I’m a big fan of Practical Vim from Prag Prog, has a lot of tips like these and more: https://pragprog.com/book/dnvim/practical-vim
My vim annoyance is that it’s not emacs. (Trollface)
my vim annoyance is that its non nvi
I think the best tip in there is set backupdir=~/.vim/backup
set backupdir=~/.vim/backup
My gripe is that directory can use // to mangle the full path for the swapfile name and store it somewhere else, but for backupdir this is not implemented (and I edit a lot of files with the same basename…).
directory
//
backupdir
That is a good point, I am actually going to put in a bug against neovim, maybe they can fix that – it should cause any harm and has an large upside.
*should not – and it was already there but seems to have fallen into a weird state: https://github.com/neovim/neovim/issues/2501 – I might poke at it.
By biggest vim annoyance: having to do “:set paste” just to be able to paste stuff in without screwing up my indents.
So then I found this: https://github.com/ConradIrwin/vim-bracketed-paste
I have these three lines in my
~/.vimrc
, which bind the normal Ctrl-C, Ctrl-X, and Ctrl-V to work with the clipboard as they do in other applications.Ctrl-V pastes text directly, bypassing any auto-formatting.
Note that this relies on
xclip
being installed.I’m a big fan of Practical Vim from Prag Prog, has a lot of tips like these and more: https://pragprog.com/book/dnvim/practical-vim
My vim annoyance is that it’s not emacs. (Trollface)
my vim annoyance is that its non nvi
I think the best tip in there is
set backupdir=~/.vim/backup
My gripe is that
directory
can use//
to mangle the full path for the swapfile name and store it somewhere else, but forbackupdir
this is not implemented (and I edit a lot of files with the same basename…).That is a good point, I am actually going to put in a bug against neovim, maybe they can fix that – it should cause any harm and has an large upside.
*should not – and it was already there but seems to have fallen into a weird state: https://github.com/neovim/neovim/issues/2501 – I might poke at it.