欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

如何在Sublime Text中将选择内容转换为小写或大写

程序员文章站 2022-05-28 13:24:33
...

本文翻译自:How to convert a selection to lowercase or uppercase in Sublime Text

I have several strings selected in a file in Sublime Text and I want to convert them all to lowercase. 我在Sublime Text的文件中选择了几个字符串,我想将它们全部转换为小写。

How can I convert them all to lowercase in Sublime Text? 如何在Sublime Text中将它们全部转换为小写?


#1楼

参考:https://stackoom.com/question/1Glwc/如何在Sublime-Text中将选择内容转换为小写或大写


#2楼

From the Sublime Text docs for Windows/Linux: 从Windows / Linux的Sublime Text文档中:

Keypress            Command
Ctrl + K, Ctrl + U  Transform to Uppercase
Ctrl + K, Ctrl + L  Transform to Lowercase

and for Mac : 对于Mac

Keypress    Command
cmd + KU    Transform to Uppercase
cmd + KL    Transform to Lowercase

Also note that Ctrl + Shift + p in Windows ( + Shift + p in a Mac) brings up the Command Palette where you can search for these and other commands. 还要注意,在Windows中为Ctrl + Shift + p (在Mac中为 + Shift + p )会弹出命令面板 ,您可以在其中搜索这些命令和其他命令。 It looks like this: 看起来像这样:

如何在Sublime Text中将选择内容转换为小写或大写


#3楼

As a bonus for setting up a Title Case shortcut key Ctrl + kt (while holding Ctrl , press k and t ), go to Preferences --> Keybindings-User 作为设置标题案例快捷键Ctrl + kt (按住Ctrl的同时按kt )的一项奖励,转到Preferences -> Keybindings-User

If you have a blank file open and close with the square brackets: 如果您有一个空白文件,请用方括号打开和关闭:

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

Otherwise if you already have stuff in there, just make sure if it comes after another command to prepend a comma "," and add: 否则,如果您已经有东西了,只需确保它是否在另一个命令后面加上逗号“,”并添加:

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

#4楼

For Windows: 对于Windows:

  • Ctrl + K Ctrl + U for UPPERCASE. Ctrl + K Ctrl + U表示大写。
  • Ctrl + K Ctrl + L for lowercase. Ctrl + K Ctrl + L小写。

Method 1: 方法1:

  1. Press Ctrl and hold. 按住Ctrl键
  2. Now press K , release K while holding Ctrl . 现在按K ,在按住Ctrl的同时释放K。 Do not release the Ctrl key. 不要释放Ctrl键。
  3. Now press U or L with Ctrl still pressed, then release all keys. 现在,在按住Ctrl的同时UL ,然后释放所有键。

Or 要么

Method 2: 方法2:

  1. Press Ctrl and hold. 按住Ctrl键
  2. Now press K . 现在按K。
  3. Without releasing Ctrl and K , immediately press U (or L ) and release all keys. 在不释放CtrlK的情况下 ,立即按U (或L )并释放所有键。

Please note: If you press and hold Ctrl + K for more than two seconds it will start deleting text so try to be quick with it. 请注意:如果按住Ctrl + K两秒钟以上,它将开始删除文本,因此请尝试快速处理。

I use the above shortcuts, and they work on my Windows system. 我使用上面的快捷方式,它们可以在我的Windows系统上使用。


#5楼

For others needing a key binding: 对于其他需要键绑定的用户:

{ "keys": ["ctrl+="], "command": "upper_case" },
{ "keys": ["ctrl+-"], "command": "lower_case" }

#6楼

For Windows OS 对于Windows操作系统

For Uppercase CTRL + K + U 对于大写CTRL + K + U

For Lowercase CTRL + K + L 对于小写CTRL + K + L

相关标签: sublimetext