Live data from Hacker News

Enhancements to Shell and Vim Productivity

danielmiessler.com

11–20 of 62 posts

Re: Enhancements to Shell and Vim Productivity

#11
post #5

> inoremap jj A mapping I've been using for years. I'm pretty sure between this and Ctrl-c, I never hit escape in Vim anymore.

I've always used Ctrl-[. It's there in all Vim installs, doesn't conflict with anything else that I know of, and is a quick, no-glance pinky shift for both hands (assuming you remap your Capslock to Control). Edit: Ninja'd by top-level comment!

Re: Enhancements to Shell and Vim Productivity

#12
post #7

When you have already remapped Caps-Lock as an additional control, why not just use Ctrl-[ instead of the 'jj' remapping for Escape. It saves a bit of Vim configuration, and also works in Bash vi mode.

I just remapped Caps Lock as Escape. I use Escape a lot between tmux with vim modes, bash, and vim itself. I do this in OSX and for the linux console and X11.

Re: Enhancements to Shell and Vim Productivity

#13

"A commenter mentioned using Dropbox for synchronization as well, which seems attractive, but I’m not sure how clean that would be on headless Linux servers." Dropbox does work pretty nicely on headless Linux servers, you just have a daemon running constantly with none of the GUI extensions. I use it for keeping some code in check. Nice list of things to try, I don't use vim but I've been putting off doing 3 of them…

For some (entirely irrational, I'm sure) reason, the idea of constant and automatic deployment of my dotfiles across all my boxes gives me the shivers. I like that extra bit of control I get from doing it with a git repo.

Re: Enhancements to Shell and Vim Productivity

#14
post #12
post #7

When you have already remapped Caps-Lock as an additional control, why not just use Ctrl-[ instead of the 'jj' remapping for Escape. It saves a bit of Vim configuration, and also works in Bash vi mode.

I just remapped Caps Lock as Escape. I use Escape a lot between tmux with vim modes, bash, and vim itself. I do this in OSX and for the linux console and X11.

I've also seen setups that somehow let Caps Lock work as Ctrl when used as a modifier key, and Esc when used regularly.

Re: Enhancements to Shell and Vim Productivity

#15
post #13

"A commenter mentioned using Dropbox for synchronization as well, which seems attractive, but I’m not sure how clean that would be on headless Linux servers." Dropbox does work pretty nicely on headless Linux servers, you just have a daemon running constantly with none of the GUI extensions. I use it for keeping some code in check. Nice list of things to try, I don't use vim but I've been putting off doing 3 of them…

For some (entirely irrational, I'm sure) reason, the idea of constant and automatic deployment of my dotfiles across all my boxes gives me the shivers. I like that extra bit of control I get from doing it with a git repo.

Same, which is why I git repo them as well. It's mostly a nice way to keep a few bits of code in check, plus handy for quick private repos without needing all the nice stuff from GitHub/BitBucket.

Re: Enhancements to Shell and Vim Productivity

#16
post #4

I'm a full-time Vim user who has never taken to `bindkey -v`. The reason is simple: I'm using insert mode 99% of the time, so using vi keybindings just makes me have to hit an extra key. However, it is useful some of the time. Since viins is pretty useless by default, you can spice it up by setting custom bindings (e.g. copy emacs') and get the best of both worlds. Furthermore, this may be helpful: http://www.bewater…

`bindkey -v` puts you in insert mode by default (there's a way to make it not do that, but the default is insert first). So there's not really an extra key, you get both benefits :).

I meant that you have to hit an extra key to actually make use of the mode's default bindings.

Re: Enhancements to Shell and Vim Productivity

#17
post #11
post #5

> inoremap jj A mapping I've been using for years. I'm pretty sure between this and Ctrl-c, I never hit escape in Vim anymore.

I've always used Ctrl-[. It's there in all Vim installs, doesn't conflict with anything else that I know of, and is a quick, no-glance pinky shift for both hands (assuming you remap your Capslock to Control). Edit: Ninja'd by top-level comment!

In OSX at least, there's a way you can make Caps Lock behave as Ctrl when used as a modifier key, or Esc when pressed alone. Way better than adding an extra keystroke to every time you want to hit Esc.

Re: Enhancements to Shell and Vim Productivity

#18
One small suggestion (I make this every time vim comes up):

Don't remap "jj" to escape. Remap "jk" instead. All of the same benefits, plus one more - if you get into the habit of nervously hitting "jk" all the time, as most people do in vim, using "jk" means your cursos stays in place. On the other hand, "jj" means your cursor will move.

Post reply on HN