Live data from Hacker News

Enhancements to Shell and Vim Productivity

danielmiessler.com

21–30 of 62 posts

Re: Enhancements to Shell and Vim Productivity

#23
post #11

Earlier quoted context omitted.

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.

Do you happen to know a resource that explains how you do this?

Re: Enhancements to Shell and Vim Productivity

#26
"7. Use vi-mode in Your Shell"

Tried this and gave it up. Your shell may be (somewhat) vi compatible but the applications you use mostly are not so you'll have to break out of the vi mindset at all sorts of inopportune moments. That, and modal editing, while perfectly alright for text editing, maps rather lousily to command line operations. You're much better off getting used to some basic Emacs-style key bindings that work consistently across a wide number of applications (including OS X text fields, IIRC).

Re: Enhancements to Shell and Vim Productivity

#27
As a Vim user, I've always been drawn toward using vi keybindings in bash.

However, as a Mac user, all of the Cocoa text widgets more or less support emacs keybindings, so having a working knowledge of basic emacs movement commands has been very useful.

The emacs bash/readline keybindings also have a really neat trick that the vi bindings don't -- keyboard macros!

Ctrl-( to start recording, Ctrl-) to stop, and Ctrl-x to execute.

Re: Enhancements to Shell and Vim Productivity

#28
post #23

Earlier quoted context omitted.

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.

Do you happen to know a resource that explains how you do this?

The way I do it is: map caps lock to Ctrl in System Preferences, then download this tool[1]. The setting you are looking for is 'Control_L to Control_L'. When you hold Control it acts as a modifier but if you tap it, it acts as escape.

[1] http://pqrs.org/macosx/keyremap4macbook/

Re: Enhancements to Shell and Vim Productivity

#29
post #27

As a Vim user, I've always been drawn toward using vi keybindings in bash. However, as a Mac user, all of the Cocoa text widgets more or less support emacs keybindings, so having a working knowledge of basic emacs movement commands has been very useful. The emacs bash/readline keybindings also have a really neat trick that the vi bindings don't -- keyboard macros! Ctrl-( to start recording, Ctrl-) to stop, and Ctrl-x…

How is Ctrl- different from using "q" in vi?
Post reply on HN