Live data from Hacker News

Steve Losh's .vimrc

bitbucket.org

21–30 of 103 posts

Re: Steve Losh's .vimrc

#21

That's one thing that worries me about using vim full-time: if I become reliant on a .vimrc or a set of plugins to use vim effectively, but I'm on a computer that doesn't have my .vimrc on it, I'm doomed.

I've basically memorized my .vimrc and .gvimrc files from retyping them over and over again, but then I take the approach of using the standard configuration when possible and only customizing the minimum required, so it's not as bad as it sounds.

The power of VIM as an effective and consistent text editor is far more important to me than the power of VIM as a highly configurable editor.

Re: Steve Losh's .vimrc

#22

That's one thing that worries me about using vim full-time: if I become reliant on a .vimrc or a set of plugins to use vim effectively, but I'm on a computer that doesn't have my .vimrc on it, I'm doomed.

On all my machines ~/.vimrc and friends are symlinked out from my Dropbox folder.

Re: Steve Losh's .vimrc

#23

That's one thing that worries me about using vim full-time: if I become reliant on a .vimrc or a set of plugins to use vim effectively, but I'm on a computer that doesn't have my .vimrc on it, I'm doomed.

I've had that concern as well but have not found it to be a problem in practice. For one thing, it's not hard to go back to default vim if you're on a different system. For another, it's usually not that hard to copy your .vimrc over if you're going to stay awhile.

Re: Steve Losh's .vimrc

#24
post #11

Earlier quoted context omitted.

This is what I do. I can clone a git repo, run an install script, and have my typical vim setup running in a trivial amount of time.

Same here. cd hg clone http://bitbucket.org/sjl/dotfiles .dotfiles ln -s `pwd`/.dotfiles/vim/.vimrc ~/.vimrc cd - My full Vim config is now installed, plugins included thanks to Mercurial's subrepos. But really, I don't find myself editing files directly on servers all that often. And when I do I usually prefer bcvi anyway, because I can use MacVim instead of Vim through a terminal (which I hate because of all the sh…

Rather than type in the symbolic link commands, I just have a config script that I run (also checked into version control) that will move the old .vim directory, .bashrc, and other files out of the way, and install links to the version controlled file instead. Easy.

Re: Steve Losh's .vimrc

#25

I love reading these files and finding something new to use. gdefault is definite going in.

Ugh. Be careful with that, since actually giving a /g has the effect of toggling the behaviour all together.

From :help 'gdefault':-

    :help 'gdefault'
    'gdefault' 'gd'		boolean	(default off)
    global
    {not in Vi}
    When on, the ":substitute" flag 'g' is default on.  This means that
    all matches in a line are substituted instead of one.  When a 'g' flag
    is given to a ":substitute" command, this will toggle the substitution
    of all or one match.  See |complex-change|.

    command		'gdefault' on	'gdefault' off	~
    :s///		  subst. all	  subst. one
    :s///g		  subst. one	  subst. all
    :s///gg		  subst. all	  subst. one
While not quite documented under ":help :s_flags", two 'g' flags cancel each other out. This also applies to 'gdefault'.

Also, be aware that this may break a huge amount of scripts out there, should you decide to use it as some (hard to debug) issues are caused because of it.

Re: Steve Losh's .vimrc

#27
post #13

function! NyanMe() " {{{ ... I very much hope that's just there as an easter egg for those of us who read to the bottom.

Actually I'm planning on splicing it into MakeGreen, so instead of getting a green bar when my tests pass I get Nyan Cat flying across my window. Maybe over Thanksgiving weekend I'll get around to it. Edit: Also, if anyone can show me how to draw an ASCII-art Nyan Cat in one line of text that would be awesome. Nothing I tried looked recognizable.

This plugin[0] apparently plays an ascii version 'bad apple' music video. Inside vim.

Go figure.

[0] http://www.vim.org/scripts/script.php?script_id=3477

Re: Steve Losh's .vimrc

#29
post #24

Earlier quoted context omitted.

Same here. cd hg clone http://bitbucket.org/sjl/dotfiles .dotfiles ln -s `pwd`/.dotfiles/vim/.vimrc ~/.vimrc cd - My full Vim config is now installed, plugins included thanks to Mercurial's subrepos. But really, I don't find myself editing files directly on servers all that often. And when I do I usually prefer bcvi anyway, because I can use MacVim instead of Vim through a terminal (which I hate because of all the sh…

Rather than type in the symbolic link commands, I just have a config script that I run (also checked into version control) that will move the old .vim directory, .bashrc, and other files out of the way, and install links to the version controlled file instead. Easy.

I use this ruby script: https://github.com/technicalpickles/homesick

Re: Steve Losh's .vimrc

#30
post #26

Does this affect performance in any way? 1k+ lines is quite a lot.

In any way? Of course.

But my laptop has 8 gigabytes of RAM, a solid state hard drive, and four processor cores.

I can run Minecraft at the highest settings while accidentally leaving a Linux VM running in the background. Loading a 1.5k vimrc file is barely a blip on the processor graph.

Post reply on HN