From 2244a5d40c83d477839f91cb6d6a4aeb02446a97 Mon Sep 17 00:00:00 2001 From: omentic Date: Wed, 1 May 2024 23:29:52 +0000 Subject: deploy: 12eec890240a05d1e090114f7f4fdd7c1ee8ff88 --- print.html | 599 ++++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 357 insertions(+), 242 deletions(-) (limited to 'print.html') diff --git a/print.html b/print.html index 7747ff66..33a471b8 100644 --- a/print.html +++ b/print.html @@ -204,6 +204,7 @@ For everything else (e.g., how to install supported language servers), see the <
  • macOS
  • Windows @@ -258,14 +259,19 @@ sudo apt update sudo apt install helix

    Fedora/RHEL

    -

    Enable the COPR repository for Helix:

    -
    sudo dnf copr enable varlad/helix
    -sudo dnf install helix
    +
    sudo dnf install helix
     

    Arch Linux extra

    Releases are available in the extra repository:

    sudo pacman -S helix
     
    +
    +

    ๐Ÿ’ก When installed from the extra repository, run Helix with helix instead of hx.

    +

    For example:

    +
    helix --health
    +
    +

    to check health

    +

    Additionally, a helix-git package is available in the AUR, which builds the master branch.

    NixOS

    @@ -299,6 +305,9 @@ Download the official Helix AppImage from the Homebrew Core
    brew install helix
     
    +

    MacPorts

    +
    port install helix
    +

    Windows

    Install on Windows using Winget, Scoop, Chocolatey or MSYS2.

    @@ -328,7 +337,7 @@ Linux and macOS, or %userprofile%\src\ on Windows.

  • A C++14 compatible compiler to build the tree-sitter grammars, for example GCC or Clang
  • If you are using the musl-libc standard library instead of glibc the following environment variable must be set during the build to ensure tree-sitter grammars can be loaded correctly:

    -
    RUSTFLAGS="-C target-feature=-crt-static"
    +
    RUSTFLAGS="-C target-feature=-crt-static"
     
    1. @@ -346,6 +355,9 @@ grammars in the local runtime folder.

    +

    ๐Ÿ’ก If you do not want to fetch or build grammars, set an environment variable HELIX_DISABLE_AUTO_GRAMMAR_BUILD

    +
    +

    ๐Ÿ’ก Tree-sitter grammars can be fetched and compiled if not pre-packaged. Fetch grammars with hx --grammar fetch and compile them with hx --grammar build. This will install them in @@ -354,10 +366,10 @@ the runtime directory within the user's helix config directory (mor

    Configuring Helix's runtime files

    Linux and macOS

    -

    The runtime directory is one below the Helix source, so either set a +

    The runtime directory is one below the Helix source, so either export a HELIX_RUNTIME environment variable to point to that directory and add it to your ~/.bashrc or equivalent:

    -
    HELIX_RUNTIME=~/src/helix/runtime
    +
    export HELIX_RUNTIME=~/src/helix/runtime
     

    Or, create a symbolic link:

    ln -Ts $PWD/runtime ~/.config/helix/runtime
    @@ -367,7 +379,7 @@ your ~/.bashrc or equivalent:

    Either set the HELIX_RUNTIME environment variable to point to the runtime files using the Windows setting (search for Edit environment variables for your account) or use the setx command in Cmd:

    -
    setx HELIX_RUNTIME "%userprofile%\source\repos\helix\runtime"
    +
    setx HELIX_RUNTIME "%userprofile%\source\repos\helix\runtime"
     

    ๐Ÿ’ก %userprofile% resolves to your user directory like @@ -375,8 +387,8 @@ Cmd:

    Or, create a symlink in %appdata%\helix\ that links to the source code directory:

    - - + +
    MethodCommand
    PowerShellNew-Item -ItemType Junction -Target "runtime" -Path "$Env:AppData\helix\runtime"
    Cmdcd %appdata%\helix
    mklink /D runtime "%userprofile%\src\helix\runtime"
    PowerShellNew-Item -ItemType Junction -Target "runtime" -Path "$Env:AppData\helix\runtime"
    Cmdcd %appdata%\helix
    mklink /D runtime "%userprofile%\src\helix\runtime"
    @@ -430,8 +442,8 @@ cp contrib/helix.png ~/.icons # or ~/.local/share/icons

    To use another terminal than the system default, you can modify the .desktop file. For example, to use kitty:

    -
    sed -i "s|Exec=hx %F|Exec=kitty hx %F|g" ~/.local/share/applications/Helix.desktop
    -sed -i "s|Terminal=true|Terminal=false|g" ~/.local/share/applications/Helix.desktop
    +
    sed -i "s|Exec=hx %F|Exec=kitty hx %F|g" ~/.local/share/applications/Helix.desktop
    +sed -i "s|Terminal=true|Terminal=false|g" ~/.local/share/applications/Helix.desktop
     

    Using Helix

    @@ -458,19 +470,19 @@ can be accessed via the command hx --tutor or :tutor.<

    Registers

    In Helix, registers are storage locations for text and other data, such as the result of a search. Registers can be used to cut, copy, and paste text, similar -to the clipboard in other text editors. Usage is similar to Vim, with " being +to the clipboard in other text editors. Usage is similar to Vim, with " being used to select a register.

    User-defined registers

    Helix allows you to create your own named registers for storing text, for example:

      -
    • "ay - Yank the current selection to register a.
    • -
    • "op - Paste the text in register o after the selection.
    • +
    • "ay - Yank the current selection to register a.
    • +
    • "op - Paste the text in register o after the selection.

    If a register is selected before invoking a change or delete command, the selection will be stored in the register and the action will be carried out:

      -
    • "hc - Store the selection in register h and then change it (delete and enter insert mode).
    • -
    • "md - Store the selection in register m and delete it.
    • +
    • "hc - Store the selection in register h and then change it (delete and enter insert mode).
    • +
    • "md - Store the selection in register m and delete it.

    Default registers

    Commands that use registers, like yank (y), use a default register if none is specified. @@ -478,7 +490,7 @@ These registers are used as defaults:

    - +
    Register characterContains
    /Last search
    :Last executed command
    "Last yanked text
    "Last yanked text
    @Last recorded macro
    @@ -489,8 +501,8 @@ These registers are used as defaults:

    #Selection indices (first selection is 1, second is 2, etc.)This register is not writable .Contents of the current selectionsThis register is not writable %Name of the current fileThis register is not writable -*Reads from the system clipboardJoins and yanks to the system clipboard -+Reads from the primary clipboardJoins and yanks to the primary clipboard ++Reads from the system clipboardJoins and yanks to the system clipboard +*Reads from the primary clipboardJoins and yanks to the primary clipboard

    When yanking multiple selections to the clipboard registers, the selections @@ -560,7 +572,7 @@ documentation.

    and requires the corresponding query file to work properly.

    Moving the selection with syntax-aware motions

    -

    Alt-p, Alt-o, Alt-i, and Alt-n (or Alt and arrow keys) allow you to move the +

    Alt-p, Alt-o, Alt-i, and Alt-n (or Alt and arrow keys) allow you to move the selection according to its location in the syntax tree. For example, many languages have the following syntax for function calls:

    func(arg1, arg2, arg3);
    @@ -582,12 +594,12 @@ a more intuitive tree format:

    โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ” โ”‚identifierโ”‚ โ”‚argumentsโ”‚ -โ”‚ "func" โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ” +โ”‚ "func" โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ” โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ” โ”Œโ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ” โ”Œโ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚identifierโ”‚ โ”‚identifierโ”‚ โ”‚identifierโ”‚ - โ”‚ "arg1" โ”‚ โ”‚ "arg2" โ”‚ โ”‚ "arg3" โ”‚ + โ”‚ "arg1" โ”‚ โ”‚ "arg2" โ”‚ โ”‚ "arg3" โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

    If you have a selection that wraps arg1 (see the tree above), and you use @@ -606,7 +618,7 @@ node with no sibling. When using Alt-p with a selection on ar child node will be selected. In the event that arg1 does not have a previous sibling, the selection will move up the syntax tree and select the previous element. As a result, using Alt-p with a selection on arg1 will move the -selection to the "func" identifier.

    +selection to the "func" identifier.

    Keymap

    • Normal mode @@ -627,6 +639,7 @@ selection to the "func" identifier.

    • Window mode
    • Space mode
    • @@ -647,7 +660,7 @@ selection to the "func" identifier.

      ๐Ÿ’ก Mappings marked (TS) require a tree-sitter grammar for the file type.

      Normal mode

      -

      Normal mode is the default mode when you launch helix. Return to it from other modes by typing Escape.

      +

      Normal mode is the default mode when you launch helix. You can return to it from other modes by pressing the Escape key.

      Movement

      NOTE: Unlike Vim, f, F, t and T are not confined to the current line.

      @@ -668,13 +681,13 @@ selection to the "func" identifier.

      TFind 'till previous chartill_prev_char FFind previous charfind_prev_char GGo to line number <n>goto_line -Alt-.Repeat last motion (f, t or m)repeat_last_motion +Alt-.Repeat last motion (f, t, m, [ or ])repeat_last_motion HomeMove to the start of the linegoto_line_start EndMove to the end of the linegoto_line_end Ctrl-b, PageUpMove page uppage_up Ctrl-f, PageDownMove page downpage_down -Ctrl-uMove half page uphalf_page_up -Ctrl-dMove half page downhalf_page_down +Ctrl-uMove cursor and page half page uppage_cursor_half_up +Ctrl-dMove cursor and page half page downpage_cursor_half_down Ctrl-iJump forward on the jumplistjump_forward Ctrl-oJump backward on the jumplistjump_backward Ctrl-sSave the current selection to the jumplistsave_selection @@ -702,7 +715,7 @@ selection to the "func" identifier.

      yYank selectionyank pPaste after selectionpaste_after PPaste before selectionpaste_before -" <reg>Select a register to yank to or paste fromselect_register +" <reg>Select a register to yank to or paste fromselect_register >Indent selectionindent <Unindent selectionunindent =Format selection (currently nonfunctional/disabled) (LSP)format_selections @@ -761,7 +774,7 @@ selection to the "func" identifier.

      -

      Search commands all operate on the / register by default. To use a different register, use "<char>.

      +

      Search commands all operate on the / register by default. To use a different register, use "<char>.

      @@ -788,7 +801,7 @@ selection to the "func" identifier.

      View mode

      Accessed by typing z in normal mode.

      View mode is intended for scrolling and manipulating the view without changing -the selection. The "sticky" variant of this mode (accessed by typing Z in +the selection. The "sticky" variant of this mode (accessed by typing Z in normal mode) is persistent and can be exited using the escape key. This is useful when you're simply looking over text and not actively editing it.

      KeyDescriptionCommand
      /Search for regex patternsearch
      ?Search for previous patternrsearch
      @@ -800,8 +813,8 @@ useful when you're simply looking over text and not actively editing it.

      - - + +
      KeyDescriptionCommand
      k, upScroll the view upwardsscroll_up
      Ctrl-f, PageDownMove page downpage_down
      Ctrl-b, PageUpMove page uppage_up
      Ctrl-dMove half page downhalf_page_down
      Ctrl-uMove half page uphalf_page_up
      Ctrl-uMove cursor and page half page uppage_cursor_half_up
      Ctrl-dMove cursor and page half page downpage_cursor_half_down

      Goto mode

      @@ -810,7 +823,7 @@ useful when you're simply looking over text and not actively editing it.

      - + @@ -828,6 +841,7 @@ useful when you're simply looking over text and not actively editing it.

      +
      KeyDescriptionCommand
      gGo to line number <n> else start of filegoto_file_start
      eGo to the end of the filegoto_last_line
      fGo to files in the selectiongoto_file
      fGo to files in the selectionsgoto_file
      hGo to the start of the linegoto_line_start
      lGo to the end of the linegoto_line_end
      sGo to first non-whitespace character of the linegoto_first_nonwhitespace
      .Go to last modification in current filegoto_last_modification
      jMove down textual (instead of visual) linemove_line_down
      kMove up textual (instead of visual) linemove_line_up
      wShow labels at each word and select the word that belongs to the entered labelsgoto_word

      Match mode

      @@ -851,8 +865,8 @@ useful when you're simply looking over text and not actively editing it.

      w, Ctrl-wSwitch to next windowrotate_view v, Ctrl-vVertical right splitvsplit s, Ctrl-sHorizontal bottom splithsplit -fGo to files in the selection in horizontal splitsgoto_file -FGo to files in the selection in vertical splitsgoto_file +fGo to files in the selections in horizontal splitsgoto_file +FGo to files in the selections in vertical splitsgoto_file h, Ctrl-h, LeftMove to left splitjump_view_left j, Ctrl-j, DownMove to split belowjump_view_down k, Ctrl-k, UpMove to split abovejump_view_up @@ -884,6 +898,9 @@ useful when you're simply looking over text and not actively editing it.

      hSelect symbol references (LSP)select_references_to_symbol_under_cursor 'Open last fuzzy pickerlast_picker wEnter window modeN/A +cComment/uncomment selectionstoggle_comments +CBlock comment/uncomment selectionstoggle_block_comments +Alt-cLine comment/uncomment selectionstoggle_line_comments pPaste system clipboard after selectionspaste_clipboard_after PPaste system clipboard before selectionspaste_clipboard_before yYank selections to clipboardyank_to_clipboard @@ -971,14 +988,14 @@ with modal editors.

      As you become more comfortable with modal editing, you may want to disable some insert mode bindings. You can do this by editing your config.toml file.

      [keys.insert]
      -up = "no_op"
      -down = "no_op"
      -left = "no_op"
      -right = "no_op"
      -pageup = "no_op"
      -pagedown = "no_op"
      -home = "no_op"
      -end = "no_op"
      +up = "no_op"
      +down = "no_op"
      +left = "no_op"
      +right = "no_op"
      +pageup = "no_op"
      +pagedown = "no_op"
      +home = "no_op"
      +end = "no_op"
       

      Select / extend mode

      Accessed by typing v in normal mode.

      @@ -1055,7 +1072,7 @@ you to selectively add search terms to your selections.

      :write-buffer-close!, :wbc!Force write changes to disk creating necessary subdirectories and closes the buffer. Accepts an optional path (:write-buffer-close! some/path.txt) :new, :nCreate a new scratch buffer. :format, :fmtFormat the file using the LSP formatter. -:indent-styleSet the indentation style for editing. ('t' for tabs or 1-8 for number of spaces.) +:indent-styleSet the indentation style for editing. ('t' for tabs or 1-16 for number of spaces.) :line-endingSet the document's default line ending. Options: crlf, lf. :earlier, :earJump back to an earlier point in edit history. Accepts a number of steps or a time span. :later, :latJump to a later point in edit history. Accepts a number of steps or a time span. @@ -1123,6 +1140,8 @@ you to selectively add search terms to your selections.

      :reset-diff-change, :diffget, :diffgReset the diff change at the cursor position. :clear-registerClear given register. If no argument is provided, clear all registers. :redrawClear and re-render the whole UI +:moveMove the current buffer and its corresponding file to a different path +:yank-diagnosticYank diagnostic(s) under primary cursor to register, or clipboard by default

      Language Support

      The following languages and Language Servers are supported. To use @@ -1132,6 +1151,8 @@ appropriate Language Server.

      Also see the Language Configuration docs and the Adding Languages guide for more language configuration information.

      + + @@ -1139,26 +1160,30 @@ Languages guide for more language configuration information.

      + - + + - + - + - + + + @@ -1172,6 +1197,7 @@ Languages guide for more language configuration information.

      + @@ -1184,47 +1210,60 @@ Languages guide for more language configuration information.

      - + + - + + + - + + + + + + + - + + + + + - + - + @@ -1234,12 +1273,13 @@ Languages guide for more language configuration information.

      - - + + + @@ -1248,18 +1288,22 @@ Languages guide for more language configuration information.

      + + + + - + - + @@ -1270,22 +1314,26 @@ Languages guide for more language configuration information.

      - - + + - + + + + + @@ -1295,11 +1343,12 @@ Languages guide for more language configuration information.

      + - + - + @@ -1337,16 +1386,16 @@ single width selection.

      ๐Ÿ’ก You can easily open the config file by typing :config-open within Helix normal mode.

      Example config:

      -
      theme = "onedark"
      +
      theme = "onedark"
       
       [editor]
      -line-number = "relative"
      +line-number = "relative"
       mouse = false
       
       [editor.cursor-shape]
      -insert = "bar"
      -normal = "block"
      -select = "underline"
      +insert = "bar"
      +normal = "block"
      +select = "underline"
       
       [editor.file-picker]
       hidden = false
      @@ -1364,15 +1413,16 @@ Its settings will be merged with the configuration directory config.toml
      - + - + - + + @@ -1381,38 +1431,41 @@ Its settings will be merged with the configuration directory config.toml - + + + +
      LanguageSyntax HighlightingTreesitter TextobjectsAuto IndentRainbow BracketsDefault LSP
      adaโœ“โœ“ada_language_server, ada_language_server
      agdaโœ“
      astroโœ“
      awkโœ“โœ“awk-language-server
      bashโœ“โœ“โœ“โœ“bash-language-server
      beancountโœ“
      bibtexโœ“texlab
      bicepโœ“bicep-langserver
      bladeโœ“
      blueprintโœ“blueprint-compiler
      cโœ“โœ“โœ“โœ“clangd
      c-sharpโœ“โœ“OmniSharp
      cabal
      cabalhaskell-language-server-wrapper
      cairoโœ“โœ“โœ“cairo-language-server
      capnpโœ“โœ“
      celโœ“
      clojureโœ“โœ“clojure-lsp
      cmakeโœ“โœ“โœ“cmake-language-server
      commentโœ“
      common-lispโœ“โœ“cl-lsp
      common-lispโœ“โœ“โœ“cl-lsp
      cponโœ“โœ“
      cppโœ“โœ“โœ“โœ“clangd
      crystalโœ“โœ“crystalline
      cssโœ“โœ“vscode-css-language-server
      cssโœ“โœ“โœ“vscode-css-language-server
      cueโœ“cuelsp
      dโœ“โœ“โœ“serve-d
      dartโœ“โœ“dart
      dartโœ“โœ“โœ“dart
      dbmlโœ“
      devicetreeโœ“
      dhallโœ“โœ“dhall-lsp-server
      diffโœ“
      docker-composeโœ“โœ“docker-compose-langserver, yaml-language-server
      dockerfileโœ“docker-langserver
      dotโœ“dot-language-server
      dtdโœ“
      erbโœ“
      erlangโœ“โœ“โœ“erlang_ls
      esdlโœ“
      fidlโœ“
      fishโœ“โœ“โœ“
      forthโœ“forth-lsp
      fortranโœ“โœ“fortls
      git-configโœ“
      git-ignoreโœ“
      git-rebaseโœ“
      gleamโœ“โœ“gleam
      gleamโœ“โœ“โœ“gleam
      glimmerโœ“ember-language-server
      glslโœ“โœ“โœ“
      goโœ“โœ“โœ“โœ“gopls
      gnโœ“
      goโœ“โœ“โœ“โœ“gopls, golangci-lint-langserver
      godot-resourceโœ“
      gomodโœ“gopls
      gotmplโœ“gopls
      goworkโœ“gopls
      graphqlโœ“graphql-lsp
      groovyโœ“
      hareโœ“
      haskellโœ“โœ“haskell-language-server-wrapper
      haskell-persistentโœ“
      hclโœ“โœ“terraform-ls
      hclโœ“โœ“โœ“terraform-ls
      heexโœ“โœ“elixir-ls
      helmโœ“helm_ls
      hoconโœ“โœ“
      hoonโœ“
      hostsโœ“
      htmlโœ“โœ“vscode-html-language-server
      hurlโœ“โœ“
      hyprlangโœ“โœ“
      idrisidris2-lsp
      iexโœ“
      iniโœ“
      janetโœ“
      javaโœ“โœ“โœ“โœ“jdtls
      javascriptโœ“โœ“โœ“โœ“typescript-language-server
      jinjaโœ“
      jsdocโœ“
      jsonโœ“โœ“โœ“vscode-json-language-server
      json5โœ“
      jsoncโœ“โœ“vscode-json-language-server
      jsonnetโœ“jsonnet-language-server
      jsxโœ“โœ“โœ“โœ“typescript-language-server
      juliaโœ“โœ“โœ“julia
      justโœ“โœ“โœ“
      kdlโœ“
      kdlโœ“โœ“โœ“
      kokaโœ“โœ“koka
      kotlinโœ“kotlin-language-server
      latexโœ“โœ“texlab
      ldโœ“โœ“
      leanโœ“lean
      ledgerโœ“
      llvmโœ“โœ“โœ“
      llvm-mirโœ“โœ“โœ“
      llvm-mir-yamlโœ“โœ“
      logโœ“
      lpfโœ“
      luaโœ“โœ“โœ“lua-language-server
      makeโœ“
      makeโœ“โœ“
      markdocโœ“markdoc-ls
      markdownโœ“marksman
      markdownโœ“marksman, markdown-oxide
      markdown.inlineโœ“
      matlabโœ“โœ“โœ“
      mermaidโœ“
      nasmโœ“โœ“
      nickelโœ“โœ“nls
      nimโœ“โœ“โœ“nimlangserver
      nixโœ“โœ“nil
      nuโœ“
      nixโœ“โœ“โœ“nil
      nuโœ“nu
      nunjucksโœ“
      ocamlโœ“โœ“ocamllsp
      ocaml-interfaceโœ“ocamllsp
      odinโœ“โœ“ols
      ohmโœ“โœ“โœ“
      openclโœ“โœ“โœ“clangd
      openscadโœ“openscad-lsp
      orgโœ“
      pemโœ“
      perlโœ“โœ“โœ“perlnavigator
      phpโœ“โœ“โœ“intelephense
      php-onlyโœ“
      pkgbuildโœ“โœ“โœ“pkgbuild-language-server, bash-language-server
      pklโœ“โœ“
      poโœ“โœ“
      podโœ“
      ponylangโœ“โœ“โœ“
      powershellโœ“
      prismaโœ“prisma-language-server
      prologswipl
      protobufโœ“โœ“bufls, pb
      protobufโœ“โœ“โœ“bufls, pb
      prqlโœ“
      purescriptโœ“โœ“purescript-language-server
      pythonโœ“โœ“โœ“โœ“pylsp
      qmlโœ“โœ“qmlls
      rโœ“R
      racketโœ“โœ“racket
      racketโœ“โœ“โœ“racket
      regexโœ“โœ“
      regoโœ“regols
      rescriptโœ“โœ“rescript-language-server
      rubyโœ“โœ“โœ“โœ“solargraph
      rustโœ“โœ“โœ“โœ“rust-analyzer
      sageโœ“โœ“
      scalaโœ“โœ“metals
      schemeโœ“โœ“
      scalaโœ“โœ“โœ“metals
      schemeโœ“โœ“โœ“
      scssโœ“โœ“vscode-css-language-server
      slintโœ“โœ“slint-lsp
      slintโœ“โœ“โœ“slint-lsp
      smaliโœ“โœ“
      smithyโœ“cs
      smlโœ“
      solidityโœ“solc
      spicedbโœ“
      sqlโœ“
      sshclientconfigโœ“
      starlarkโœ“โœ“โœ“
      straceโœ“
      supercolliderโœ“
      svelteโœ“โœ“svelteserver
      swayโœ“โœ“โœ“forc
      swiftโœ“sourcekit-lsp
      t32โœ“
      tablegenโœ“โœ“โœ“
      tactโœ“โœ“โœ“
      taskโœ“
      templโœ“templ
      tfvarsโœ“โœ“terraform-ls
      tsxโœ“โœ“โœ“โœ“typescript-language-server
      twigโœ“
      typescriptโœ“โœ“โœ“โœ“typescript-language-server
      typstโœ“typst-lsp
      ungrammarโœ“
      unisonโœ“
      unisonโœ“โœ“
      uxntalโœ“
      vโœ“โœ“โœ“v-analyzer
      valaโœ“vala-language-server
      valaโœ“โœ“vala-language-server
      verilogโœ“โœ“svlangserver
      vhdlโœ“vhdl_ls
      vhsโœ“
      mouseEnable mouse modetrue
      middle-click-pasteMiddle click paste supporttrue
      scroll-linesNumber of lines to scroll per scroll wheel step3
      shellShell to use when running external commandsUnix: ["sh", "-c"]
      Windows: ["cmd", "/C"]
      shellShell to use when running external commandsUnix: ["sh", "-c"]
      Windows: ["cmd", "/C"]
      line-numberLine number display: absolute simply shows each line's number, while relative shows the distance from the current line. When unfocused or in insert mode, relative will still show absolute line numbersabsolute
      cursorlineHighlight all lines with a cursorfalse
      cursorcolumnHighlight all columns with a cursorfalse
      guttersGutters to display: Available are diagnostics and diff and line-numbers and spacer, note that diagnostics also includes other features like breakpoints, 1-width padding will be inserted if gutters is non-empty["diagnostics", "spacer", "line-numbers", "spacer", "diff"]
      guttersGutters to display: Available are diagnostics and diff and line-numbers and spacer, note that diagnostics also includes other features like breakpoints, 1-width padding will be inserted if gutters is non-empty["diagnostics", "spacer", "line-numbers", "spacer", "diff"]
      auto-completionEnable automatic pop up of auto-completiontrue
      auto-formatEnable automatic formatting on savetrue
      auto-saveEnable automatic saving on the focus moving away from Helix. Requires focus event support from your terminalfalse
      idle-timeoutTime in milliseconds since last keypress before idle timers trigger. Used for autocompletion, set to 0 for instant400
      idle-timeoutTime in milliseconds since last keypress before idle timers trigger.250
      completion-timeoutTime in milliseconds after typing a word character before completions are shown, set to 5 for instant.250
      preview-completion-insertWhether to apply completion item instantly when selectedtrue
      completion-trigger-lenThe min-length of word under cursor to trigger autocompletion2
      completion-replaceSet to true to make completions always replace the entire word and not just the part before the cursorfalse
      undercurlSet to true to override automatic detection of terminal undercurl support in the event of a false negativefalse
      rulersList of column positions at which to display the rulers. Can be overridden by language specific rulers in languages.toml file[]
      bufferlineRenders a line at the top of the editor displaying open buffers. Can be always, never or multiple (only shown if more than one buffer is in use)never
      initial-modeThe initial mode for newly opened editors."normal"
      color-modesWhether to color the mode indicator with different colors depending on the mode itselffalse
      text-widthMaximum line length. Used for the :reflow command and soft-wrapping if soft-wrap.wrap-at-text-width is set80
      workspace-lsp-rootsDirectories relative to the workspace root that are treated as LSP roots. Should only be set in .helix/config.toml[]
      default-line-endingThe line ending to use for new documents. Can be native, lf, crlf, ff, cr or nel. native uses the platform's native line ending (crlf on Windows, otherwise lf).native
      insert-final-newlineWhether to automatically insert a trailing line-ending on write if missingtrue
      popup-borderDraw border around popup, menu, all, or nonenone
      indent-heuristicHow the indentation for a newly inserted line is computed: simple just copies the indentation level from the previous line, tree-sitter computes the indentation based on the syntax tree and hybrid combines both approaches. If the chosen heuristic is not available, a different one will be used as a fallback (the fallback order being hybrid -> tree-sitter -> simple).hybrid
      jump-label-alphabetThe characters that are used to generate two character jump labels. Characters at the start of the alphabet are used first."abcdefghijklmnopqrstuvwxyz"
      initial-modeThe initial mode for newly opened editors."normal"
      rainbow-bracketsWhether to render rainbow colors for matching brackets. Requires tree-sitter rainbows.scm queries for the language.false

      [editor.statusline] Section

      Allows configuring the statusline at the bottom of the editor.

      The configuration distinguishes between three areas of the status line:

      -

      [ ... ... LEFT ... ... | ... ... ... ... CENTER ... ... ... ... | ... ... RIGHT ... ... ]

      +

      [ ... ... LEFT ... ... | ... ... ... CENTER ... ... ... | ... ... RIGHT ... ... ]

      Statusline elements can be defined as follows:

      [editor.statusline]
      -left = ["mode", "spinner"]
      -center = ["file-name"]
      -right = ["diagnostics", "selections", "position", "file-encoding", "file-line-ending", "file-type"]
      -separator = "โ”‚"
      -mode.normal = "NORMAL"
      -mode.insert = "INSERT"
      -mode.select = "SELECT"
      +left = ["mode", "spinner"]
      +center = ["file-name"]
      +right = ["diagnostics", "selections", "position", "file-encoding", "file-line-ending", "file-type"]
      +separator = "โ”‚"
      +mode.normal = "NORMAL"
      +mode.insert = "INSERT"
      +mode.select = "SELECT"
       

      The [editor.statusline] key takes the following sub-keys:

      - + - - - - - + + + + +
      KeyDescriptionDefault
      leftA list of elements aligned to the left of the statusline["mode", "spinner", "file-name", "read-only-indicator", "file-modification-indicator"]
      leftA list of elements aligned to the left of the statusline["mode", "spinner", "file-name", "read-only-indicator", "file-modification-indicator"]
      centerA list of elements aligned to the middle of the statusline[]
      rightA list of elements aligned to the right of the statusline["diagnostics", "selections", "register", "position", "file-encoding"]
      separatorThe character used to separate elements in the statusline"โ”‚"
      mode.normalThe text shown in the mode element for normal mode"NOR"
      mode.insertThe text shown in the mode element for insert mode"INS"
      mode.selectThe text shown in the mode element for select mode"SEL"
      rightA list of elements aligned to the right of the statusline["diagnostics", "selections", "register", "position", "file-encoding"]
      separatorThe character used to separate elements in the statusline"โ”‚"
      mode.normalThe text shown in the mode element for normal mode"NOR"
      mode.insertThe text shown in the mode element for insert mode"INS"
      mode.selectThe text shown in the mode element for select mode"SEL"

      The following statusline elements can be configured:

      @@ -1420,6 +1473,7 @@ mode.select = "SELECT" modeThe current editor mode (mode.normal/mode.insert/mode.select) spinnerA progress spinner indicating LSP activity file-nameThe path/name of the opened file +file-absolute-pathThe absolute path/name of the opened file file-base-nameThe basename of the opened file file-modification-indicatorThe indicator to show whether the file is modified (a [+] appears when there are unsaved changes) file-encodingThe encoding of the opened file if it differs from UTF-8 @@ -1433,7 +1487,7 @@ mode.select = "SELECT" primary-selection-lengthThe number of characters currently in primary selection positionThe cursor position position-percentageThe cursor position as a percentage of the total number of lines -separatorThe string defined in editor.statusline.separator (defaults to "โ”‚") +separatorThe string defined in editor.statusline.separator (defaults to "โ”‚") spacerInserts a space between elements (multiple/contiguous spacers may be specified) version-controlThe current branch name or detached commit hash of the opened workspace registerThe current selected register @@ -1474,17 +1528,29 @@ change shape.

      not visible in the Helix file picker and global search.

      All git related options are only enabled in a git repository.

      - - - - - - - - - + + + + + + + + +
      KeyDescriptionDefault
      hiddenEnables ignoring hidden filestrue
      follow-symlinksFollow symlinks instead of ignoring themtrue
      deduplicate-linksIgnore symlinks that point at files already shown in the pickertrue
      parentsEnables reading ignore files from parent directoriestrue
      ignoreEnables reading .ignore filestrue
      git-ignoreEnables reading .gitignore filestrue
      git-globalEnables reading global .gitignore, whose path is specified in git's config: core.excludefile optiontrue
      git-excludeEnables reading .git/info/exclude filestrue
      max-depthSet with an integer value for maximum depth to recurseDefaults to None.
      hiddenEnables ignoring hidden filestrue
      follow-symlinksFollow symlinks instead of ignoring themtrue
      deduplicate-linksIgnore symlinks that point at files already shown in the pickertrue
      parentsEnables reading ignore files from parent directoriestrue
      ignoreEnables reading .ignore filestrue
      git-ignoreEnables reading .gitignore filestrue
      git-globalEnables reading global .gitignore, whose path is specified in git's config: core.excludesfile optiontrue
      git-excludeEnables reading .git/info/exclude filestrue
      max-depthSet with an integer value for maximum depth to recurseUnset by default
      +

      Ignore files can be placed locally as .ignore or put in your home directory as ~/.ignore. They support the usual ignore and negative ignore (unignore) rules used in .gitignore files.

      +

      Additionally, you can use Helix-specific ignore files by creating a local .helix/ignore file in the current workspace or a global ignore file located in your Helix config directory:

      +
        +
      • Linux and Mac: ~/.config/helix/ignore
      • +
      • Windows: %AppData%\helix\ignore
      • +
      +

      Example:

      +
      # unignore in file picker and global search
      +!.github/
      +!.gitignore
      +!.gitattributes
      +

      [editor.auto-pairs] Section

      Enables automatic insertion of pairs to parentheses, brackets, etc. Can be a simple boolean value, or a specific mapping of pairs of single characters.

      @@ -1492,28 +1558,28 @@ simple boolean value, or a specific mapping of pairs of single characters.

      [editor]
       auto-pairs = false # defaults to `true`
       
      -

      The default pairs are (){}[]''""``, but these can be customized by +

      The default pairs are (){}[]''""``, but these can be customized by setting auto-pairs to a TOML table:

      [editor.auto-pairs]
       '(' = ')'
       '{' = '}'
       '[' = ']'
      -'"' = '"'
      +'"' = '"'
       '`' = '`'
       '<' = '>'
       

      Additionally, this setting can be used in a language config. Unless the editor setting is false, this will override the editor config in documents with this language.

      -

      Example languages.toml that adds <> and removes ''

      +

      Example languages.toml that adds <> and removes ''

      [[language]]
      -name = "rust"
      +name = "rust"
       
       [language.auto-pairs]
       '(' = ')'
       '{' = '}'
       '[' = ']'
      -'"' = '"'
      +'"' = '"'
       '`' = '`'
       '<' = '>'
       
      @@ -1527,25 +1593,28 @@ name = "rust"

      [editor.whitespace] Section

      Options for rendering whitespace with visible characters. Use :set whitespace.render all to temporarily enable visible whitespace.

      - - + +
      KeyDescriptionDefault
      renderWhether to render whitespace. May either be "all" or "none", or a table with sub-keys space, nbsp, tab, and newline"none"
      charactersLiteral characters to use when rendering whitespace. Sub-keys may be any of tab, space, nbsp, newline or tabpadSee example below
      renderWhether to render whitespace. May either be all or none, or a table with sub-keys space, nbsp, nnbsp, tab, and newlinenone
      charactersLiteral characters to use when rendering whitespace. Sub-keys may be any of tab, space, nbsp, nnbsp, newline or tabpadSee example below

      Example

      [editor.whitespace]
      -render = "all"
      +render = "all"
       # or control each character
       [editor.whitespace.render]
      -space = "all"
      -tab = "all"
      -newline = "none"
      +space = "all"
      +tab = "all"
      +nbsp = "none"
      +nnbsp = "none"
      +newline = "none"
       
       [editor.whitespace.characters]
      -space = "ยท"
      -nbsp = "โฝ"
      -tab = "โ†’"
      -newline = "โŽ"
      -tabpad = "ยท" # Tabs will look like "โ†’ยทยทยท" (depending on tab width)
      +space = "ยท"
      +nbsp = "โฝ"
      +nnbsp = "โฃ"
      +tab = "โ†’"
      +newline = "โŽ"
      +tabpad = "ยท" # Tabs will look like "โ†’ยทยทยท" (depending on tab width)
       

      [editor.indent-guides] Section

      Options for rendering vertical indent guides.

      @@ -1559,26 +1628,26 @@ tabpad = "ยท" # Tabs will look like "โ†’ยทยทยท" (depending o

      Example:

      [editor.indent-guides]
       render = true
      -character = "โ•Ž" # Some characters that work well: "โ–", "โ”†", "โ”Š", "โธฝ"
      +character = "โ•Ž" # Some characters that work well: "โ–", "โ”†", "โ”Š", "โธฝ"
       skip-levels = 1
      -rainbow-option = "normal"
      +rainbow-option = "normal"
       

      [editor.gutters] Section

      For simplicity, editor.gutters accepts an array of gutter types, which will use default settings for all gutter components.

      [editor]
      -gutters = ["diff", "diagnostics", "line-numbers", "spacer"]
      +gutters = ["diff", "diagnostics", "line-numbers", "spacer"]
       

      To customize the behavior of gutters, the [editor.gutters] section must be used. This section contains top level settings, as well as settings for specific gutter components as subsections.

      - +
      KeyDescriptionDefault
      layoutA vector of gutters to display["diagnostics", "spacer", "line-numbers", "spacer", "diff"]
      layoutA vector of gutters to display["diagnostics", "spacer", "line-numbers", "spacer", "diff"]

      Example:

      [editor.gutters]
      -layout = ["diff", "diagnostics", "line-numbers", "spacer"]
      +layout = ["diff", "diagnostics", "line-numbers", "spacer"]
       

      [editor.gutters.line-numbers] Section

      Options for the line number gutter

      @@ -1593,7 +1662,10 @@ min-width = 1

      [editor.gutters.diagnostics] Section

      Currently unused

      [editor.gutters.diff] Section

      -

      Currently unused

      +

      The diff gutter option displays colored bars indicating whether a git diff represents that a line was added, removed or changed. +These colors are controlled by the theme attributes diff.plus, diff.minus and diff.delta.

      +

      Other diff providers will eventually be supported by a future plugin system.

      +

      There are currently no options for this section.

      [editor.gutters.spacer] Section

      Currently unused

      [editor.soft-wrap] Section

      @@ -1611,7 +1683,26 @@ min-width = 1 enable = true max-wrap = 25 # increase value to reduce forced mid-word wrapping max-indent-retain = 0 -wrap-indicator = "" # set wrap-indicator to "" to hide it +wrap-indicator = "" # set wrap-indicator to "" to hide it +
    +

    [editor.smart-tab] Section

    +

    Options for navigating and editing using tab key.

    +
    + + +
    KeyDescriptionDefault
    enableIf set to true, then when the cursor is in a position with non-whitespace to its left, instead of inserting a tab, it will run move_parent_node_end. If there is only whitespace to the left, then it inserts a tab as normal. With the default bindings, to explicitly insert a tab character, press Shift-tab.true
    supersede-menuNormally, when a menu is on screen, such as when auto complete is triggered, the tab key is bound to cycling through the items. This means when menus are on screen, one cannot use the tab key to trigger the smart-tab command. If this option is set to true, the smart-tab command always takes precedence, which means one cannot use the tab key to cycle through menu items. One of the other bindings must be used instead, such as arrow keys or C-n/C-p.false
    +
    +

    Due to lack of support for S-tab in some terminals, the default keybindings don't fully embrace smart-tab editing experience. If you enjoy smart-tab navigation and a terminal that supports the Enhanced Keyboard protocol, consider setting extra keybindings:

    +
    [keys.normal]
    +tab = "move_parent_node_end"
    +S-tab = "move_parent_node_start"
    +
    +[keys.insert]
    +S-tab = "move_parent_node_start"
    +
    +[keys.select]
    +tab = "extend_parent_node_end"
    +S-tab = "extend_parent_node_start"
     

    [editor.explorer] Section

    Sets explorer side width and style.

    @@ -1620,38 +1711,32 @@ wrap-indicator = "" # set wrap-indicator to "" to hide it positionexplorer widget position, left or rightleft -

    [editor.smart-tab] Section

    -
    - - -
    KeyDescriptionDefault
    enableIf set to true, then when the cursor is in a position with non-whitespace to its left, instead of inserting a tab, it will run move_parent_node_end. If there is only whitespace to the left, then it inserts a tab as normal. With the default bindings, to explicitly insert a tab character, press Shift-tab.true
    supersede-menuNormally, when a menu is on screen, such as when auto complete is triggered, the tab key is bound to cycling through the items. This means when menus are on screen, one cannot use the tab key to trigger the smart-tab command. If this option is set to true, the smart-tab command always takes precedence, which means one cannot use the tab key to cycle through menu items. One of the other bindings must be used instead, such as arrow keys or C-n/C-p.false
    -

    [editor.digraphs] Section

    By default, special characters can be input using the insert_digraphs command, bound to \ in normal mode. Custom digraphs can be added to the editor.digraphs section of the config.

    [editor.digraphs]
    -ka = "ใ‹"
    -ku = { symbols = "ใ", description = "The japanese character Ku" }
    -shrug = "ยฏ\\_(ใƒ„)_/ยฏ"
    +ka = "ใ‹"
    +ku = { symbols = "ใ", description = "The japanese character Ku" }
    +shrug = "ยฏ\\_(ใƒ„)_/ยฏ"
     

    Themes

    -

    To use a theme add theme = "<name>" to the top of your config.toml file, or select it during runtime using :theme <name>.

    +

    To use a theme add theme = "<name>" to the top of your config.toml file, or select it during runtime using :theme <name>.

    Creating a theme

    Create a file with the name of your theme as the file name (i.e mytheme.toml) and place it in your themes directory (i.e ~/.config/helix/themes or %AppData%\helix\themes on Windows). The directory might have to be created beforehand.

    -

    ๐Ÿ’ก The names "default" and "base16_default" are reserved for built-in themes +

    ๐Ÿ’ก The names "default" and "base16_default" are reserved for built-in themes and cannot be overridden by user-defined themes.

    Overview

    Each line in the theme file is specified as below:

    -
    key = { fg = "#ffffff", bg = "#000000", underline = { color = "#ff0000", style = "curl"}, modifiers = ["bold", "italic"] }
    +
    key = { fg = "#ffffff", bg = "#000000", underline = { color = "#ff0000", style = "curl"}, modifiers = ["bold", "italic"] }
     

    Where key represents what you want to style, fg specifies the foreground color, bg the background color, underline the underline style/color, and modifiers is a list of style modifiers. bg, underline and modifiers can be omitted to defer to the defaults.

    To specify only the foreground color:

    -
    key = "#ffffff"
    +
    key = "#ffffff"
     

    If the key contains a dot '.', it must be quoted to prevent it being parsed as a dotted key.

    -
    "key.key" = "#ffffff"
    +
    "key.key" = "#ffffff"
     

    For inspiration, you can find the default theme.toml here and @@ -1666,12 +1751,12 @@ user-submitted themes

    It's recommended to define a palette of named colors, and refer to them in the configuration values in your theme. To do this, add a table called palette to your theme file:

    -
    "ui.background" = "white"
    -"ui.text" = "black"
    +
    "ui.background" = "white"
    +"ui.text" = "black"
     
     [palette]
    -white = "#ffffff"
    -black = "#000000"
    +white = "#ffffff"
    +black = "#000000"
     

    Keep in mind that the [palette] table includes all keys after its header, so it should be defined after the normal theme options.

    @@ -1715,7 +1800,7 @@ your terminal emulator.

    ๐Ÿ’ก The underlined modifier is deprecated and only available for backwards compatibility. -Its behavior is equivalent to setting underline.style="line".

    +Its behavior is equivalent to setting underline.style="line".

    Underline style

    One of the following values may be used as a value for underline.style, providing it is @@ -1730,19 +1815,19 @@ supported by your terminal emulator.

    Inheritance

    Extend other themes by setting the inherits property to an existing theme.

    -
    inherits = "boo_berry"
    +
    inherits = "boo_berry"
     
    -# Override the theming for "keyword"s:
    -"keyword" = { fg = "gold" }
    +# Override the theming for "keyword"s:
    +"keyword" = { fg = "gold" }
     
     # Override colors in the palette:
     [palette]
    -berry = "#2A2A4D"
    +berry = "#2A2A4D"
     

    Rainbow

    The rainbow key is used for rainbow highlight for matching brackets. The key is a list of styles.

    -
    rainbow = ["#ff0000", "#ffa500", "#fff000", { fg = "#00ff00", modifiers = ["bold"] }]
    +
    rainbow = ["#ff0000", "#ffa500", "#fff000", { fg = "#00ff00", modifiers = ["bold"] }]
     

    Colors from the palette and modifiers may be used.

    Scopes

    @@ -1761,6 +1846,7 @@ The key is a list of styles.

    type - Types

    • builtin - Primitive types provided by the language (int, usize)
    • +
    • parameter - Generic type parameters (T)
    • enum
      • variant
      • @@ -1999,11 +2085,14 @@ The key is a list of styles.

        ui.statusline.insertStatusline mode during insert mode (only if editor.color-modes is enabled) ui.statusline.selectStatusline mode during select mode (only if editor.color-modes is enabled) ui.statusline.separatorSeparator character in statusline +ui.bufferlineStyle for the buffer line +ui.bufferline.activeStyle for the active buffer in buffer line +ui.bufferline.backgroundStyle for bufferline background ui.popupDocumentation popups (e.g. Space + k) ui.popup.infoPrompt for multiple key options ui.windowBorderlines separating splits ui.helpDescription box for commands -ui.textCommand prompts, popup text, etc. +ui.textDefault text style, command prompts, popup text, etc. ui.text.focusThe currently selected line in the picker ui.text.inactiveSame as ui.text but when the text is inactive (e.g. suggestions) ui.text.infoThe key: command text in ui.popup.info boxes @@ -2014,6 +2103,7 @@ The key is a list of styles.

        ui.virtual.inlay-hint.parameterStyle for inlay hints of kind parameter (LSPs are not required to set a kind) ui.virtual.inlay-hint.typeStyle for inlay hints of kind type (LSPs are not required to set a kind) ui.virtual.wrapSoft-wrap indicator (see the editor.soft-wrap config) +ui.virtual.jump-labelStyle for virtual jump labels ui.menuCode and command completion menus ui.menu.selectedSelected autocomplete item ui.menu.scrollfg sets thumb color, bg sets track color of scrollbar @@ -2033,6 +2123,8 @@ The key is a list of styles.

        diagnostic.infoDiagnostics info (editing area) diagnostic.warningDiagnostics warning (editing area) diagnostic.errorDiagnostics error (editing area) +diagnostic.unnecessaryDiagnostics with unnecessary tag (editing area) +diagnostic.deprecatedDiagnostics with deprecated tag (editing area)

        Key remapping

        Helix currently supports one-way key remapping through a simple TOML configuration @@ -2043,59 +2135,59 @@ directory (default ~/.config/helix on Linux systems) with a structu this:

        # At most one section each of 'keys.normal', 'keys.insert' and 'keys.select'
         [keys.normal]
        -C-s = ":w" # Maps Ctrl-s to the typable command :w which is an alias for :write (save file)
        -C-o = ":open ~/.config/helix/config.toml" # Maps Ctrl-o to opening of the helix config file
        -a = "move_char_left" # Maps the 'a' key to the move_char_left command
        -w = "move_line_up" # Maps the 'w' key move_line_up
        -"C-S-esc" = "extend_line" # Maps Ctrl-Shift-Escape to extend_line
        -g = { a = "code_action" } # Maps `ga` to show possible code actions
        -"ret" = ["open_below", "normal_mode"] # Maps the enter key to open_below then re-enter normal mode
        +C-s = ":w" # Maps Ctrl-s to the typable command :w which is an alias for :write (save file)
        +C-o = ":open ~/.config/helix/config.toml" # Maps Ctrl-o to opening of the helix config file
        +a = "move_char_left" # Maps the 'a' key to the move_char_left command
        +w = "move_line_up" # Maps the 'w' key move_line_up
        +"C-S-esc" = "extend_line" # Maps Ctrl-Shift-Escape to extend_line
        +g = { a = "code_action" } # Maps `ga` to show possible code actions
        +"ret" = ["open_below", "normal_mode"] # Maps the enter key to open_below then re-enter normal mode
         
         [keys.insert]
        -"A-x" = "normal_mode"     # Maps Alt-X to enter normal mode
        -j = { k = "normal_mode" } # Maps `jk` to exit insert mode
        +"A-x" = "normal_mode"     # Maps Alt-X to enter normal mode
        +j = { k = "normal_mode" } # Maps `jk` to exit insert mode
         

        Minor modes

        Minor modes are accessed by pressing a key (usually from normal mode), giving access to dedicated bindings. Bindings can be modified or added by nesting definitions.

        [keys.insert.j]
        -k = "normal_mode" # Maps `jk` to exit insert mode
        +k = "normal_mode" # Maps `jk` to exit insert mode
         
         [keys.normal.g]
        -a = "code_action" # Maps `ga` to show possible code actions
        +a = "code_action" # Maps `ga` to show possible code actions
         
         # invert `j` and `k` in view mode
         [keys.normal.z]
        -j = "scroll_up"
        -k = "scroll_down"
        +j = "scroll_up"
        +k = "scroll_down"
         
         # create a new minor mode bound to `+`
        -[keys.normal."+"]
        -m = ":run-shell-command make"
        -c = ":run-shell-command cargo build"
        -t = ":run-shell-command cargo test"
        +[keys.normal."+"]
        +m = ":run-shell-command make"
        +c = ":run-shell-command cargo build"
        +t = ":run-shell-command cargo test"
         

        Special keys and modifiers

        Ctrl, Shift and Alt modifiers are encoded respectively with the prefixes C-, S- and A-. Special keys are encoded as follows:

        - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + +
        Key nameRepresentation
        Backspace"backspace"
        Space"space"
        Return/Enter"ret"
        -"minus"
        Left"left"
        Right"right"
        Up"up"
        Down"down"
        Home"home"
        End"end"
        Page Up"pageup"
        Page Down"pagedown"
        Tab"tab"
        Delete"del"
        Insert"ins"
        Null"null"
        Escape"esc"
        Backspace"backspace"
        Space"space"
        Return/Enter"ret"
        -"minus"
        Left"left"
        Right"right"
        Up"up"
        Down"down"
        Home"home"
        End"end"
        Page Up"pageup"
        Page Down"pagedown"
        Tab"tab"
        Delete"del"
        Insert"ins"
        Null"null"
        Escape"esc"

        Keys can be disabled by binding them to the no_op command.

        @@ -2104,15 +2196,15 @@ t = ":run-shell-command cargo test" # Only these normal mode bindings will be used [keys.normal] -n = "normal_mode" -t = "goto_definition" +n = "normal_mode" +t = "goto_definition" # remember to add bindings to return to normal mode [keys.select] -esc = "normal_mode" +esc = "normal_mode" [keys.insert] -esc = "normal_mode" +esc = "normal_mode"

    A list of commands is available in the Keymap documentation and in the source code at helix-term/src/commands.rs at the invocation of static_commands! macro and the TypableCommandList.

    @@ -2134,10 +2226,10 @@ auto-LSP-formatting in Rust:

    # in <config_dir>/helix/languages.toml
     
     [language-server.mylang-lsp]
    -command = "mylang-lsp"
    +command = "mylang-lsp"
     
     [[language]]
    -name = "rust"
    +name = "rust"
     auto-format = false
     
  • @@ -2152,14 +2244,14 @@ in the configuration directory and the built-in configuration.

    Each language is configured by adding a [[language]] section to a languages.toml file. For example:

    [[language]]
    -name = "mylang"
    -scope = "source.mylang"
    -injection-regex = "mylang"
    -file-types = ["mylang", "myl"]
    -comment-token = "#"
    -indent = { tab-width = 2, unit = "  " }
    -formatter = { command = "mylang-formatter" , args = ["--stdin"] }
    -language-servers = [ "mylang-lsp" ]
    +name = "mylang"
    +scope = "source.mylang"
    +injection-regex = "mylang"
    +file-types = ["mylang", "myl"]
    +comment-tokens = "#"
    +indent = { tab-width = 2, unit = "  " }
    +formatter = { command = "mylang-formatter" , args = ["--stdin"] }
    +language-servers = [ "mylang-lsp" ]
     

    These configuration keys are available:

    @@ -2167,18 +2259,21 @@ language-servers = [ "mylang-lsp" ] - - + + - - + + + + +
    KeyDescription
    language-idThe language-id for language servers, checkout the table at TextDocumentItem for the right id
    scopeA string like source.js that identifies the language. Currently, we strive to match the scope names used by popular TextMate grammars and by the Linguist library. Usually source.<name> or text.<name> in case of markup languages
    injection-regexregex pattern that will be tested against a language name in order to determine whether this language should be used for a potential language injection site.
    file-typesThe filetypes of the language, for example ["yml", "yaml"]. See the file-type detection section below.
    shebangsThe interpreters from the shebang line, for example ["sh", "bash"]
    file-typesThe filetypes of the language, for example ["yml", "yaml"]. See the file-type detection section below.
    shebangsThe interpreters from the shebang line, for example ["sh", "bash"]
    rootsA set of marker files to look for when trying to find the workspace root. For example Cargo.lock, yarn.lock
    auto-formatWhether to autoformat this language when saving
    diagnostic-severityMinimal severity of diagnostic for it to be displayed. (Allowed values: Error, Warning, Info, Hint)
    comment-tokenThe token to use as a comment-token
    indentThe indent to use. Has sub keys unit (the text inserted into the document when indenting; usually set to N spaces or "\t" for tabs) and tab-width (the number of spaces rendered for a tab)
    comment-tokensThe tokens to use as a comment token, either a single token "//" or an array ["//", "///", "//!"] (the first token will be used for commenting). Also configurable as comment-token for backwards compatibility
    block-comment-tokensThe start and end tokens for a multiline comment either an array or single table of { start = "/*", end = "*/"}. The first set of tokens will be used for commenting, any pairs in the array can be uncommented
    indentThe indent to use. Has sub keys unit (the text inserted into the document when indenting; usually set to N spaces or "\t" for tabs) and tab-width (the number of spaces rendered for a tab)
    language-serversThe Language Servers used for this language. See below for more information in the section Configuring Language Servers for a language
    grammarThe tree-sitter grammar to use (defaults to the value of name)
    formatterThe formatter for the language, it will take precedence over the lsp when defined. The formatter must be able to take the original file as input from stdin and write the formatted file to stdout
    soft-wrapeditor.softwrap
    text-widthMaximum line length. Used for the :reflow command and soft-wrapping if soft-wrap.wrap-at-text-width is set, defaults to editor.text-width
    workspace-lsp-rootsDirectories relative to the workspace root that are treated as LSP roots. Should only be set in .helix/config.toml. Overwrites the setting of the same name in config.toml if set.
    persistent-diagnostic-sourcesAn array of LSP diagnostic sources assumed unchanged when the language server resends the same set of diagnostics. Helix can track the position for these diagnostics internally instead. Useful for diagnostics that are recomputed on save.
    rulersOverrides the editor.rulers config key for the language.
    rainbow-bracketsOverrides the editor.rainbow-brackets config key for the language.
    @@ -2187,39 +2282,41 @@ language-servers = [ "mylang-lsp" ]

    Helix determines which language configuration to use based on the file-types key from the above section. file-types is a list of strings or tables, for example:

    -
    file-types = ["Makefile", "toml", { suffix = ".git/config" }]
    +
    file-types = ["toml", { glob = "Makefile" }, { glob = ".git/config" }, { glob = ".github/workflows/*.yaml" } ]
     

    When determining a language configuration to use, Helix searches the file-types with the following priorities:

      -
    1. Exact match: if the filename of a file is an exact match of a string in a -file-types list, that language wins. In the example above, "Makefile" -will match against Makefile files.
    2. -
    3. Extension: if there are no exact matches, any file-types string that -matches the file extension of a given file wins. In the example above, the -"toml" matches files like Cargo.toml or languages.toml.
    4. -
    5. Suffix: if there are still no matches, any values in suffix tables -are checked against the full path of the given file. In the example above, -the { suffix = ".git/config" } would match against any config files -in .git directories. Note: / is used as the directory separator but is -replaced at runtime with the appropriate path separator for the operating -system, so this rule would match against .git\config files on Windows.
    6. +
    7. Glob: values in glob tables are checked against the full path of the given +file. Globs are standard Unix-style path globs (e.g. the kind you use in Shell) +and can be used to match paths for a specific prefix, suffix, directory, etc. +In the above example, the { glob = "Makefile" } config would match files +with the name Makefile, the { glob = ".git/config" } config would match +config files in .git directories, and the { glob = ".github/workflows/*.yaml" } +config would match any yaml files in .github/workflow directories. Note +that globs should always use the Unix path separator / even on Windows systems; +the matcher will automatically take the machine-specific separators into account. +If the glob isn't an absolute path or doesn't already start with a glob prefix, +*/ will automatically be added to ensure it matches for any subdirectory.
    8. +
    9. Extension: if there are no glob matches, any file-types string that matches +the file extension of a given file wins. In the example above, the "toml" +config matches files like Cargo.toml or languages.toml.

    Language Server configuration

    Language servers are configured separately in the table language-server in the same file as the languages languages.toml

    For example:

    [language-server.mylang-lsp]
    -command = "mylang-lsp"
    -args = ["--stdio"]
    +command = "mylang-lsp"
    +args = ["--stdio"]
     config = { provideFormatter = true }
    -environment = { "ENV1" = "value1", "ENV2" = "value2" }
    +environment = { "ENV1" = "value1", "ENV2" = "value2" }
     
     [language-server.efm-lsp-prettier]
    -command = "efm-langserver"
    +command = "efm-langserver"
     
     [language-server.efm-lsp-prettier.config]
     documentFormatting = true
    -languages = { typescript = [ { formatCommand ="prettier --stdin-filepath ${INPUT}", formatStdin = true } ] }
    +languages = { typescript = [ { formatCommand ="prettier --stdin-filepath ${INPUT}", formatStdin = true } ] }
     

    These are the available options for a language server.

    @@ -2227,15 +2324,16 @@ languages = { typescript = [ { formatCommand ="prettier --stdin-filepath ${ - + +
    KeyDescription
    argsA list of arguments to pass to the language server binary
    configLSP initialization options
    timeoutThe maximum time a request to the language server may take, in seconds. Defaults to 20
    environmentAny environment variables that will be used when starting the language server { "KEY1" = "Value1", "KEY2" = "Value2" }
    environmentAny environment variables that will be used when starting the language server { "KEY1" = "Value1", "KEY2" = "Value2" }
    required-root-patternsA list of glob patterns to look for in the working directory. The language server is started if at least one of them is found.

    A format sub-table within config can be used to pass extra formatting options to Document Formatting Requests. For example, with typescript:

    [language-server.typescript-language-server]
    -# pass format options according to https://github.com/typescript-language-server/typescript-language-server#workspacedidchangeconfiguration omitting the "[language].format." prefix.
    -config = { format = { "semicolons" = "insert", "insertSpaceBeforeFunctionParenthesis" = true } }
    +# pass format options according to https://github.com/typescript-language-server/typescript-language-server#workspacedidchangeconfiguration omitting the "[language].format." prefix.
    +config = { format = { "semicolons" = "insert", "insertSpaceBeforeFunctionParenthesis" = true } }
     

    Configuring Language Servers for a language

    The language-servers attribute in a language tells helix which language servers are used for this language.

    @@ -2247,13 +2345,13 @@ it's often useful to only enable/disable certain language-server features for th so everything else should be handled by the typescript-language-server (which is configured by default). The language configuration for typescript could look like this:

    [[language]]
    -name = "typescript"
    -language-servers = [ { name = "efm-lsp-prettier", only-features = [ "format" ] }, "typescript-language-server" ]
    +name = "typescript"
    +language-servers = [ { name = "efm-lsp-prettier", only-features = [ "format" ] }, "typescript-language-server" ]
     

    or equivalent:

    [[language]]
    -name = "typescript"
    -language-servers = [ { name = "typescript-language-server", except-features = [ "format" ] }, "efm-lsp-prettier" ]
    +name = "typescript"
    +language-servers = [ { name = "typescript-language-server", except-features = [ "format" ] }, "efm-lsp-prettier" ]
     

    Each requested LSP feature is prioritized in the order of the language-servers array. For example, the first goto-definition supported language server (in this case typescript-language-server) will be taken for the relevant LSP request (command goto_definition). @@ -2284,8 +2382,8 @@ If a language server itself doesn't support a feature, the next language server

    The source for a language's tree-sitter grammar is specified in a [[grammar]] section in languages.toml. For example:

    [[grammar]]
    -name = "mylang"
    -source = { git = "https://github.com/example/mylang", rev = "a250c4582510ff34767ec3b7dcdd3c24e8c8aa68" }
    +name = "mylang"
    +source = { git = "https://github.com/example/mylang", rev = "a250c4582510ff34767ec3b7dcdd3c24e8c8aa68" }
     

    Grammar configuration takes these keys:

    @@ -2305,9 +2403,9 @@ git repository:

    You may use a top-level use-grammars key to control which grammars are fetched and built when using hx --grammar fetch and hx --grammar build.

    # Note: this key must come **before** the [[language]] and [[grammar]] sections
    -use-grammars = { only = [ "rust", "c", "cpp" ] }
    +use-grammars = { only = [ "rust", "c", "cpp" ] }
     # or
    -use-grammars = { except = [ "yaml", "json" ] }
    +use-grammars = { except = [ "yaml", "json" ] }
     

    When omitted, all grammars are fetched and built.

    Guides

    @@ -2393,7 +2491,7 @@ for example).

    KeyDescription
    comment.around
    -

    Example query files can be found in the helix GitHub repository.

    +

    Example query files can be found in the helix GitHub repository.

    Queries for textobject based navigation

    Tree-sitter based navigation in Helix is done using captures in the following order:

    @@ -2416,6 +2514,14 @@ the capture.

    Note that it matters where these added indents begin. For example, multiple indent level increases that start on the same line only increase the total indent level by 1. See Capture types.

    +

    By default, Helix uses the hybrid indentation heuristic. This means that +indent queries are not used to compute the expected absolute indentation of a +line but rather the expected difference in indentation between the new and an +already existing line. This difference is then added to the actual indentation +of the already existing line. Since this makes errors in the indent queries +harder to find, it is recommended to disable it when testing via +:set indent-heuristic tree-sitter. The rest of this guide assumes that +the tree-sitter heuristic is used.

    Indent queries

    When Helix is inserting a new line through o, O, or <ret>, to determine the indent level for the new line, the query in indents.scm is run on the @@ -2510,7 +2616,7 @@ actually have been extended). // 3x @outdent }

    ((block) @indent)
    -["}" ")"] @outdent
    +["}" ")"] @outdent
     

    Note how on the second line, we have two blocks begin on the same line. In this case, since both captures occur on the same line, they are combined and only @@ -2550,7 +2656,7 @@ whitespace-sensitive.

    the cursor on a line feed ends up being the entire inside of the class. Because of this, it will miss the entire function node and its indent capture, leading to an indent level one too small.

    -

    To address this case, @extend tells helix to "extend" the captured node's span +

    To address this case, @extend tells helix to "extend" the captured node's span to the line feed and every consecutive line that has a greater indent level than the line of the node.

    (parenthesized_expression) @indent
    @@ -2658,7 +2764,7 @@ similar to how #set! declarations work:

    )

    The number of arguments depends on the predicate that's used. -Each argument is either a capture (@name) or a string ("some string"). +Each argument is either a capture (@name) or a string ("some string"). The following predicates are supported by tree-sitter:

    • @@ -2671,6 +2777,11 @@ The first argument (a capture) must/must not be equal to the second argument The first argument (a capture) must/must not match the regex given in the second argument (a string).

    • +
    • +

      #any-of?/#not-any-of?: +The first argument (a capture) must/must not be one of the other arguments +(strings).

      +

    Additionally, we support some custom predicates for indent queries:

      @@ -2705,21 +2816,21 @@ This scope applies to the whole captured node. This is only different from
      #![allow(unused)]
       fn main() {
       fn aha() { // โ†โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
      -  let take = "on me";  // โ†โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ  scope:  โ”‚
      -  let take = "me on";             //     โ”œโ”€ "tail"  โ”œโ”€ (block) @indent
      +  let take = "on me";  // โ†โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ  scope:  โ”‚
      +  let take = "me on";             //     โ”œโ”€ "tail"  โ”œโ”€ (block) @indent
         let ill = be_gone_days(1 || 2); //     โ”‚          โ”‚
      -} // โ†โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€ "}" @outdent
      -                                         //                scope: "all"
      +} // โ†โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€ "}" @outdent
      +                                         //                scope: "all"
       }

      We can write the following query with the #set! declaration:

      ((block) @indent
      - (#set! "scope" "tail"))
      -("}" @outdent
      - (#set! "scope" "all"))
      + (#set! "scope" "tail"))
      +("}" @outdent
      + (#set! "scope" "all"))
       
      -

      As we can see, the "tail" scope covers the node, except for the first line. +

      As we can see, the "tail" scope covers the node, except for the first line. Everything up to and including the closing brace gets an indent level of 1. -Then, on the closing brace, we encounter an outdent with a scope of "all", which +Then, on the closing brace, we encounter an outdent with a scope of "all", which means the first line is included, and the indent level is cancelled out on this line. (Note these scopes are the defaults for @indent and @outdentโ€”they are written explicitly for demonstration.)

      @@ -2729,7 +2840,7 @@ In addition to the ((string_expression (string_fragment) @injection.content) - (#set! injection.language "bash")) + (#set! injection.language "bash"))

      Capture Types

        @@ -2787,6 +2898,10 @@ The first argument (a capture) must be equal to the second argument The first argument (a capture) must match the regex given in the second argument (a string).

        +
      • +

        #any-of? (standard): +The first argument (a capture) must be one of the other arguments (strings).

        +

      Adding Rainbow Bracket Queries

      Helix uses rainbows.scm tree-sitter query files to provide rainbow bracket @@ -2805,7 +2920,7 @@ language itself. These queries will go into a runtime/queries/tsq/rainbows.scm file in the repository root.

      First we'll add the @rainbow.bracket captures. TSQ only has parentheses and square brackets:

      -
      ["(" ")" "[" "]"] @rainbow.bracket
      +
      ["(" ")" "[" "]"] @rainbow.bracket
       

      The ordering of the nodes within the alternation (square brackets) is not taken into consideration.

      @@ -2816,7 +2931,7 @@ names of rules in the grammar. Brackets are usually written in tree-sitter grammars as literal strings, for example:

      {
         // ...
      -  arguments: seq("(", repeat($.argument), ")"),
      +  arguments: seq("(", repeat($.argument), ")"),
         // ...
       }
       
      @@ -2863,7 +2978,7 @@ indirect descendants of some node captured with @rainbow.scope.

      If we want to highlight the <, > and </ nodes with rainbow colors, we capture them as @rainbow.bracket:

      -
      ["<" ">" "</"] @rainbow.bracket
      +
      ["<" ">" "</"] @rainbow.bracket
       

      And we capture (element) as @rainbow.scope because (element) nodes nest within each other: they increment the nesting level and switch to the next -- cgit v1.2.3-70-g09d2