In Sublime Text 2, you can turn line numbers on and off using the line_numbers
setting, but there isn't an equivalent toggle_line_numbers
command you can bind to a keystroke (as there is for, say, toggle_tabs
to toggle file tabs). So is there another way to configure it so I can toggle line numbers at a keystroke?
In Sublime Text, you can quickly jump to any line in the code. Hit Ctrl–G (Mac and Windows). Type in a line number and hit Return/Enter to go to that line.
Users can customize their key bindings by creating a file named Default. sublime-keymap in their Packages/User/ directory. For example, the following will create a key binding to show unsaved changes, if any exist, via Ctrl+Shift+`.
Just select the text, split the selection ( ctrl+shift+l ), insert and select $ at the start of the line, and evaluate python ( ctrl+shift+x ) to get increasing numbers.
As per http://www.sublimetext.com/docs/2/settings.html, it looks like you should be able to do something like this:
{ "keys": ["ctrl+shift+l"], "command": "toggle_setting", "args":
{"setting": "line_numbers"} }
Don't forget to add a comma at the end of above code if you are placing anywhere but at the end of the Key Bindings Preferences file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With