Posted by ebal at 11:27:54 in planet_ellak, planet_Sysadmin
I am using vi for almost everything, and i always comment before my changes. I prefer to comment like this:
# ebal, Wed Oct 13 14:20:46 EEST 2010
so i usually type:
: r! date
I was loosing too much time with that, so i’ve searched in google for a custom shortcut in vim to do exactly the above by hitting a special key.
After a while i found the solution!
In the end of /etc/vimrc i put the below map vi command:
:map <f1> :r! export -p LC_ALL=C; echo "# `whoami`, `date`"<return>
Thursday, October 14, 2010 - 11:01:12
I would advice to use ~/.vimrc and not the global /etc/vimrc. :-)
Saturday, October 16, 2010 - 02:45:59
Vim != Vi