Live data from Hacker News

A Good Vimrc

dougblack.io

141–150 of 178 posts

Re: A Good Vimrc

#142
post #49

Rebinding jk to escape because escape is too far away seemed like a fairly ugly hack to me, especially because you can't type it anymore without waiting. Why not simply rebind caps lock to escape? Caps lock is used awfully little, considering how prominent its position on the keyboard is. On Linux, you can rebind it by adding setxkbmap -option caps:escape to your .profile. If instead of an additional escape you prefe…

I use jk, and agree that binding escape to something easy is the most impactful change on my vim workflow. I encourage everyone to try it. The amount of times in the last year where i've had to actually type the string "jk" is exactly...one? I think, though perhaps I was imagining even that one. I suppose it really doesn't matter what you bind it to as long as you can execute the escape whilst keeping ALL of your fin…

I'm another jk devotee, I use caps lock a lot more. I don't get the complaint about using other servers. Either you control them in which case :tabnew ~/.vimrc and adding imap jk takes a few seconds, or you don't control them and so you just run the map command locally for your current file. My vimrc is around 200 lines but the jk bind is the only thing I must have these days. Enough forced Eclipse has beat it out of me, but I once had the habit of typing jk outside vim while thinking.

Re: A Good Vimrc

#143

I don't understand why you'd want to map leader to anything but space.

I fully agree. I think it seems like this key that people think is special like caps lock. The symmetry afforded by the space key and every other key on the keyboard is phenomenal.

Re: A Good Vimrc

#144
post #49

Rebinding jk to escape because escape is too far away seemed like a fairly ugly hack to me, especially because you can't type it anymore without waiting. Why not simply rebind caps lock to escape? Caps lock is used awfully little, considering how prominent its position on the keyboard is. On Linux, you can rebind it by adding setxkbmap -option caps:escape to your .profile. If instead of an additional escape you prefe…

As someone else pointed out, caps lock is an excellent compose key, that opens up a world of new characters that can be used throughout the environment.

Re: A Good Vimrc

#145

I'm seriously interested in such an article for Emacs. Anyone?

Check out spacemacs

I'm a relatively long time Spacemacs user, and just recently dropped it exactly because it abstracts too much, and I wanted Emacs keybindings. I've failed to comprehend how it answers my question. Thank you anyway.

Re: A Good Vimrc

#146
post #49

Rebinding jk to escape because escape is too far away seemed like a fairly ugly hack to me, especially because you can't type it anymore without waiting. Why not simply rebind caps lock to escape? Caps lock is used awfully little, considering how prominent its position on the keyboard is. On Linux, you can rebind it by adding setxkbmap -option caps:escape to your .profile. If instead of an additional escape you prefe…

I never need to type "jk" unless I'm pasting a certificate or a hash/UUID/key. It's worth the remap for me. As always, to each his own.

Re: A Good Vimrc

#147

I don't use vim as my go to editor so I may be asking a silly question; does it just use idiotic defaults or something? I've only met a couple 'vim users' who could just hop onto someone else's vim setup and be productive, and I've never met a single vim user who could use someone else's setup without making comments about everything being different. I guess the question is do people modify vim cause they can or caus…

Yes, the vim defaults suck. If you're building a new vimrc or want a common ground for pairing, I would recommend checking out [vim-sensible]( https://github.com/tpope/vim-sensible ) by tpope. It's a vim plugin that provides a set of sensible default options.

Vim Bootstrap (www.vim-bootstrap.com) is one I recently discovered and really like.

Re: A Good Vimrc

#148
post #49

Rebinding jk to escape because escape is too far away seemed like a fairly ugly hack to me, especially because you can't type it anymore without waiting. Why not simply rebind caps lock to escape? Caps lock is used awfully little, considering how prominent its position on the keyboard is. On Linux, you can rebind it by adding setxkbmap -option caps:escape to your .profile. If instead of an additional escape you prefe…

I set jk to Esc, and not CapsLock, because I use CapsLock to capitalize.

I'm currently working on a vimrc that caters to people like me, those who only use CapsLock to capitalize, and avoid all chording. When I'm done, maybe I can map Shift to Esc.

Re: A Good Vimrc

#149
nothing special about this vimrc.

This is what I have:

https://gist.github.com/halayli/ef3dd268986914ed77d5

At the very least, you need vim-session if you work on multiple projects (or branches)

vim-airline is a nice to have

Ag is a must have. it allows you to search files and preview the results directly.

I've also written a small function SwitchHeaderSource to switch between .c/cpp files and their headers. ,s is the shortcut.

Re: A Good Vimrc

#150

Earlier quoted context omitted.

Hi! Author here. Fair points. I'm gonna start out on the defensive: I didn't post the article, which kinda stinks because if I knew it was going to get such attention I would have updated it to my current setup. Anyways as the 1.5 year old article states: This article will almost certainly fall out of date with my vimrc in the very near future I don't do jk escape anymore. I have since abandoned custom escapes becaus…

I once told my wife an amusing story I'd read in Australian Personal Computer where a computer technician was told by a secretary that she was great with computers, said technician was very happy and joked that he was glad as the last person he had to help thought that the way to input capital letters was to press the caps lock key, the capital letter and then press the caps lock key again... To which the secretary a…

To be fair, some of the fastest typists use caps lock instead of shift, since it makes the shift action modal, instead of requiring coordination of multiple fingers at once.

http://forum.colemak.com/viewtopic.php?id=1309

Post reply on HN