Live data from Hacker News

Steve Losh's .vimrc

bitbucket.org

41–50 of 103 posts

Re: Steve Losh's .vimrc

#41

I'm sure I've seen this in vim, but I can't find it now. Isn't there a statusline config item that shows any pending command prefix chars you've typed?

I think you want :set showcmd —"Show partial command in the last line of the screen".

THAT'S IT! My long lost friend is back! Thank you!

Re: Steve Losh's .vimrc

#42
Here's a commented version of my .vimrc, which is modeled after Steve's, albeit nowhere near as comprehensive. (Looks like I lost it's fixed width in the paste? Sorry!)

http://pastebin.com/jJQFxQpR

For me it's a lot quicker to reference comments than the :help entry for each option. Thought it might help others who are creating/modifying their .vimrc.

And of course, thanks Steve for continuing to share your stuff. I'm in love with Vim, and a lot of that's thanks to you.

Re: Steve Losh's .vimrc

#47
I didn't know this was possible:

    " Resize splits when the window is resized
    au VimResized * exe "normal! \="
That's really handy. Also, this part made me smile:

    " Heresy
    inoremap  I
    inoremap  A

Re: Steve Losh's .vimrc

#49

Earlier quoted context omitted.

They're fold markers. When I open my vimrc in Vim it looks like this: http://d.pr/YKCM

Why doesn't my Vim fold things automatically? What options am I missing?

Either

    set foldmethod=marker
Or put this modeline at the top of your .vimrc:

    " vim: foldmethod=marker foldlevel=0

Re: Steve Losh's .vimrc

#50

Earlier quoted context omitted.

They're fold markers. When I open my vimrc in Vim it looks like this: http://d.pr/YKCM

Why doesn't my Vim fold things automatically? What options am I missing?

`foldmethod` and friends.

There are a bunch of different methods for folding (indentation, manual markers, custom syntax-based folding, etc), and which one you want usually depends on the file type.

I have a bunch of autocommands for different files that set the foldmethod appropriately. For example:

    augroup ft_vim
        au!

        au FileType vim setlocal foldmethod=marker foldmarker={{{,}}}
    augroup END

    augroup ft_js
        au!

        au FileType javascript setlocal foldmethod=marker foldmarker={,}
    augroup END
This makes Vim fold using markers for Vim and Javascript files. The Vim markers are the usual {{{ and }}}, but Javascript has it's own "built-in" markers we can take advantage of, so it uses { and }.
Post reply on HN