Helix Editor Cheatsheet
Helix Editor Cheatsheet
- Delete a Word: Useful when you need to remove a word quickly.
- Delete a Character: Efficient for removing individual characters.
;reduces the selection to a single char.)
- Change a Word: Ideal for substituting one word for another.
wc(includes the whitespace after the word)
- Copy a Line: Handy for duplicating lines.
- Replace All Occurrences: Useful for global text replacements within the entire buffer.
- Go to Last Line: Useful to quickly navigate to the end of the file.
- Go to Line Start: Handy for moving to the beginning of a line.
- Go to First Non-blank Character: Ideal for skipping leading whitespace.
- Go to Line End: Useful to quickly navigate to the end of a line.
Deleting to Line End:
- Delete to Line End: Useful for quickly deleting text from the cursor to the end of the line.
Jump to Matching Bracket:
- Jump to Matching Bracket: Helpful in code navigation, especially in nested block structures.
- Auto Complete: Assists in completing words or phrases.
- Comment Lines: Essential for quickly commenting out code lines.
Search for Word Under Cursor:
- Search for Word: Enables quick search for other occurrences of the word under the cursor.
A-o*n(with LSP) or
Block Selection (Multiple Cursors):
- Block Selection: Facilitates editing at multiple positions simultaneously.
Cto add new cursors on the line below, and standard movements for horizontal selection.
Search and Replace in Current Selection:
- Search and Replace: Useful for batch replacements within a specified region of text.
Select Whole File:
- Select Whole File: Handy for operations affecting the entire file.
Reload File from Disk:
- Reload File: Helpful when the file has been modified outside of Helix and you want to load the latest version.
:reload-all<ret>to reload all the buffers)
Run Shell Command:
- Run Shell Command: Allows for executing shell commands without leaving the editor.
Setting a Bookmark (Jumplist):
- Setting a Bookmark: Useful for marking important positions in the text for easy return later.
C-s: Save a location in the jumplist, then use
<space>-jto open the jumplist picker,
C-oto go back in the jumplist, and
C-ito go forward.
Additional Selection Commands:
- Select Current Line: Handy for quickly selecting the entire current line.
- Select Inside Characters: Useful for selecting text within surrounding characters.
- Select Around Characters: Useful for selecting text and surrounding characters.
Other Useful Commands:
- Open File: Useful for quickly opening files without leaving the editor.
- Save File: Handy for saving changes.
- Save and Quit: Useful for saving changes and exiting the editor in one command.
- Quit Without Saving: Ideal for exiting without saving changes.
- Join Lines: Useful for merging multiple lines into a single line.
- Split Lines: Handy for splitting a long line into multiple lines.
Helix Editor Cheatsheet - Page 2
- Move Line Up: Handy for rearranging lines of code or text.
- Move Line Down: Useful for moving lines down in your file.
- Increase Indent: Ideal for adhering to coding style guidelines.
- Decrease Indent: Useful for dedenting lines of code.
Undo and Redo:
- Undo: Essential for reverting unwanted changes.
- Redo: Handy for reapplying changes after an undo.
Finding and Replacing:
- Find Next: Useful for iterative searching in your document.
- Find Previous: Handy for searching backwards in your document.
- Replace All Instances in File: Efficient for global text substitution.
:replace <old> <new>
- Go to File Beginning: Quick navigation to the start of the file.
- Go to File End: Quick navigation to the end of the file.
- Go to Specific Line Number: Efficient navigation to a particular line.
- Open New Buffer: Useful for working on multiple files.
- Switch Buffer: Efficient for navigating between open buffers.
- List Buffers: Handy for viewing all open buffers.
- Split Window Horizontally: Useful for viewing files side-by-side.
- Split Window Vertically: Ideal for viewing files above and below each other.
- Fold Code: Essential for hiding blocks of code to improve readability.
- Unfold Code: Useful for expanding folded sections of code.
- Toggle Fold: Handy for quickly toggling the folded state of code blocks.
Themes and Appearance:
- Set Theme: Personalize the appearance of the editor.
- Set Font Size: Customize the font size for better readability.
Help and Documentation:
- Access Helix Help: Essential for learning more about Helix commands and features.
- View Command Documentation: Ideal for understanding specific commands.
Helix Editor Cheatsheet - Page 3 (Advanced)
Macro Recording and Playback:
- Start Macro Recording: Useful for automating repetitive tasks.
ais the register to store the macro)
- Stop Macro Recording: Stop recording actions.
- Play Macro: Execute recorded actions.
ais the register the macro is stored in)
- Expand Selection to Syntax Node: Useful for language-aware selection expansion.
- Shrink Selection to Syntax Node: Handy for narrowing down the selection.
- Search using Regex: Powerful search using regular expression patterns.
- Global Search and Replace using Regex: Efficient for complex text substitutions across the file.
- Define Custom Command: Tailor Helix to your workflow by creating custom commands.
:command name command_definition
- Execute Custom Command: Run your custom command.
External Command Interaction:
- Pipe Selection to External Command: Process text with external shell commands.
- Read Output of External Command into Buffer: Insert output of an external command.
Language Server Protocol (LSP) Integration:
- Start LSP Server: Enhance coding with language-specific features.
- Stop LSP Server: Stop the LSP server when done.
- Show LSP Server Status: View the status and capabilities of the connected LSP server.
- Open Configuration File: Customize Helix's behavior by modifying the configuration file.
- Reload Configuration: Apply changes made to the configuration file.
- Toggle Debug Mode: Useful for troubleshooting issues within Helix.
- View Log File: Access logs for deeper insight into Helix's operation.
- Install Plugin: Extend Helix's functionality with plugins.
- Update Plugin: Keep plugins up to date.
- Remove Plugin: Remove unwanted plugins.