News for hackers. Stuff that matters.
Re:Configuring vim right by nadim on Monday November 10, 2008 @05:43PM (#359865)
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"
Re:Configuring vim right by Tritis on Tuesday November 11, 2008 @01:23PM (#360748)
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.

Re:Configuring vim right by travisjeffery on Monday November 10, 2008 @10:11PM (#360170)
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.

Re:Configuring vim right by icey on Monday November 10, 2008 @11:42PM (#360230)
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.

Re:Configuring vim right by s3graham on Tuesday November 11, 2008 @02:19AM (#360326)
Yeah, I'm with you on this one. I felt like it was a prerequisite for useful CL/Clojure work, though it probably isn't really.

It'd be especially nice to see someone's who'd used Vim for 5+ years and then switched so there's setups for maybe Viper, etc.

Re:Configuring vim right by comatose_kid on Tuesday November 11, 2008 @02:27PM (#360839)
A hacker website full of emacs users, and I'm the first to post this link? Unbelievable.

http://www.dotemacs.de/

Re:Configuring vim right by icey on Tuesday November 11, 2008 @03:01PM (#360886)
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!

Re:Configuring vim right by naa42 on Wednesday November 12, 2008 @06:26AM (#361703)
http://emacswiki.org is a great source of emacs snippets, and it has really active community.
Re:Configuring vim right by albertcardona on Tuesday November 11, 2008 @11:57AM (#360633)
My .vimrc is here:

http://albert.rierol.net/vim_tricks.html

... along with some tips.

[oops misread your comment. My .emacs is here: http://albert.rierol.net/emacs ]

Re:Configuring vim right by maximilian on Tuesday November 11, 2008 @12:28AM (#360262)
I'm giving emacs a valuation right now. I mostly code very short numerics things up that don't really take much keyboard-fu, but i've always thought a lot about the editor I use. I used to use Vim, but I figured I'd give emacs a try and see if I like it. I get pretty annoyed with the weirdness of the different keyboard shortcut combos, but I'm getting used to them slowly but surely. I kinda miss Vim though..i've been thinking of jumping ship back to Vim and spend some more time making it really customized for myself.
Re:Configuring vim right by senthil_rajasek on Tuesday November 11, 2008 @02:02AM (#360314)
Emacs makes my left pinky hurt.
Re:Configuring vim right by kirubakaran on Tuesday November 11, 2008 @10:31AM (#360566)
Are you using emacs at present or have you given up on it already? Did you swap 'Caps Lock' and 'Ctrl'?
Re:Configuring vim right by senthil_rajasek on Tuesday November 11, 2008 @01:53PM (#360794)
oh ... I use vi and I haven't exactly given up on emacs
Re:Configuring vim right by kirubakaran on Tuesday November 11, 2008 @02:05PM (#360816)
Try swapping caps and ctrl.
Re:Configuring vim right by senthil_rajasek on Tuesday November 11, 2008 @02:28PM (#360840)
Thanks for the great tip, will sure try.
Re:Configuring vim right by kirubakaran on Tuesday November 11, 2008 @02:34PM (#360851)
I did all this: http://steve.yegge.googlepages.com/effective-emacs and I am very happy.
Re:Configuring vim right by Jasber on Monday November 10, 2008 @08:19PM (#360054)
I also find pouring over dotfiles .vimrc files uncovers many tricks I didn't know: http://dotfiles.org/.vimrc
Re:Configuring vim right by albertni on Tuesday November 11, 2008 @05:51AM (#360434)
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

Re:Configuring vim right by jamongkad on Monday November 10, 2008 @09:08PM (#360114)
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?
Re:Configuring vim right by basil on Monday November 10, 2008 @09:29PM (#360130)
In your terminal Vim session, type :echo g:colors_name to find out if you have a colour scheme set.

Also what version of Vim are you using? If you are using Vim-Tiny for example, it is not compiled with syntax highlighting support. Type :version to see the list of compiled features and look for '+syntax'.

Otherwise it could be your terminal emulator playing up.

Try :set t_Co to see how many colours Vim can recognise in your terminal. Ideally this should return at least '8'. If it doesn't there may be some tips in :h xterm-color.

Re:Configuring vim right by etal on Tuesday November 11, 2008 @12:43AM (#360274)
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.
Re:Configuring vim right by delackner on Tuesday November 11, 2008 @02:16AM (#360323)
I learned something new today, from this article, with the lovely comment "Who needs .gvimrc?"

if has('gui_running')

Re:Configuring vim right by graywh on Tuesday November 11, 2008 @03:21PM (#360909)
Sounds like you may be using a colorscheme that only defines gui colors. We get plenty of "problems" like that in #vim.
Re:Configuring vim right by s3graham on Tuesday November 11, 2008 @02:20AM (#360327)
Re:Configuring vim right by there on Monday November 10, 2008 @08:59PM (#360099)
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.
Re:Configuring vim right by sant0sk1 on Monday November 10, 2008 @10:06PM (#360160)
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?

Re:Configuring vim right by rbanffy on Tuesday November 11, 2008 @10:57AM (#360583)
# how to start a religious war in two easy steps

sudo rm `which vim`

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