Sublime Text - command to make first character uppercase

雨燕双飞 提交于 2019-12-30 08:02:39

问题


There are upper_case and lower_case commands:

{ "keys": ["ctrl+k", "ctrl+u"], "command": "upper_case" },
{ "keys": ["ctrl+k", "ctrl+l"], "command": "lower_case" },

I'm searching for command to capitalize the first letter of string, which can be assigned to custom shortcut.


回答1:


Under Edit -> Convert Case is the Title Case option. The following key binding should work:

{ "keys": ["ctrl+k", "ctrl+t"], "command": "title_case" }

Add this to your custom keymap, and it will override the default command for CtrlK,CtrlT - fold_tag_attributes. Alternatively, you can use

{ "keys": ["ctrl+k", "ctrl+i"], "command": "title_case" }

which is not assigned to anything in the default Sublime keymap.

If you're interested in other types of conversions, check out the Case Conversion plugin on Package Control. It installs commands for snake_case, camelCase, PascalCase, dot.case, and dash-case, along with a few other utilities, such as a function to separate words with slashes.



来源:https://stackoverflow.com/questions/29080410/sublime-text-command-to-make-first-character-uppercase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!