Skip to Content
Small, Sharp Software Tools
book

Small, Sharp Software Tools

by Brian P. Hogan
June 2019
Intermediate to advanced
328 pages
7h 27m
English
Pragmatic Bookshelf
Content preview from Small, Sharp Software Tools

Creating Keyboard Shortcuts

A number of keyboard shortcuts are at your disposal. You learned about several of them in Useful Shortcuts. For example you learned that Ctrl+l clears the screen, and Ctrl+a jumps to the beginning of the line. Use the bind -p command to see a list of all the defined commands available. It’s a long list, so use less:

 $ ​​bind​​ ​​-p​​ ​​|​​ ​​less
 "\C-g": abort
 "\C-x\C-g": abort
 "\e\C-g": abort
 "\C-j": accept-line
 "\C-m": accept-line
 ...

In addition to the ones already defined, you can make your own. Try it out by using the bind command to map Ctrl+t to execute the pwd command:

 $ ​​bind​​ ​​'"\C-t": "pwd\n"'

Note a couple things about this. First, you need single quotes around the keybinding definition. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

The VimL Primer

The VimL Primer

Benjamin Klein
What Employees Want Most in Uncertain Times

What Employees Want Most in Uncertain Times

Kristine W. Powers, Jessica B.B. Diaz

Publisher Resources

ISBN: 9781680507003Errata Page