

Configuring vim right - kirubakaran
http://items.sjbach.com/319/configuring-vim-right

======
nadim
Thanks for this one: "Store temporary files in a central spot Swap files and
backups are annoying but can save you a lot of trouble. Rather than spreading
them all around your filesystem, isolate them to a single directory"

~~~
Tritis
set backupdir=~/.vim/backup//

set directory=~/.vim/swp//

If you end your settings with double trailing // then vim will automatically
use the full path to the file

so editing

/etc/X11/x.org and ~/x.org won't clobber each other in your swap directory.

------
travisjeffery
Tim Pope, author of Rails.vim, surround.vim and a bunch of other Vim Scripts
has his config files at <http://git.tpope.net/> he has some stuff I've never
seen anywhere else.

I still like Emacs more though.

~~~
icey
I know this is way off on a tangent, but as a guy who keeps trying to pick up
emacs and ends up going back to Vim; I really wish there was a place out there
where people had their .emacs posted with comments so I could see some ways
that people are configuring their emacs.

I have copied full .emacs files previously, but it'd be cool to see some
snippets somewhere.

~~~
comatose_kid
A hacker website full of emacs users, and I'm the first to post this link?
Unbelievable.

<http://www.dotemacs.de/>

~~~
icey
I think the dirty secret around here is that a lot of us are Textmate and gVim
users (amongst other ...ahem... editors)

Anyways, that's a _great_ link; although it looks like they need to fix their
links to gnu.org. Thanks!

------
Jasber
I also find pouring over dotfiles .vimrc files uncovers many tricks I didn't
know: <http://dotfiles.org/.vimrc>

------
albertni
Nice tips. As a side note - in my opinion, finding a good color scheme can
also improve your enjoyability and even usability of vim. I was surprised at
how much easier on the eyes some color schemes were versus the default. In
addition, if you like having a default terminal look that doesn't quite
transfer well to vim (such as a terminal with a little transparency which can
be helpful on smaller screens since you can effectively "share" some space
between your terminal and whatever you might be reading off of), having a
default colorscheme will fix that too.

One very (almost overly) comprehensive place to start is at:
<http://www.cs.cmu.edu/~maverick/VimColorSchemeTest/>

Personally I like desert256

------
jamongkad
Quick question to the Vim experts here at HN but why is it when I start vim
from the terminal (Ubuntu) it does not apply the color schemes I downloaded
from Vim.org, yet when I start GVim I can see the color schemes applied?

~~~
etal
Also, check whether you're applying the color scheme in .vimrc or .gvimrc, and
check where you're turning on syntax highlighting. Remember some color schemes
just look different depending whether you're in the terminal or the full GUI.

~~~
delackner
I learned something new today, from this article, with the lovely comment "Who
needs .gvimrc?"

if has('gui_running')

------
s3graham
Nice list, here's my additions to it:
[http://blog.learnr.org/post/59098925/configuring-vim-some-
mo...](http://blog.learnr.org/post/59098925/configuring-vim-some-more)

------
there
i wish the matchit thing would work with ruby; i've been annoyed that % on
if/do/end/etc. doesn't work like it does with languages using brackets around
blocks.

~~~
sant0sk1
I haven't used this extensively but I'm having no problems with % matching on
ruby conditionals and blocks.

Maybe its because I have a .vim/syntax/ruby.vim installed. Do you?

------
rbanffy
# how to start a religious war in two easy steps

sudo rm `which vim`

sudo ln -s `which emacs` /usr/local/bin/vim

