탭을 보이게 했을 경우, 탭 색상 변경
<key>foreground</key> <string>#E8E0CE40</string>
맥에서는 키 설정이 추가로 필요하다.
[ { "keys": ["home"], "command": "move_to", "args": {"to": "bol"} }, { "keys": ["end"], "command": "move_to", "args": {"to": "eol"} }, { "keys": ["shift+end"], "command": "move_to", "args": {"to": "eol", "extend": true} }, { "keys": ["shift+home"], "command": "move_to", "args": {"to": "bol", "extend": true } }, { "keys": ["ctrl+home"], "command": "move_to", "args": {"to": "bof"} }, { "keys": ["ctrl+end"], "command": "move_to", "args": {"to": "eof"} }, { "keys": ["ctrl+shift+home"], "command": "move_to", "args": {"to": "bof", "extend": true} }, { "keys": ["ctrl+shift+end"], "command": "move_to", "arg s": {"to": "eof", "extend": true} } ]
Ctrl+Delete 누르면 공백기호만 삭제하는 기능.
유저 키맵에 아래 내용 추가
// // These key bindings override the ST 'delete_word' keys but use whatever keys you want. // You could use `super+delete` and `super+backspace` and keep ST's delete keys intact. // { "keys": ["ctrl+delete"], "command": "delete_to_whitespace", "args": {"forwards": true} }, { "keys": ["ctrl+backspace"], "command": "delete_to_whitespace", "args": {"forwards": false} },
아래 파일을 …/sublime-text-3/Packages/User/DeleteToWhitespace.py
로 저장
# # Name: Delete To Whitespace # Requires: Plugin for Sublime Text v3 # Author: mattst - https://github.com/mattst # Command: delete_to_whitespace # Args: forwards: bool (delete backwards if false) # License: MIT License # See Also: https://stackoverflow.com/a/66870369/2102457 # import sublime, sublime_plugin, re class DeleteToWhitespaceCommand(sublime_plugin.TextCommand): """ A Sublime Text plugin that deletes text from the cursor to the next or previous group of characters, the grouping being defined as either whitespace or non-whitespace characters. Thus if run several times in succession it will alternate between deleting groups of whitespace and non-whitespace ahead or behind the cursor. The forwards parameter of the run() method (i.e. the command's arg) controls the deletion direction. """ def run(self, edit, forwards=True): self.edit = edit self.forwards = forwards if forwards: self.delete_forwards() else: self.delete_backwards() def delete_forwards(self): whitespace_regex = "^\s+" non_whitespace_regex = "^\S+" for sel in self.view.sel(): if sel.size() > 0: self.view.erase(self.edit, sel) continue # ∴ sel.a == sel.b == sel.begin() == sel.end() # view.full_line() includes the trailing newline (if any). cursor = sel.a line = self.view.full_line(cursor) cursor_to_eol = sublime.Region(cursor, line.end()) cursor_to_eol_str = self.view.substr(cursor_to_eol) match = re.search(whitespace_regex, cursor_to_eol_str) if match: self.erase_matching_characters(cursor, match) continue match = re.search(non_whitespace_regex, cursor_to_eol_str) if match: self.erase_matching_characters(cursor, match) continue def delete_backwards(self): whitespace_regex = "\s+$" non_whitespace_regex = "\S+$" for sel in self.view.sel(): if sel.size() > 0: self.view.erase(self.edit, sel) continue # ∴ sel.a == sel.b == sel.begin() == sel.end() # view.line() excludes the trailing newline (if any). cursor = sel.a line = self.view.line(cursor) cursor_to_bol = sublime.Region(cursor, line.begin()) cursor_to_bol_str = self.view.substr(cursor_to_bol) # Delete the new line of the 'previous' line. if cursor_to_bol.size() == 0 and cursor > 0: erase_region = sublime.Region(cursor, cursor - 1) self.view.erase(self.edit, erase_region) continue match = re.search(whitespace_regex, cursor_to_bol_str) if match: self.erase_matching_characters(cursor, match) continue match = re.search(non_whitespace_regex, cursor_to_bol_str) if match: self.erase_matching_characters(cursor, match) continue def erase_matching_characters(self, cursor, match): match_len = match.end() - match.start() if self.forwards: erase_region = sublime.Region(cursor, cursor + match_len) else: erase_region = sublime.Region(cursor, cursor - match_len) self.view.erase(self.edit, erase_region)
@echo off SET st2Path=C:\App\sublime3\sublime_text.exe rem ** add it for all file types @reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f @reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f @reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f rem ** add it for folders rem ** @reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f rem ** @reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f rem ** @reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f pause