Sublime Text's column selection mode quickly selects rectangular areas through keyboard and mouse combinations to enable multiple rows to be edited simultaneously. The specific methods are: 1. Press Alt to drag on Windows/Linux, and drag on macOS; 2. Use Shift Alt (Windows/Linux) or Shift Option (macOS) to add mouse clicks; 3. Keyboard shortcut Ctrl Alt up/down arrow (Windows/Linux) or Cmd Option up/down arrow (macOS) to add vertical cursor to simulate column selection effect. After entering this mode, the input, deletion, copy and paste operations are all applied to all selected columns, which are suitable for batch editing and changing volumes, adding comment prefixes, etc., greatly improving editing efficiency.
Sublime Text's Column Selection Mode is a very practical feature, especially when you need to edit a column of multiple lines of text at the same time. It does not select content by character or line like a normal choice, but selects an area like "swipe vertically". Mastering this technique can greatly improve your editing efficiency.
How to enter column selection mode?
The most common way to enter column selection mode is to use a combination of mouse and keyboard:
- Windows/Linux : Hold down the
Alt
key, then drag with the left mouse button to select a rectangular area. - macOS : Hold down the
Option
key and drag with the mouse.
You can also use keyboard operations to achieve column selection:
- Press
Shift Alt 鼠標(biāo)點擊
(Windows/Linux) orShift Option 鼠標(biāo)點擊
(macOS) to accurately frame a rectangular area from the start point to the end point.
This method is suitable for scenarios such as aligning and modifying multiple variables in the code, adding comment prefixes, or quickly deleting a piece of content.
Editing skills after column selection
Once you enter the column selection mode and select the target area, the next operation is very direct:
- Enter text : When entering any character, all selected column positions will be inserted synchronously into the content you typed.
- Delete content : Press
Delete
orBackspace
to clear all characters in the selected column at once. - Copy and paste : You can copy the selected column content and paste it elsewhere, and the format will also remain consistent.
For example, if you have several lines of code as follows:
var name = 'Tom'; var age = 25; var city = 'New York';
If you want to add a //
in front of each row and become a comment, you can use the column selection to make a small selection at the beginning of each row, and then enter //
to complete it at once.
Other column selection methods (multi-cursor variant)
In addition to mouse operations, you can also try using shortcut keys for column selection:
- Press
Ctrl Alt 上/下箭頭
(Windows/Linux) orCmd Option 上/下箭頭
(macOS) to add a vertical cursor up/down to the current cursor position to form an effect similar to column selection.
While this is not a column selection mode in the strict sense, the end effect is very similar, for those who prefer pure keyboard operation.
Basically that's it. The column selection mode seems simple, but it is particularly useful when dealing with structured text or where batch modifications are required. Many people don’t notice it at first, but only after using it, they find that they cannot do without it.
The above is the detailed content of How do I use Sublime Text's column selection mode?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Yes, SublimeText is available for free, but users are encouraged to purchase licenses. It offers an indefinite free trial, all features are available, but occasionally a window to remind you to purchase a license will pop up; you can use it individually or at will, but purchasing a license can support development and remove reminders; the license is permanently valid and applicable to all platforms, with a single user license fee of $90, supports multi-user and team authorization, and provides educational and bulk discounts; copy the license key to the software after purchase and activate without an account or online activation.

SublimeText has many practical but easily overlooked features. 1. Multiple selection and quick editing: supports multi-cursor operation, splitting and selecting rows, batch modifying the same words to improve the efficiency of processing duplicate content; 2. Fuzzy search expansion function: can jump function definition, specify line number, and global search symbols to facilitate navigation of large projects; 3. Automatic saving and project recovery: no manual saving, it can automatically recover after crash, retaining the multi-task working state; 4. Custom shortcut keys and plug-in extensions: Install plug-ins and custom shortcut keys through the command panel to significantly improve personalized editing efficiency.

ToconfigurekeybindingsforbuildsystemsinSublimeText,opentheUserkeybindingsfileviaPreferences>KeyBindings,thenedittherightpanewithcustomJSONentries.EachentryisaJSONobjectspecifying"keys","command",andoptionally"args".Fo

SublimeText's best package improves web development efficiency. 1. Emmet quickly generates HTML/CSS code, such as using the abbreviation div.container to automatically generate complete tags, and supports nested and duplicate elements; 2. SideBarEnhancements enhances file management, providing new templates, trash can move, right-click browser opening and other functions; 3. CSScomb automatically organizes the order of CSS attributes, improves readability and maintenance, and supports custom sorting rules; 4. GitGutter displays code change marks, which facilitates quick view of newly added, deleted or modified lines of code; 5. LSP and language plug-ins provide real-time code prompts such as intelligent completion, jump definition, error checking, etc.

To set up SublimeText for Python development, first install PackageControl, then install the plug-in, configure the build system, and enable automatic formatting. 1. Install PackageControl: Install through the console paste commands; 2. Install plug-ins: such as Anaconda, SublimeREPL, PythonFlake8Lint to enhance functions; 3. Configure the build system: Create a custom Python3.sublime-build file and select the corresponding interpreter path; 4. Enable automatic formatting: Use YAPF or Black combined with shortcut keys to achieve code beautification.

To use SublimeText more effectively, you can refer to the following resources: 1. Official documents and built-in help provide accurate information on core functions and configuration options; 2. YouTube channels such as TheNetNinja and TraversyMedia provide video tutorials; 3. Forums and community websites such as SublimeText forums and Reddit provide plug-ins and question answers; 4. Books and in-depth guides such as "MasteringSublimeText" are suitable for reading long articles; 5. Use PackageControl to install plug-ins such as Emmet and GitGutter to improve efficiency. By combining these resources with different learning methods, Sublim can be comprehensively improved

SublimeText's code snippet function can improve coding efficiency through preset templates. The specific steps are: 1. Create a new fragment through Tools>Developer>NewSnippet..., replace the placeholder in the template and save it to the default folder; 2. Use the trigger word and Tab key in the code to quickly insert common structures, such as inputting htmlbase to generate HTML5 basic framework; 3. You can add variables and placeholders to the fragment, such as setting ${1:functionName}, ${2:arguments} and other tags when defining JavaScript function templates to achieve fast customization; 4. User-defined fragments are stored in Packag by default

TosetupbuildsystemsinSublimeText,create.sublime-buildfileswithcustomcommandslinkedtospecificfiletypes.1.Definethecommandtoexecutecodeusingvariableslike"$file".2.Usethe"selector"fieldtoassociatethebuildsystemwithasyntaxsuchas"
