Live data from Hacker News

Coming Home to Vim

stevelosh.com

91–100 of 125 posts

Re: Coming Home to Vim

#91

A bit off the topic but a couple of doubts regarding pathogen. I installed pathogen and am a bit confused regarding the organisation of the plugins within pathogen. Say I have plugin called foo.vim, inside the bundles folder do I directly drop it or do I create a folder called foo and then drop foo.vim within it? Also say a plugin has syntax files and an ftplugin folder then do I just drop the plugin in pathogen and…

"Say I have plugin called foo.vim, inside the bundles folder do I directly drop it or do I create a folder called foo and then drop foo.vim within it?

You need to create the folder foo with a folder called plugin and then foo.vim inside it -> foo/plugin/foo.vim

" Also say a plugin has syntax files and an ftplugin folder then do I just drop the plugin in pathogen and it is supposed to work?

Yep. Normally vim plugins are shipped in zip files that contain the structure and are meant to be installed on top of your .vim directory. All you do is instead install them into .bundles/pluginName instead. Also, since a lot of vim plugins are kept in source control anyways, a lot on github, you can simply use git submodules to version your plugins as well making updating them a cinch.

Re: Coming Home to Vim

#92

Earlier quoted context omitted.

"With Vim, I press j until I'm on the line where the word is, then I press w until I'm at the beginning of the word, then I press cw to change the word, retype it the right way, and press escape to go back to command mode." OK, this is something Vim people need to work on. Using j/k to move more than one or two lines is the wrong way to do things. I know, I know, we extoll the virtues of hjkl constantly, but really t…

:set paste Should help with indentation issues.

set pastetoggle=

That is what I use.

Re: Coming Home to Vim

#93
post #71

What annoys me about a lot of tech blog posts like this one is that they're essentially voodoo. People like the author write instructions about what you should do without even understanding the instructions themselves. "I’m not entirely sure what the filetype lines do. I’ve read that they’re necessary and so far I haven’t had problems." His example .vimrc has filetype listed twice, which is redundant. This in itself…

I'm not a vim guru by any stretch of the imagination, but I still don't take what he says at face value. I don't trust ANYTHING I see on the internet just because it's there!

Your criticism seems to be due to the belief that, in a world where the only information on the internet could be treated as gospel, that would allow the experts opinion to come through easily. Unfortunately, that sets up the circumstance where the experts get granted much more exposure and trust than they necessarily deserve, and it inevitably gets subverted and abused.

I personally prefer the current system - treat all information as suspect until you can verify it. It leaves MUCH less room for exploitation than all of our other "trust by default" mediums.

-- Ayjay on Fedang

Re: Coming Home to Vim

#94
post #71

What annoys me about a lot of tech blog posts like this one is that they're essentially voodoo. People like the author write instructions about what you should do without even understanding the instructions themselves. "I’m not entirely sure what the filetype lines do. I’ve read that they’re necessary and so far I haven’t had problems." His example .vimrc has filetype listed twice, which is redundant. This in itself…

I'm not a vim guru by any stretch of the imagination, but I still don't take what he says at face value. I don't trust ANYTHING I see on the internet just because it's there! Your criticism seems to be due to the belief that, in a world where the only information on the internet could be treated as gospel, that would allow the experts opinion to come through easily. Unfortunately, that sets up the circumstance where…

Oh, I agree that not trusting information on the internet is the sensible default. However, there are plenty of people who will be copying his examples directly without any investigation.

Some will probably post the exact same stuff on their own blogs or link to this post. Before you know it this example will drown out any serious search results for "vim filetype", effectively stopping new people from learning how to do things properly.

Now obviously this post is a bit hyperbole in this instance. But these things do happen because people can't be arsed to treat the things they write/publish with the care it deserves.

Re: Coming Home to Vim

#95
post #79

I dont see the appeal of nerdtree and the like. For me they are clumsy and too much information. I'm very adept at unix cmd line, find, ack, locate, CDPATH, cmd history, and friends. I spend 10-20% of my editing time at the bash prompt. So much so i aliased :e to vim Having never got the "gui" file managemnet tools i cant say for certain but i wonder if power and productivity gains one sees from truly learning vim ca…

Could you please share how exactly you do the "jump to file foo.bar" functionality? That is the only part of vim I still find a bit laborious, probably because I haven't found a good workflow for it.

:b has smart tab completion. You can type any part of the filename and you can tab through the results. This is generally what I find myself doing when I have a lot of buffers open. Otherwise I just use minibufexpl with buffer next/prev keybinds.

Re: Coming Home to Vim

#96

A bit off the topic but a couple of doubts regarding pathogen. I installed pathogen and am a bit confused regarding the organisation of the plugins within pathogen. Say I have plugin called foo.vim, inside the bundles folder do I directly drop it or do I create a folder called foo and then drop foo.vim within it? Also say a plugin has syntax files and an ftplugin folder then do I just drop the plugin in pathogen and…

"Say I have plugin called foo.vim, inside the bundles folder do I directly drop it or do I create a folder called foo and then drop foo.vim within it? You need to create the folder foo with a folder called plugin and then foo.vim inside it -> foo/plugin/foo.vim " Also say a plugin has syntax files and an ftplugin folder then do I just drop the plugin in pathogen and it is supposed to work? Yep. Normally vim plugins a…

Thank you.

Re: Coming Home to Vim

#97
post #71

What annoys me about a lot of tech blog posts like this one is that they're essentially voodoo. People like the author write instructions about what you should do without even understanding the instructions themselves. "I’m not entirely sure what the filetype lines do. I’ve read that they’re necessary and so far I haven’t had problems." His example .vimrc has filetype listed twice, which is redundant. This in itself…

I see a lot of people in #vim (freenode) who have followed some random blog post instructions for configuring vim that we have to correct.

Re: Coming Home to Vim

#98
post #5

Earlier quoted context omitted.

Exactly. 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!

syntax 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

You 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

Re: Coming Home to Vim

#99
post #18
post #17

For a free, cross-platform (and excellent) alternative to PeepOpen, try Command-T I used to use FuzzyFinder_TextMate, but that's stopped development, and the creator recommends you use Command-T instead. https://wincent.com/products/command-t

LustyExplorer is good. One feature that I really like is that I can start exploring from the current directory or the directory of the current file. This way I can keep vim's current directory at the root of my source tree, and not have to deal with turning on 'acd' and all of the incompatibilities that can arise.

+1 for LustyExplorer. Use that every day at work and at home.

Re: Coming Home to Vim

#100
post #38

Earlier quoted context omitted.

The kevincolyar account does nothing but spam HN with links to his application. I am sick of seeing him post spam each time a VIM article hits the homepage.

I'm the author and submitter of the post and for what it's worth I don't mind his comment at all. It's relevant because OS X Vim users would probably like to use Vim movement everywhere. I know I would. It's certainly more relevant than the "use emacs lol" comments that inevitably show up.

Yeah, the whole vim/emacs war is so 1995.
Post reply on HN