Sublime Text - show open files on the left - sublimetext

Is there a way to show the files that are open in SublimeText on the left of the screen, in a simple list?
I'd simply like the open files to appear on the left in a clickable way like this
file1.txt
file2.css
file3.htm
etc
is that possible?

Go to the "View" menu and choose "Side Bar", then "Show Open Files"

Right click on open file in editor...
Click on Reveal in Side Bar option, it will sync the open file with side bar

Ctrl+K+B will reveal the 'Side bar', with open file information. It is really worth using projects, they are really simple and provides for easy folder/project/file switching.
I also strongly reccomend going to preferences>Key Bindings - Default through the menus, and looking at all the functionality and keyboard shortcuts. Also 'preferences>Settings - Defualt`, shows you all of the configurable options (there are a lot). These are basically 'must dos' for getting full goodness out of Sublime.

If you want to do it only using keyboard, Command + Shift + P and select View: Toggle Open Files in Side Bar

Here's the key binding to run this shortcut using the keyboard:
[
{ "keys": ["super+shift+j"], "command": "reveal_in_side_bar" },
]

Related

How to select all instances of selected region in Sublime Text

Is there a shortcut key or single-step menu option to find and select all instances of a highlighted selection in Sublime Text?
On Mac OS you can use: CMD + CTRL + G
On Windows/Linux press Alt+F3.
On Windows/Linux press Alt+F3.
This worked for me on Ubuntu. I changed it in my "Key-Bindings:User" to something that I liked better though.
On Mac:
⌘+CTRL+g
However, you can reset any key any way you'd like using "Customize your Sublime Text 2 configuration for awesome coding." for Mac.
On Windows/Linux:
Alt+F3
If anyone has how-tos or articles on this, I'd be more than happy to update.
Note:
You should not edit the default settings, because they get reset on updates/upgrades. For customization, you should override any setting by using the user bindings.
On Mac:
Sublime Text 2 > Preferences > Key Bindings-Default
Sublime Text 3 > Preferences > Key Bindings
This opens a document that you can edit the keybindings for Sublime.
If you search "ctrl+super+g" you find this:
{ "keys": ["ctrl+super+g"], "command": "find_all_under" },
In the other posts, you have the shortcut keys, but if you want the menu option in every system, just go to Find > Quick Find All, as shown in the image attached.
Also, check the other answers for key binding to do it faster than menu clicking.
Even though there are multiple answers, there is an issue using this approach. It selects all the text that matches, not only the whole words like variables.
As per "Sublime Text: Select all instances of a variable and edit variable name" and the answer in "Sublime Text: Select all instances of a variable and edit variable name", we have to start with a empty selection. That is, start using the shortcut Alt+F3 which would help selecting only the whole words.

iTerm2 keyboard shortcut - split pane navigation

I have been a long time user of the standard Mac Terminal. Decided to experiment with iTerm2 after hearing good things about it from my colleagues.
One of the more useful features I am seeing on iTerm2 is its split panes (much like vim split buffers).
In vim, I can move between split buffers using Ctrl+W+arrowkeys. Is there a keyboard shortcut for iTerm2 to move between panes as well?
From the documentation:
Cmd] and Cmd[ navigates among split panes in order of use.
Cmd+opt+←/↑/→/↓ navigate similarly to vim's C-w hjkl.
⌘+⌥+←/↑/→/↓ will let you navigate split panes in the direction of the arrow, i.e. when using ⌘+D to split panes vertically, ⌘+⌥+← and ⌘+⌥+→ will let you switch between the panes.
there is configuration in the following way:
Preferences -> keys -> Navigation shortcuts
the 3rd option: shortcut to choose a split pane is "no shortcut" by default, we can choose one
cheers
I was using Terminator before, so I found it convenient to re-map Alt + arrow-key to switch between the panes. This can be done in Preferences -> Keys -> Key Mappings - press the '+' button to add a mapping. Also, in my case such a mapping was already defined in Profiles, I simply removed it.
Spanish ISO:
⌘+⌥+[ goes left top
⌘+⌥+] goes bottom right

Textmate: cannot find page up for macbook keyboard

Using a macbook keyboard (which means I do not have the 'page up' button) I cannot figure out what the pageUp keybinding is or how to bind ctrl+u to the pageUp action.
My first attempt was to add this to my KeyBindings.dict file:
{
"^u" = "pageUp:";
}
That didn't work, so I tried to define pageUp: in "settings -> keyboard -> keyboard shortcuts -> application shortcuts" and then created one for textmate using 'pageUp' and 'pageUp:' as the 'Menu Title' option (there is no menu option for textmate that I can see so I was kind of guessing here).
Basically, what is the opposite of ctrl+v? Or if it does not exist for this keyboard, how can I bind ctrl+u to page up?
You may have changed something with that keybindings file. fn-up arrow should page up and fn-down arrow should page down. The cursor doesn't move with these however, just the screen. I just accidentally found that Ctrl-Up and Ctrl-Down work the same way in TextMate. Playing around a bit, I also found that fn-Opt-Up and fn-Opt-Down will page up and page down while also moving the cursor.
I don't see right away the binding for it, but I do know that on MacBook's, fn + up / down arrow keys gives you page up / page down functionality.

Visual studio Reformat Code/Document

I can't find the Reformat button, I know I can use ctrl+k+d, but I wish to have also the toolbar with the button. can someone help me ?
You can use Edit > Advanced > Format Document and you can also move this as a button to any toolbar. Go to Tools > Customize > Commands, select Toolbar and push Add Command button. Then select Edit category and find Document Format.
Apparently VS2010 (maybe others) hide certain commands depending on the style you choose. I chose Web Dev (code) as my choice and the Document Format is not present to be added to a toolbar. But, if I change to C# Code (tools>Import/Export) then the Document Format command is right there in the Edit menu where others here have said it is.
I had to import the C# Dev layout, but unchecked colors and code formatting options (so it won't overwrite those). What section you must import to get the format document button, I don't know, I didn't experiment that deep.
Seems stupid MS chose to force us down specific paths for layout with no convenient way to get out of it.
If you can't find it in the Edit menu: you can also find it if you press CTRL + P and then type >format. The shortcut is SHIFT + ALT + F

Textmate tab and de-tab selected block

Recently switched to Textmate on Mac for coding. On PC when ever I want to tab in or out a block of code I just highlight and press tab or shift+tab to move it in our out. It's very useful when you are adding an extra loop or conditional statement to a block of code to keep everything tidy and neatly indented.
On Textmate however when I try this it just replaces my selected text with a tab. So is there a way to do tab and de-tab lines of code in textmate?
Indent: Alt+Tab
Un-Indent: Shift+Alt+Tab
the hotkey is command-left bracket to move left and command-right bracket to move right
(the buttons next to 'p')
heres a link to more hotkeys and such
http://projects.serenity.de/textmate/tutorials/basics/
You can use Shift+Tab to decrease indent; You just need to make and assign a macro. You can reuse this technique to accomplish a great many things.
Enter some text, and intend them, this is mostly for feedback.
Click the Record Macro Button
Use ⇧+⌥+⇥ (aka; Shift + Option + Tab) to decrease the indentation.
Click the record button to stop recording the macro.
Use the Edit menu or ⌃+⌘+M to save your macro;
Saving will prompt you to create a new bundle*, or add your macro to an existing bundle.
Add a Key Equivalent by clicking in the field and pressing ⇧+⇥
Your bundle-macro should look like the one below, simply Save and you're done! TextMate will now decrease indent on ⇧+⇥
*: (as noted by u/PatrickT) Sadly the create new bundle functionality has not yet been implemented, and you must choose to add to an existing bundle. You can still create a bundle via Bundles -> Edit Bundles then Command + N.
As an alternative, you can change the keybindings, see Link
Here is what I did:
Install Link
Go to File -> Open -> User Key Bindings, this will create/edit ~/Libary/KeyBindings/DefaultKeyBinding.dict
Add a binding, for the action enter shiftRight: (indent) manually (this is a TextMate specific action and not in the pre-populated actions list)
Choose a shortcut, I used cmd+alt+right
Do the same for the action shiftLeft: (un-indent, I used cmd+alt+left)
Save and then restart TextMate
I used a shortcut with arrow keys as my right hand is already on the arrow keys when I am selecting multiple lines, so this is a good fit.
The reason why I did it was because I have a german keyboard and alt+tab/alt+shift+tab don't work for me since I am using Witch for app-switching using these exact shortcuts.
EDIT: cmd+alt+left/right don't work when you have multiple tabs open, as they are used for navigate to next or previous tab in TextMate... seems this cannot be changed or overridden (I tried Setting Shortcut Keys in Textmate). Looking for an alternative shortcut now.

Resources