Sublime text 3 ctrl+click to its default behavior - sublimetext2

The default behavior of this shortcut ctrl+click is to create multiple cursors, but in my case, it was behaving like goto_definition command, and then I opened mousemap file I saw that the command is set to goto_definition:
{
"button": "button1",
"count": 1,
"modifiers": ["ctrl"],
"press_command": "drag_select",
"command": "goto_definition"
}
And I don't know how? Can anyone tell me how to change it to as it usually be?

Two things worked for me, first, if completely remove the setting, or second, if I replace the setting by this setting:
{
"button": "button1", "count": 2,
"modifiers": ["ctrl"],
"press_command": "drag_select_callback",
"press_args": {"by": "words"}
}

Related

How do I display my HTML/CSS files on a browser via Visual Studio Code on Mac?

I HAVE looked around to find the solution and some fellows already expressed the command:
{
"version": "0.1.0",
"command": "Chrome",
"osx": {
"command": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
},
"args": [
"${file}"
]
}
after you press Cmd+Shift+p and entering Configure Task Runner
This thing is, I don't see that option, thus preventing me from completing this step. Perhaps I am ignorant as to how to work in this still.
Try specifiying a "taskName": attribute in your build task. i.e.
{
"version": "0.1.0",
"taskName": "MyName",
"command": "Chrome",
"osx": {
"command": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
},
"args": [
"${file}"
]
}
Download this: https://marketplace.visualstudio.com/items?itemName=peakchen90.open-html-in-browser. It is written in an asian language but it is very simple to handle, when your html file is opened, save it, right click and click the asian words. It will open in your default browser.

switching between tabs in sublime "ctrl+tab"

Anyone notice that the default ctrl+tab doesn't work like the typical consecutive tab switching from left to right, e.g., in Chrome? I'm trying to switch to the next adjacent tab, but it seems to jump around (alphabetic order I think).
How can I change the order in which sublime switches tabs?
The default behavior is to goto tab you have used at last. Just add this keybinding to your user keybindings:
{ "keys": ["ctrl+tab"], "command": "next_view" },
{ "keys": ["ctrl+shift+tab"], "command": "prev_view" },
In sublime text 3, there is shortcut to switch tab in similar to ctrl+tab in browser.
{ "keys": ["ctrl+pagedown"], "command": "next_view" },
{ "keys": ["ctrl+pageup"], "command": "prev_view" },
While this ctrl+tab has behavior similar to windows alt+tab to switch apps. CMIIW.
{ "keys": ["ctrl+tab"], "command": "next_view_in_stack" },
{ "keys": ["ctrl+shift+tab"], "command": "prev_view_in_stack" },
You can just make custom key binding and swap them around.
And for anyone looking for shortcut to move tab to left & right, there is a plugin for that.
please try command + shift + ] .This will bring you immediately to the next tab.
Command + Ctrl + P : Switch between the projects that are listed on the sublimeText Sidebar.

In Sublime Text 3, how to have shortcuts for "Build and Run" and "Build only" separately like it was in Sublime Text 2?

In Sublime Text 3,when we press Ctrl+Shift+B, we are given the option to either do "Build and Run" or "only Build", whereas Ctrl+B executes the previously chosen operation among the two. But I want it to be like, it should directly build and run when I press Ctrl+Shift+B and only build when I press Ctrl+B like it was in Sublime Text 2. Can someone help me out?
Addings this to your sublime-keymap should result in the expected behavior:
{ "keys": ["ctrl+b"], "command": "build", "args": { "variant": "" } },
{ "keys": ["ctrl+shift+b"], "command": "build", "args": { "variant": "Run" } },
However you might want to remap keep the list of options to alt+b:
{ "keys": ["alt+b"], "command": "build", "args": { "select": true } },
Not answering the question but good to know, F7 functions the same as Ctrl+b.

Edit the key map for goto definition

According to this question, I added this :
[
{
"button": "button1",
"count": 1,
"modifiers": ["ctrl"],
"press_command": "drag_select",
"command": "goto_definition"
}
]
To a file which a named Default (Windows).sublime-mousemap in %appdata%\Sublime Text 3\Packages\User .And it works just fine. The only issue here is that the mutiselection feature of sublime text not to work, so I thought I could edit this in such to maintain the multiselection (ctrl + alt + click) or (ctrl + shift + click) :
[
{
"button": "button1",
"count": 1,
"modifiers": ["ctrl + alt"],
"press_command": "drag_select",
"command": "goto_definition"
}
]
But it doesn't seem to work. Any help with this would be great. Thanks.
Try setting it to the following:
[
{
"button": "button1",
"count": 1,
"modifiers": ["ctrl", "alt"],
"press_command": "drag_select",
"command": "goto_definition"
}
]
The "modifiers" array needs to have the individual keys as individual values, separated by commas - ["ctrl", "alt"], instead of having them both together concatenated with a plus +. This is one of the differences between keymaps and mousemaps.

Multiple commands with args under 1 hotkey in Sublime Text 3

I'm trying to configure ST3 keybindings to reindent whole text, save file and refresh the browser on ctrl+s. I'm using Chain of Command and Browser Refresh plugins, but the problem is I don't know how to pass commands with arguments, so that the reindent command would affect whole text instead of one line only. "single_line" : false seems to be ignored.
"keys": ["ctrl+3"],
"command": "chain",
"args": {
"commands": [
["reindent",{"context": "window", "args": {"single_line": false}}],
["browser_refresh"]
]
}
I've made it.
"keys": ["ctrl+s"],
"command": "chain",
"args": {
"commands": [
["reindent",{"single_line": false}],
["browser_refresh"]
]
}