5 ms·
One of the things I love about Vim is that every time I read though a post like this or look at someone's .vimrc I learn something new about what it can do or g
by samdk 16y ago
One of the things I love about Vim is that every time I read though a post like this or look at someone's .vimrc I learn something new about what it can do or get another insight about how its features can make my life easier.
My (semi-commented) .vimrc is on GitHub if anyone wants another example: http://github.com/samdk/vimconf/blob/master/dotvimrc http://github.com/samdk/vimconf/blob/master/dotvimrc
I've also found StackOverflow's list of most-voted questions tagged vim to be a very useful source of little tidbits: http://stackoverflow.com/questions/tagged/vim?sort=votes&pagesize=15 http://stackoverflow.com/questions/tagged/vim?sort=votes&...
And there've been several HN .vimrc posts that I also found very useful. This is one of the best: http://news.ycombinator.com/item?id=856051 http://news.ycombinator.com/item?id=856051
This is another excellently commented and extensive .vimrc that (I think) is mentioned in one of the above links, but deserves its own specific mention here: http://www.vi-improved.org/vimrc.php http://www.vi-improved.org/vimrc.php
And this is another I found completely by accident a while ago that includes some excellent examples of vimscript macros: http://fingelrest.silent-blade.org/uploads/Main/vimrc.html http://fingelrest.silent-blade.org/uploads/Main/vimrc.html
- stevelosh 16y agoExactly. Case in point: I just found out about ending the backupdir with two slashes to include the full path in the filename by reading your .vimrc. Thanks!
- sigzero 16y agosyntax on filetype on filetype plugin on filetype indent on You do not want "filetype off" Also, check out snipMate as it gives you easy to use TextMate type snippets. In Vim: :h filetype
- telemachos 16y agoYou do not want "filetype off" A minor quibble: you might want "filetype off" temporarily, if you use Pathogen (which the poster does). Pathogen needs to run before the filetype plugin is turned on, and due to the way some distros work (Debian and its children, primarily, I think), this requires you to start your .vimrc this way[1]: filetype off call pathogen#runtime_append_all_bundles() call pathogen#helptags() " Later... filetype plugin indent on Since I work both with Debian and OSX, I just use that as a shared .vimrc set-up. As a general rule, though, you are right that you want it turned on normally. [1] http://www.vim.org/scripts/script.php?script_id=2332 http://www.vim.org/scripts/script.php?script_id=2332
- graywh 16y agoThis has been changed in Debian (the system vimrc no longer turns syntax or filetype on), but persists in Ubuntu.
- telemachos 16y agoI wasn't aware of the change. Thanks for letting me know.
- stevelosh 16y agoReplying to myself because I can't seem to reply to sigzero: Yeah, I definitely need to get around to reading :h filetype. I mentioned Snipmate in the article, so I know about it :)
- icey 16y agoHN has a speed-limiter in place to prevent flamefests. If you find yourself in the position of not being able to reply due to the previous comment being made too recently, you can click the "link" link and reply on the resulting page.
- stevelosh 16y agoAh, neat, I didn't know that. Thanks!
- samdk 16y agoThis is not vim-related, but the reason you couldn't reply is that HN doesn't let you reply to a comment until after a certain amount of time has passed. This amount of time depends on how deep the comment is in the tree. (I believe the restriction is there to help prevent excessively deep comment trees that are just people arguing back and forth.)
- mrud 16y agoAnother good vimrc is the vimrc from grml http://git.grml.org/?p=grml-etc-core.git;a=blob_plain;f=etc/vim/vimrc http://git.grml.org/?p=grml-etc-core.git;a=blob_plain;f=etc/... It is a good start to a simple but yet powerful vim configuration, especially integration with screen, pastetoggle, etc.
- Seth_Kriticos 16y agoNice, I got a feeling what your main line of programming is from the source. That's somehow fun. Anyway, might as well join in too, here is my vimrc: http://gist.github.com/144742#file_gistfile1.vim http://gist.github.com/144742#file_gistfile1.vim
- lelele 16y agoThat's exactly what I hate about both Emacs and Vim: yes, they are customizable, however many useful customization are scattered around user scripts. EDIT: A flag here and there does not make a structured environment. That's why many people are running to other editors: they find that what they are more likely to need is already there in a designed way, not in a thrown-together one.