Sublime Text 3 Shortcut Find and Replace won't work - sublimetext3

I've found several topics related to my issue, but they didn't work. In Sublime Text 3, my macOS super+alt+f "find and replace shortcut" (raise the panel of find/replace) doesn't work. I already tried:
running "FindKeyConflicts: All key conflicts":
(super+l,alt+super+f)
latex_fill_all LaTeXTools
[{"operand": "text.tex.latex", "operator": "equal", "key": "selector"}]
an then put the following into Preference > Key Bindings (User):
{"keys": ["super+alt+f"], "command": "show_panel", "args": {"panel": "replace", "reverse": false}}

This is how to resolve your Sublime Text key binding conflict.
Install the BoundKeys package.
Run BoundKeys by selecting List bound keys from the Command Palette.
BoundKeys will create a new buffer (unsaved file) which lists all of your key bindings on a file by file basis, i.e. all the .sublime-keymap files that ST has loaded.
Have a look at this BoundKeys example output. The example has been heavily edited, enough so that you can easily see the essential components.
The keys from each .sublime-keymap file are shown, with the highest precedence (highest priority) file at the top, while those from the file with the least precedence (lowest priority) are shown last.
In the example output have a look at the bottom line in the top .sublime-keymap file, the User package. shift+f10 has been assigned to the context_menu command, the right-hand column shows that there is a conflict with the ChooseWindow package. Look a little down and you'll see the corresponding line in the ChooseWindow package - the shift+f10 line shows a conflict with *User*. The *asterisks* show that this key binding has been overwritten by the one in the User package.
Now search your BoundKeys output for Super+Alt+F. You should be able to tell where the key conflict is and it should be fairly easy to see how to resolve the conflict.
Note that you may have to search for Alt+Super+F as well. It should be clear that Super+Alt+F and Alt+Super+F are the same key binding but not the same text.

I hope this answer will help if you run into the same issue, because it's a bit tricky. The issue is a small App I use which used the shortcut above.
It's clear there is a Shortcut I didn't find at start. With this information I just changed the following within Preferences > Key Bindings:
{
"keys": ["super+shift+alt+f"], "command": "show_panel", "args": {"panel": "replace", "reverse": false}
}

Related

Sublime Text 3 disable SHIFT+Delete copying the selected text

Is it possible to disable this behaviour? It's possible in Visual Studio but I would like to change this also on ST3.
I think that the original question is not about removing the functionality of shift+delete, but only removing the copy function from it. So I'd like to post my answer here in case somebody would be looking for specifically this.
I found right_delete, mentioned in the comments, to be rather inconvenient, because you would need your cursor to be at the beginning of the line in order to work. I found that line deletion is set to ctrl+shift+k by default (on Windows), so I just used its macro for shift+delete.
So here's the line I added to my Preferences > Key Bindings:
{ "keys": ["shift+delete"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} },
This way you don't need to worry about the position of your cursor, as long as it's within the wanted line.
On Windows/Linux, the Default key bindings map Shift+Delete to the cut command:
{ "keys": ["shift+delete"], "command": "cut" },
In order to disable that behaviour, you can select Preferences > Key Bindings from the menu, and add the following to the binding to the right hand pane:
{ "keys": ["shift+delete"], "command": "noop" },
Alternately you can replace noop with some other command that you would rather perform in this case instead, should you want to use the key for something else.

How to enable auto-align in Sublime Text 3?

I want to auto-align my code to make it easier to read, in a click. I am working on Sublime Text 3 and want to know about a method through which I can enable auto-indent of the code in just a click.
I'd recommend the AlignTab extension: https://github.com/randy3k/AlignTab (with Demo)
By using the https://github.com/randy3k/AlignTab package, you can activate the Table Mode which constantly aligns the code for you, until you run the command Exit Table Mode, for example:
{"keys": ["f12"], "command": "reindent", "args": {"single_line": false}}
In the title bar, go to Preferences > Key Bindings, then add this binding to "Key Bindings - User" file.
{"keys": ["alt+shift+f"], "command": "reindent", "args": {"single_line": false}}
Now whenever you want to auto-align your code, just highlight the desired code and press alt+shift+f
Source: https://coderwall.com/p/7yxpdw/auto-indenting-on-sublime-text-3
Note: This was the original answer from the OP #Utkarsh (with score 18) that OP deleted and edited into the question.

Make cmd+| map to command in sublime text

In Atom cmd+| maps to toggling the file tree, how can I make sublime text do the same when these keys are pressed
If by toggling the file tree you mean hiding and showing the side bar, what you want to do is remap the key bound to the command that does that by default.
Note: Based on your use of cmd in the question, I'm assuming you're on a Mac so the answer is tailored for that. The operation remains the same but the key name will be different for the other platforms.
If you look at the default key bindings (available from the Preferences menu, which under MacOS is part of the Sublime Text menu entry) you can determine what keys are bound to what by default. In this case the command you want is toggle_side_bar; if you don't know the command you can find it by searching the key map to find the keys that you know you press to do this normally.
With that information, the default key binding for MacOS is:
{ "keys": ["super+k", "super+b"], "command": "toggle_side_bar" },
In your own custom key bindings file (available from the same menu as the defaults) you just need to insert your own key binding. For your case, that would look like this:
{ "keys": ["super+\\"], "command": "toggle_side_bar" },
You might think that the key should be super+| since that is what you want to bind to ultimately; however that will not work because in order to generate that character, you need to be pressing Shift, and thus without shift as a part of the key binding, it won't work.
Instead we use the character that is generated if you press the key without shift, which on my keyboard is \. That is a special character in JSON strings, so it needs to be doubled in order to be correct.
For keyboard layouts different from US QWERTY, you might need to swap that character for something else. You can determine the binding you want by opening the Sublime console with View > Show Console, entering the command sublime.log_input (True) and then pressing the key combination in question; Sublime will tell you what it thinks you pressed.

SublimeText: How to find the command for "Next Build Result" to map it to a different key?

Background: I am working on an SML file on SublimeText3 with build system setup.
After a build, i can successfully jump to the first error using the F4 key. I want to add another key mapping for the same "Next Result" command eg:Cmd+N in Vintage mode.
What should i add as in my keybindings file to achieve this?
What documentation,file did you refer/look around to find the proper answer for question 1? What was your thought process in brief to figure it out ?
edit: changed the required keybinding from <leader>cn to Cmd+N to make things easier
For future reference, you can type sublime.log_commands(True) into the Sublime console and then the command name of every action you do will get printed to the console. Once you get the command name you need, you can stop the command printing with sublime.log_commands(False)
You can find the command being called on a default key-binding in the default key bingings file. This file is opened using the menu:
Preferences > Key Bindings - Default
Inside this file you must find the entry corresponding to the keys you are looking for, in this case f4 key is mapped to next_result command as you can see in the key binding:
{ "keys": ["f4"], "command": "next_result" }

Sublime Text 2 vintage key mapping like vim

i am working with Sublime Text2 in vintage mode. I disabled the arrow keys, so i don't use them to move the cursor in insert mode. Now is was wondering, if it is possible, to map the up/down keys, so that they will move a line of code up and down. In vim it is easy possible by just mapping the keys to do a sequence like "dd k P" to delete the line move cursor up and past it above.
The syntax for the key mapping in Sublime still is quite complicated to me as a beginner.
Thanks
Insert the following into your user key bindings.
[
{ "keys": ["up"], "command": "swap_line_up" },
{ "keys": ["down"], "command": "swap_line_down" }
]
The key mapping file is just JSON. There are 4 keys.
keysis a list of key entries. An entry will generally be something like ["<modifier> + <character>"]. You can define multi level keybindings by creating additional entries in the array. An example of this is to show and hide the side bar. The entry for this is ["ctrl+k", "ctrl+b"]. The available keys are described here.
command is a string specifying the command to run. To see what command is running with a particular action, you can enter sublime.log_commands(True) in the ST console.
args are the arguments passed to the command. This is a dictionary object. The keys for this correspond to the parameter name for a given command.
context is a list of dictionary entries to conditionally execute a given command. These can be somewhat complicated. There is a reference for context here.
I think the best way to familiarize yourself with the key bindings is to just try things out. I used the default keys as a reference.
You might want to keep this as a reference.
You can run a series of commands by creating macros. These are just lists of commands and arguments and are further described here.

Resources