Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Sublime Text

You're reading from  Mastering Sublime Text

Product type Book
Published in Dec 2013
Publisher Packt
ISBN-13 9781849698429
Pages 110 pages
Edition 1st Edition
Languages
Author (1):
Dan Peleg Dan Peleg
Author Profile Icon Dan Peleg
Dan Peleg
Toc

Table of Contents (15) Chapters Close

Mastering Sublime Text
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Installing Sublime Text 2. Code Editing 3. Snippets, Macros, and Key Bindings 4. Customization and Theme Development 5. Unravelling Vintage Mode 6. Testing Using Sublime 7. Debugging Using Sublime 8. Developing Your Own Plugin Index

Overriding and maintaining key bindings


In the previous chapter, we bound as key combination to our macro. Sublime also gives us the option to bind keys to any command by adding custom key bindings; but what are key bindings exactly? In one sentence:

"Key bindings map key presses to commands."

All of Sublime's key bindings are configurable by JSON-formatted .sublime-keymap files.

Platform-specific key bindings

Key bindings can be different per platform; their filename has to be one of the following:

  • Default (Windows).sublime-keymap

  • Default (OSX).sublime-keymap

  • Default (Linux).sublime-keymap

These file names are platform dependent; this means that the key bindings defined in the Windows keymap file will only work if we are on Windows or other OSes. It is important to know that user-specified key bindings need to be placed in Packages/User/Default (<platform>).sublime-keymap.

Key map file structure

A key map is an array of key bindings. Each key binding contains the following elements:

  • keys...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime