Live data from Hacker News

Steve Losh's .vimrc

bitbucket.org

81–90 of 103 posts

Re: Steve Losh's .vimrc

#81
post #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 al…

I've had this set for a while now and haven't noticed any scripts breaking. It's far more common for scripts to break because I'm remapped something and they used 'nmap' instead of 'nnoremap' or 'normal' instead of 'normal!'.

Whenever a script breaks, I bite the bullet and fix it, fork it on Github, switch my dotfiles repo to use my fork and send a pull request. If they merge my fix I switch my dotfiles repo back.

It's a pain in the ass, but I like to think that it helps other Vim users a little bit.

Re: Steve Losh's .vimrc

#82

I also have a huge vim configuration: https://github.com/sashahart/.vim I highly recommend putting your vim configuration on github or similar, you don't have to worry about losing your config and it gets easier for everyone to learn the new tricks

I'm stealing "nnoremap o" immediately. Thanks!

Re: Steve Losh's .vimrc

#83
post #71
post #53

Anyone who knows who sjl is could have easily found his vimrc through his website. According to the bitbucket history, the file has been hosted there since at least 2009.

Which doesn't make it less useful. And for those of use who don't know sjl, this was useful.

Did I say it wasn't useful? Maybe you missed my point.

I could post a link to a perldoc page for some builtin function, and that would be useful, and it's probably been around for awhile, and probably nobody knows who wrote it. Would you defend that too?

Re: Steve Losh's .vimrc

#84
post #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

Having paired with many people who have loaded Emacs keybindings into Vim, this made me laugh.

But serious talk:

Unless someone has loaded Emacs keybindings, shouldn't be used to increment a number (even a hexadecimal one)? How is that heresy? Not having makes several macros difficult.

Re: Steve Losh's .vimrc

#85
post #73

Earlier quoted context omitted.

That's a huge amount of trust you've placed in bit.ly, and in insecure http. You might at least consider typing out https://bit.ly/newbox so that you only have to trust bit.ly. Better yet, memorize the URL that bit.ly links to. Also, why do you symlink your dotfiles into your cloned git repo, rather than just checking out the git repo as ~? Personally, I just move the .git directory from the clone to ~, and then "git…

I'm lazy and don't want to type out the github URL, but you're right I should place the redirection under my control and use HTTPS. Honestly though I cannot think of a single reason why anyone would want to hijack my script. I don't do anything very interesting that would make my machine a lucrative target for that sort of malicious activity. I'm a very small fish in a massive pond. Also due to laziness I don't want…

Just watch out that you don't get a 404 one day and end up piping a whole lot of error screen HTML into your shell, it could have wildly unpredictable results.

Re: Steve Losh's .vimrc

#87

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 feel exactly the opposite. The previous editors that I used required configuration through a menu system. I wouldn't have known how to take that with me elsewhere. With Vim, all my configuration is in files, which can be backed up. I have them in a dotfiles repo on Github. As I make tweaks, I regularly pull and push from my various computers and they are always up to date. If I'm on a computer that doesn't have my…

I do the same thing. But I also have customized branches to work with my config. I will usually make new commits on the computer-specific branch and then cherry pick the commits to master and then rebase the computer-specific branch on top of master. This can get a little repetitive and result in my computer-specific branches getting very out of date so I wrote a bash script called git-update to streamline this process for me. Here's the code:

https://github.com/axelson/git-update

Re: Steve Losh's .vimrc

#88
God bless nvi.

I will never understand why people go out of their way to write and maintain such monster configuration files.

Learning core/traditional vi gets one a long way, instead of delusioning themselves with false cleverness and productivity.

Re: Steve Losh's .vimrc

#89
post #78

Earlier quoted context omitted.

(I love both editors) That's something disgusting about Vim - mapping to other keys instead of commands. In Emacs its much nicer IMO: (global-set-key (kbd "C-a") 'beginning-of-line)

Disgusting but practical. I already know the keys on the right because I use them every day. If it were a function I'd have to look it up first.

Is there a Vim equivalent of Emacs's C-h k followed by the key combo, which basically says, "Tell me what the official command name is for this keystroke?"

Re: Steve Losh's .vimrc

#90
post #89

Earlier quoted context omitted.

Disgusting but practical. I already know the keys on the right because I use them every day. If it were a function I'd have to look it up first.

Is there a Vim equivalent of Emacs's C-h k followed by the key combo, which basically says, "Tell me what the official command name is for this keystroke?"

I don't know of anything quite like that but the help can be searched by key, though only for the default key combinations, e.g. ":h i^a" would show the docs for the ctrl-a command in insert mode.

Note though that vim really doesn't have commands the same way as emacs does. That's why you generally see assigning one key combination to another instead of some "command name."

Post reply on HN