I recently upgraded the version, there is a need to transplant function, but this feature I do not know because it is installed what plug-in? So now need to manually add, I know you can use shortcut keys binding, but my shortcut keys are occupied, and if you continue to set up but it is not convenient to use.
{ "keys": ["ctrl+*+*"], "command": "save_all" }
demo
needs improvement
Find the Default.sublime-package file,
rename Default.sublime-package to a zip file and unzip.
There we find the file Tab Context.sublime-menu and Context.sublime-menu
Add {"command": "save_all", "caption": "Save All"},
The effect is as follows:
Tab Context
Context
Related
I would like to be able to map a keyboard shortcut to be able to open the settings and open the keybindings.
I would like it to behave the exact same as going to Menu > Preference > Settings \ Keybindings.
Is this possible?
If a command appears in a Menu or in the command palette, then it's possible to bind it to a key provided you can determine what the command is and what arguments it takes.
One way to determine that for a menu item is to use View Package File from the command palette and then open the appropriate menu resource. The main menu always comes from a Main.sublime-menu resource, so once you enter the command you can enter Main.sublime-menu in order to see all of the resources that match, then pick the one for the appropriate package.
For a command that appears in the command palette you can do the same by entering sublime-commands to see all of the files that are contributing commands to the command palette and then select the appropriate one to see what command it's executing.
For determining the command bound to a key (in case you want to go the other way and add it to a menu or the command palette) you would look for sublime-keymap files instead.
These options require you to either know the package that is contributing the command or be able to infer it based on what it does. The Default package is what contains the default Sublime behaviour; other files augment the files from that package.
Another method is to open the Sublime console with Ctrl+` or the menu item View > Show Console and then enter the command sublime.log_commands(True) to turn on command logging.
With that enabled you can take the action you want to know the command for and the console will tell you the command being executed and what arguments it's taking.
In your particular case, the output in the console would be:
command: edit_settings {"base_file": "${packages}/Default/Default ($platform).sublime-keymap", "default": "[\n\t$0\n]\n"}
command: new_window
The first of these is the appropriate command, and the second is that command executing a command of it's own to open a new window for the settings to be stored in.
Armed with that, you can make an appropriate key binding:
{
"keys": ["ctrl+alt+shift+k"],
"command": "edit_settings",
"args": {
"base_file": "${packages}/Default/Default ($platform).sublime-keymap",
"default": "[\n\t$0\n]\n"
}
},
Note that recent (as of the time of this answer) builds of Sublime have a bug in which commands executed from the command palette don't always get logged, in which case if that's how you want to determine the correct command you would have to look in the resource directly.
To add a more simple approach to OdatNurd's fantastic answer: I recently found myself wanting a shortcut to open my keybindings file and came across a slightly longer route using the Command Pallet that I was content with.
This doesn't answer the specific issue of creating a keyboard shortcut to open the user's .sublime-keymap file, but it does solve the general issue of getting to that file in a timely manner, without having to use the mouse.
The approach is:
Ctrl+Alt+P (Open Command Pallet)
Type: "keybind"
This gives:
Hit Enter and the user's .sublime-keymap file will be opened as it would be if you navigated to Menu > Preferences > Key Bindings.
I am trying to use the package "Alternate VIM Navigation" in ST3 on Linux Ubuntu, but the alt+i and alt+h keybindings bring up the find and help menus rather than their movement keybindings:
{ "keys": ["alt+i"], "command": "move", "args": {"by": "lines", "forward": false}},
{ "keys": ["alt+h"], "command": "move_to", "args": {"to": "bol", "forward": true}},
I have been able to disable the alt key from displaying the application menubar using CompizConfig Settings Manager, but the alt+i still brings up the find menu (and likewise for alt+h).
I have looked in many places for an answer to this, but have found nothing that works for ST3 in Linux. Here are some related answers for OSX and Windows, and an answer in Ubuntu that suggests the CompizConfig Settings Manager:
https://askubuntu.com/questions/553687/change-or-disable-modifier-key-alt-which-activates-the-application-menubar
Change behavior of Alt key in Sublime Text 2
Stop Alt key bringing up the menu in Sublime Text 2
Any solution to this in ST3 for Linux would be much appreciated!
This worked for me:
Open Sublime's packages directory by going to Preferences > Browse Packages.
Open the User directory and create a file called Main.sublime-menu
Paste the following in:
[
{
"caption": "Help",
"mnemonic": "",
"id": "help"
}
]
Save the file and enjoy!
I found a bit of a strange workaround...
I have a sublime text package called "SubRed" which has a file "Main.sublime-menu" (it's in .config/sublime-text-3/Packages/SubRed - I manually installed the package).
To disable the menubar all I have to do is:
ctrl+shift+p view: toggle menu (which does not disable the menu by
itself for some reason),
open the Main.sublime-menu file in sublime,
save it.
Then voila, the menu bar is gone and I can finally use my Alternate Vim package key bindings without conflicting with the alt+[menubar mnemonic].
To get the menu bar back if needed, just simply do ctrl+shift+p view: toggle menu.
If anyone could suggest a better solution based on this (which doesn't involve a random 3rd party package) that would be much appreciated!
The ideal solution would be to not have to disable the menubar, but get it to work like windows where user or package defined st3 keybindings take precedence over default or system bindings. So if "alt+i" is defined by the package as "move up a line", then it no longer opens the "Find" menu, but actually (eureka!) moves up a line! But opening the "Find" menu is still possible with "alt, i" in sequence.
I edited a file in Sublime without saving it. Now I want to reload the saved version with discarding my changes. How is that possible? Do I really have to close the tab without saving and open it again manually or is there some hotkey to replace the shown version by the saved one?
In Sublime 3: File -> Revert File
You can also bind a hotkey in Preferences -> Key Bindings - User
{
"keys": ["f10"],
"command": "revert"
}
Is there any shortcut to delete the currently opened file in Sublime 3?
I have installed the SideBarEnhancements, but it is a lot of work to right click on a file, select delete, confirm the popup and then again close the file and the popup, because the file has been deleted and I have some unsaved changes.
The functions name to delete the selected file from the sidebar is named "side_bar_delete", so if you have SideBarEnhancements installed you can use this function. So my version for example is:
[
{"keys": ["super+alt+backspace"], "command": "side_bar_delete"}
]
Paste it in the general user.sublime-keymap file.
This plugin will delete the file and close the buffer, and you could bind the command to a key.
Note however there's a potential conflict with the SideBarEnhancements delete command, see the workaround described in the readme.
What is the shortcut for deleting the current line where the cursor positioned.
ex: eclipse have crtl+d
To delete line(s)
Mac: Command+Shift+D
Windows: Ctrl+Shift+D
https://helpx.adobe.com/dreamweaver/using/keyboard-shortcuts.html
There are no direct shortcuts as far as I know but here is a list of commands for dreamweaver.
http://cpaoffers.com/design/dw-shortcuts.php
My typical method to do this is to hit the home > shift+end > del.
Or you could try shift+up or shift+down to select the line above or below and then hit delete.
Danilo Celic's answer helped me with CS6, just use the second one. Although it's in Japanese, just install and use it.
If you want to know more: Then, find the installed files in your own
C:\Users\[your user name]\AppData\Roaming\Adobe\Dreamweaver CS6\[your CS6 language]\Configuration\Commands
There you can open the just-installed files and check them. The comments are in Japanese. The code are in Javascript and are easy to read.
There are 5 commands in that file. To use only the "Delete line" function: In CS6, open history panel, go to design mode, do any action like press a key, right click on that action from history panel and record that action. Then you can find the record action in the Commands folder mentioned above, and then you can copy the javascript from the downloaded one into your own recorded action file.
I've seen two extensions that add the delete line functionality:
http://xtnd.us/dreamweaver/codeextras
http://yoropan.com/en/archives/544
I haven't used either one. I've been told that the first one may not work in Dreamweaver CS6, no idea about the other one. once installed, you should be able to add a keyboard shortcut (Edit -> Preferences, Dreamweaver -> Preferences on Mac) for functionality that you're looking for.
You can add a custom keyboard shortcut for deleting lines in Dreamweaver.
Dreamweaver uses Brackets for its text editor, and this is what handles the Delete Line command, not the traditional Menu system for rebinding most other Dreamweaver commands.
Create a Brackets keyboard shortcut configuration file.
Windows: %APPDATA%\Adobe\Dreamweaver CC 2019\en_US\Configuration\Brackets\keymap.json
Mac OS: ~/Library/Application Support/Adobe Dreamweaver CC 2019/en_US/Configuration/Brackets/keymap.json (untested)
Create an override in this file, according to the Brackets User Key Bindings JSON Data Format. Make sure you use the - separator between key names, not +.
{
"overrides": {
"Ctrl-E": "edit.deletelines"
}
}
Rebind any conflicting keyboard shortcuts in Dreamweaver. In my Ctrl+E example above, it collides with Quick Edit.
In Dreamweaver, go to Edit → Keyboard Shortcuts.
Make a new Set if you're using the default Dreamweaver Standard Set.
Find the command you want to change. Quick Edit is in the Code Editing section.
Highlight the shortcut you want to modify.
If you want to unbind that shortcut, click the - button.
Otherwise, rebind that shortcut by typing the new shortcut in the Press Key field, and then clicking Change.
Click OK to save your changes.
If your change is not persisted, you can usually fix this by editing the following files.
%APPDATA%\Adobe\Dreamweaver CC 2019\en_US\Configuration\Menus\Custom Sets\*.xml
%APPDATA%\Adobe\Dreamweaver CC 2019\en_US\Configuration\Menus\menus.xml
Restart Dreamweaver for your new Brackets keyboard shortcuts to be read.
To bind other commands besides Delete Line, see the full Brackets Shortcuts command ID column.
I used these steps with Adobe Dreamweaver 2019 (19.2) on Windows.