Sublime text 3 показать меню

Среди веб-разработчиков большой популярностью пользуются такие редакторы как Atom и Sublime Text. Статья будет полезна новичкам, тем кто только начинает пользоваться текстовым редактором Sublime.

При настройке Sublime, показывая или скрывая сайдбар, минимап, консоль и другие элементы интерфейса, иногда пользователи случайно нажимают на «Hide menu».


После этого верхнее меню скрывается и непонятно, как его снова открыть?


Как оказывается делается это очень просто — для этого нужно использовать сочетание клавиш Ctrl+Shift+P. В результате откроет строка ввода.


В неё вводим «menu» и в выпадающем списке выбираем «View: Toggle Menu», что переводится как переключить меню.

После этого строка верхнего меню снова отобразится.

Есть ещё более простой способ как показать навигационное меню в Sublime Text. Для этого нажимаем клавишу Alt, после чего на время до момента следующего клика мышью появляется меню. В нём выбираем пункт «View» («Вид»), а выпадающем подменю «Show Menu» («Показать меню»).

Вот такие два простых способа управления отображением меню в Саблайм Текст.

В чем преимущество этого редактора по сравнению с другими аналогичными? Есть ли смысл на него переходить?

Если ваш редактор вас устраивает, то нет смысла переходить. А если возникают задачи, с которыми ваш редактор не справляется, тогда стоит задуматься. В целом можно отметить несколько преимуществ:
1. Высокая производительность.
2. Наличие плагинов на все случаи жизни. На каком бы языке вы не писали, скорее всего для него есть плагин с подсветкой синтаксиса, сниппетами и т.д. Если нет, то можно написать такой плагин самому на Python. Есть даже такие плагины, которые превращают редактор почти в полноценный IDE.
3. Пользовательские настройки. Большое количество настроек, которые помогут подстроить редактор под свои нужды. Например, настройка типа и размера отступа (табы или пробелы и их количество), удаление пробелов и табуляций в конце строк, отображение пробельных символов и многое другое. Причём все эти настройки легко сохраняются в отдельный файл-конфиг, который можно легко перенести на другое рабочее место.

Читайте также:  Acer aspire 5733 pew71 драйвера

Если по каким-то причинам у вас «пропало» меню, то его можно вернуть по следующему алгоритму:

  1. Используйте сочетание клавиш «Ctrl» + «Shift» + «P».
  2. В отобразившейся консоли наберите «menu» и выберите пункт «View: Toggle Menu» .

Menus in Sublime Text are defined by files ending in .sublime-menu . Menus use JSON, with the top-level structure being an array. Each binding is a JSON object containing information to define the text of the menu entry and what action it should perform.

Example

The following is an example of the format of a .sublime-menu file.

Entries

Each menu entry is a JSON object with one or more keys. The list of supported keys includes:

"caption" The text of the menu entry "mnemonic" The character to use as the key to press to activate the entry. Only applies to Windows and Linux. Must match the case of the character in the "caption" . "command" A string of the command to execute when the entry is activated "args" A JSON object of args to send to the command "children" A JSON array of entries to create a submenu from "id" A unique string for the menu entry. Used for menu entries with "children" to allow adding additional child entries. "platform" One of the strings: "OSX" , "!OSX" , "Windows" , "!Windows" , "Linux" or "!Linux" . Controls what platforms the entry is shown on.

Each menu entry requires at minimum, the key "caption" for a non-functionality entry, or "command" for an entry that performs an action.

Available Menus

Sublime Text has seven menus that may be customized:

Main.sublime-menu Primary menu for the application Side Bar Mount Point.sublime-menu Context menu for top-level folders in the side bar Side Bar.sublime-menu

Читайте также:  Fifa 19 uefa champions league

Context menu for files and folders in the side bar. Has "magic" args for passing file and folder names to commands.

Entries with an arg "files": [] will be enabled for files and will pass file names to the command via the arg files . Entries with an arg "dirs": [] will be enabled for folders and will pass file names to the command via the arg dirs . Entries with an arg "paths": [] will be enabled for files and folders and will pass file and folder names to the command via the arg paths .

Tab Context.sublime-menu Context menu for file tabs Context.sublime-menu Context menu for text areas Find in Files.sublime-menu Menu shown when clicking the . button in Find in Files panel Widget Context.sublime-menu Context menu for text inputs in various panels. Technically this file name can be changed via the "context_menu" setting ins >Widget.sublime-settings .

Adding to Submenus

Using the "id" key of an entry, it is possible to add entries to submenus. When adding submenu entries, specify only the "id" and "children" keys of the parent entry, and set the value of "children" to an array of entries to append to the submenu.

For example, to add a new layout to the View Layout menu, create an entry such as:

To find the "id" of entries in the Main.sublime-menu , use the View Package File command from the command palette and select Default/Main.sublime-menu .

Customization

Users can customize the available menus by creating an appropriately-named file in their Packages/User/ directory.

Rate this post

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *