14 ms·
Configuring vim right
- nadim 18y agoThanks 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 18y agoset 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.
- Jasber 18y agoI also find pouring over dotfiles .vimrc files uncovers many tricks I didn't know: http://dotfiles.org/.vimrc http://dotfiles.org/.vimrc
- there 18y agoi 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 18y agoI 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?
- jamongkad 18y agoQuick 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?
- basil 18y agoIn 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.
- etal 18y agoAlso, 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 18y agoI learned something new today, from this article, with the lovely comment "Who needs .gvimrc?" if has('gui_running')
- graywh 18y agoSounds like you may be using a colorscheme that only defines gui colors. We get plenty of "problems" like that in #vim.
- travisjeffery 18y agoTim Pope, author of Rails.vim, surround.vim and a bunch of other Vim Scripts has his config files at http://git.tpope.net/ http://git.tpope.net/ he has some stuff I've never seen anywhere else. I still like Emacs more though.
- icey 18y agoI 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.
- s3graham 18y agoYeah, 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.
- albertcardona 18y agoMy .vimrc is here: http://albert.rierol.net/vim_tricks.html http://albert.rierol.net/vim_tricks.html ... along with some tips. [oops misread your comment. My .emacs is here: http://albert.rierol.net/emacs http://albert.rierol.net/emacs ]
- comatose_kid 18y agoA hacker website full of emacs users, and I'm the first to post this link? Unbelievable. http://www.dotemacs.de/ http://www.dotemacs.de/
- icey 18y agoI 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!
- s3graham 18y agoNice list, here's my additions to it: http://blog.learnr.org/post/59098925/configuring-vim-some-more http://blog.learnr.org/post/59098925/configuring-vim-some-mo...
- albertni 18y agoNice 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/ http://www.cs.cmu.edu/~maverick/VimColorSchemeTest/ Personally I like desert256
- rbanffy 18y ago# how to start a religious war in two easy steps sudo rm `which vim` sudo ln -s `which emacs` /usr/local/bin/vim