More stupid Ubuntu tricks

I use emacs for the majority of my editing, however I use vim to edit config files. Most distributions will have a global vimrc that sets up vim to remember the last place it was in a file, and put you back there when you reopen that file. I find this to be a preferred behavior since I tend to make incremental changes to a config file and want to open it to the same section over and over again. Ubuntu for some reason has this section commented out in /etc/vim/vimrc:

if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") < = line("$")
\| exe "normal g'\"" | endif
endif

So I just snip that out of there and put it in my ~/vimrc. Happy configuring!

About Nathan Powell

I am a middle aged technologist freak-ball.
This entry was posted in computers. Bookmark the permalink.

One Response to More stupid Ubuntu tricks

  1. Bob Igo says:

    I used emacs to create my ~/.vimrc, just for kicks. Watch for line wrap in the above code block!