LinuxCommandLibrary

helix

Edit text with a modal editor

TLDR

Open a file

$ helix [path/to/file]
copy

Open files and show them one next each other
$ helix --vsplit [path/to/file1 path/to/file2]
copy

Show the tutorial to learn Helix (or access it within Helix by pressing and typing <:>tutor)
$ helix --tutor
copy

Change the Helix theme
$ <:>theme [theme_name]
copy

Save and Quit
$ <:>wq<Enter>
copy

Force-quit without saving
$ <:>q!<Enter>
copy

Undo the last operation
$ <u>
copy

Search for a pattern in the file (press / to go to next/previous match)
$ </>[search_pattern]<Enter>
copy

SYNOPSIS

hx [OPTIONS] [FILES...]
hx --tutor
hx --health

PARAMETERS

-h, --help
    Display help information for the command.

-v, --version
    Print the version of helix.

-c , --config
    Specify an alternative configuration file path.

-s , --session
    Specify a session file to load or save to.

-g

, --grammar
    Specify an additional directory for Tree-sitter grammars.

-t, --tutor
    Start the built-in interactive tutorial to learn basic commands.

--health
    Run a health check to diagnose LSP and Tree-sitter configurations.

--diff
    Open files in diff mode to compare them side-by-side.

--merge
    Open files in merge mode to resolve conflicts.

--log
    Specify a file to write debug logs to.

--log-level
    Set the verbosity level for logging (e.g., info, debug, trace).

--read-only
    Open files in read-only mode, preventing accidental modifications.

--no-auto-indent
    Disable automatic indentation.

DESCRIPTION

helix is a modern, modal terminal-based text editor, designed for efficiency and an enhanced coding experience. Inspired by editors like Neovim and Kakoune, it adopts a "select first, then operate" paradigm, which contrasts with traditional "operate first, then select" editors. Key features include built-in support for Language Server Protocol (LSP) for intelligent code completion, diagnostics, and navigation, and Tree-sitter for robust syntax highlighting and structural editing.

helix aims for a zero-configuration experience for common programming languages, leveraging its deep LSP and Tree-sitter integration. It supports multiple selections natively, allowing powerful, simultaneous edits across different parts of a file. Its modal editing approach means different keyboard commands are active depending on the current mode (e.g., normal, insert, select), which can lead to very fast text manipulation once mastered. It's an excellent choice for developers seeking an IDE-like experience directly within their terminal.

CAVEATS

helix is a terminal-based editor and requires a compatible terminal emulator (e.g., Alacritty, Kitty, WezTerm) for optimal display and keybinding support. Its modal editing paradigm has a learning curve for users accustomed to traditional text editors, though the built-in tutorial helps mitigate this. It is still under active development, so features and behavior may evolve. Unlike traditional Unix utilities, it's not typically pre-installed on most Linux distributions and needs to be installed separately.

MODES OF OPERATION

helix operates in different modes: Normal for navigation and command execution; Insert for typing text; Select for selecting text and applying commands to the selection; and Goto, Match, Search, Picker modes for specific actions. Understanding these modes is fundamental to efficient use.

CONFIGURATION AND CUSTOMIZATION

While helix aims for zero-config, it is highly customizable through a TOML configuration file (typically ~/.config/helix/config.toml). Users can adjust keybindings, theme colors, editor behavior, and LSP settings to suit their preferences.

HISTORY

helix emerged in late 2020 as a fresh take on terminal text editing, aiming to combine the efficiency of modal editors like Vim with modern features like Language Server Protocol (LSP) and Tree-sitter integration directly into its core, rather than relying on plugins. Its development prioritizes a 'zero-config' approach for common development tasks, reducing the setup burden often associated with highly customizable editors. It quickly gained traction among developers looking for a fast, feature-rich, and easy-to-configure terminal editor, evolving into a robust alternative to established editors.

SEE ALSO

vim(1), nvim(1), kak(1), emacs(1)

Copied to clipboard