Affichage des articles dont le libellé est vi. Afficher tous les articles
Affichage des articles dont le libellé est vi. Afficher tous les articles

vendredi 1 août 2014

Vim persistent undo

Starting from Vim 7.3, it's possible to keep your "undo history". Even after closing and reopening the file, you can still use u and ctrl+r in order to go back to changes you made before closing the file.
In order to enable this feature, all you need to do is to set the properties undofile and undodir in your .vimrc file
set undofile
set undodir=$HOME/.undodir

Don't forget to create the directory undodir, or else this won't work
You can find more information about this feature here: Vim documentation: undo


mercredi 4 avril 2012

Everyone should learn Vi / VIm

I always wanted to learn vi. It seems that once you get to know it well, you can be a lot more productive.
The problem is you got to invest some time to learn all the shortcuts that will help you to be productive and practice them often to get used to them. A good start is the vimtutor which is an interactive learning resource that can be started by typing vimtutor in the shell. Once you finish the tutorial, you can find a ton of resources on the internet. Personally, I'm starting with vim tips http://vim.wikia.com/wiki/Vim_Tips_Wiki. There is a lot of good tips, like autocompletion feature which can be done using Ctrl+N for next word and Ctrl+p for previous word.
If I can be as good in vi as this guy http://stackoverflow.com/a/1220118/612920 , I'm sure I'll be at least 10 times faster. If you decide as well to start learning vim, I'm sure you are making a good decision.