- Sublime Text 2 Mac Shortcuts
- Sublime Text 2 Macros
- Sublime Text 2 Mac Unable To Save
- Sublime Text 2 Format Json
- Sublime Text 2 Mac Install Package
- Download Sublime For Mac
Active5 years, 11 months ago
I am trying to set up a custom key binding in Sublime Text 2 (on Mac) so that I could use my keyboard 'Home' and 'End' keyboard keys to go to the beginning / end of line(s) as I am used to using those keys from PC. But I am not having much luck.
Sublime Text 2 may be downloaded and evaluated for free, however a license must be purchased for continued use. There is currently no enforced time limit for the evaluation. There is currently no enforced time limit for the evaluation. NOTE: You may need to replace Sublime Text.app in the command above to Sublime Text 3.app or Sublime Text 2.app depending upon where the application is stored in your Applications directory. At the end of the above command opens the current working directory you are located in (again make sure you're in a directory that only contains. If you open Sublime Text 2 -> Preferences -> Browse Packages. The Packages folder will open in Finder. For ST2, it is ~/Library/Application Support/Sublime Text 2/Packages. If you upgrade to ST3 (which I highly recommend doing), the path is ~/Library/Application Support/Sublime Text 3/Packages.
As of now, I have to user 'Ctrl + e' & 'Ctrl + a' in Sublime to go to the beginning or end of the line.
Sublime Text 2 is a really nice text editor with a lot of power behind it. It also has a “Vintage” mode for folks who fancy vim, such as myself. I also happen to enjoy exploring new software, especially text editors, and Sublime Text 2 is my current favorite text editor.
Sublime Text 2 Mac Shortcuts
I was trying to edit the following file.
Default (OSX).sublime-keymap --User
I am not sure what 'command' to add to my code. Any help would be much appreciated.
[ { 'keys': ['home'], 'command': '???' }, { 'keys': ['end'], 'command': '???' } ]
Thanks in advance!
Vasek
VasekVasek
2 Answers
You can also remap home and end in OS X. Save a property list like this as
~/Library/KeyBindings/DefaultKeyBinding.dict
:Then quit and reopen Sublime Text or other applications to apply the changes.
See http://www.hcs.harvard.edu/~jrus/site/cocoa-text.html or http://lri.me/keybindings.html for more information.
![Text Text](https://pxhst.co/avaxhome/a1/66/002766a1.jpeg)
32.6k55 gold badges9595 silver badges135135 bronze badges
Here is the answer to my question how to set up 'Home' and 'End' keyboard keybinding in Sublime Text 2 on Mac
The following code goes to Key Bindings - User file
![Sublime Text 2 For Mac Sublime Text 2 For Mac](/uploads/1/2/6/0/126076421/902214190.jpg)
{ 'keys': ['home'], 'command': 'move_to', 'args': {'to': 'bol', 'extend': false} }, { 'keys': ['end'], 'command': 'move_to', 'args': {'to': 'eol', 'extend': false} }
VasekVasek
Not the answer you're looking for? Browse other questions tagged macosmackeyboard-shortcutssublime-text-2 or ask your own question.
Active5 years, 5 months ago
I tried to run hello world in C++ on sublime text 2 on my mac.
I typed
but it gives me an error
MattDMo79.6k1717 gold badges180180 silver badges191191 bronze badges
user3393004user3393004
1 Answer
The following methods will solve your problem:
Method 1 : (BAD PRACTICE)
Sublime Text 2 Macros
Adding the following line before main function.
So your code will now become:
Sublime Text 2 Mac Unable To Save
Method 2 : (GOOD PRACTICE)
You can simply write
std::cout
instead of cout
.Full code with
std::cout
This tells the compiler that the
cout
identifier comes from the std
namespace.Method 2 is better than Method 1. Further reading : Why is 'using namespace std' considered bad practice?
For more information on namespaces, check out the following links:
Sublime Text 2 Format Json
Community♦
Crystal MethCrystal Meth
Sublime Text 2 Mac Install Package
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.