Helix
A Kakoune / Neovim inspired editor, written in Rust.
- Vim-like modal editing
- Multiple selections
- Built-in language server support
- Smart, incremental syntax highlighting and code editing via tree-sitter
Keymap
Keymap
Migrating from Vim
helix/helix-term/src/commands.rs
Normal mode
Movement
hjkl左下上右bweftctrl-b/fpageup/downctrl-u/dhalf pageup/downctrl-i/ojump forward/backward
Changes
r~switch case- ` lower case
iaoOuUypP<>=d Alt-dc Alt-cCtrl-a/xqQ
Shell
Selection manipulation
sS Alt-s&_; Alt-;, Alt-,C Alt-C()%select entire filexXselect current lineJ Alt-Jjoin linesK Alt-KCtrl-ccomment/uncommentAlt-up/down/left/right
Search
/?nN*
Minor modes
| Key | Description | Command |
|---|---|---|
v | Enter select (extend) mode | select_mode |
g | Enter goto mode | N/A |
m | Enter match mode | N/A |
: | Enter command mode | command_mode |
z | Enter view mode | N/A |
Z | Enter sticky view mode | N/A |
Ctrl-w | Enter window mode | N/A |
Space | Enter space mode | N/A |
Insert mode
Select/extend mode
Commands
Config
theme = "monokai_pro_octagon"
[editor]
color-modes = true
bufferline = "multiple"
default-line-ending = "lf"
cursorline = true
line-number = "relative"
#workspace-lsp-roots = ["~/Workspace"]
[editor.cursor-shape]
insert = "bar"
normal = "block"
select = "underline"
[editor.statusline]
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 = "│"
[editor.whitespace.render]
# space = "all"
tab = "all"
nbsp = "none"
nnbsp = "none"
newline = "none"
[editor.whitespace.characters]
space = "·"
nbsp = "⍽"
nnbsp = "␣"
tab = "→"
newline = "⏎"
tabpad = "·" # Tabs will look like "→···" (depending on tab width)
[editor.indent-guides]
# render = true
character = "╎" # Some characters that work well: "▏", "┆", "┊", "⸽"
skip-levels = 1
[editor.soft-wrap]
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
[keys.normal]
S-left = "extend_char_left"
S-right = "extend_char_right"
S-up = "extend_line_up"
S-down = "extend_line_down"
S-A-left = "extend_prev_word_start"
S-A-right = "extend_next_word_start"
# A-left = "move_prev_word_start"
# A-right = "move_next_word_end"
A-j = ["extend_to_line_bounds", "delete_selection", "paste_after"]
A-k = ["extend_to_line_bounds", "delete_selection", "move_line_up", "paste_before"]
#d = { d = ["extend_to_line_bounds", "delete_selection"] }
"C-/" = "toggle_comments"
[keys.insert]
#j = { k = "normal_mode" }
S-left = "extend_char_left"
S-right = "extend_char_right"
S-up = "extend_line_up"
S-down = "extend_line_down"
C-a = "goto_line_start"
C-e = "goto_line_end"
# A-w = "yank"
# C-w = ["yank", "delete_selection"]
# C-y = "paste_after"
LSP
Language Server Configurations · helix-editor/helix Wiki · GitHub
[[language]]
name = "python"
file-types = ["py"]
comment-tokens = "#"
indent = { tab-width = 4 }
language-servers = [ "pyright", "ruff" ]
[language-server.pyright.config.python.analysis]
typeCheckingMode = "basic"
[language-server.ruff]
command = "ruff-lsp"
[language-server.ruff.config.settings]
args = ["--ignore", "E501"]
[language.formatter]
command = "black"
args = ["--line-length", "88", "--quiet", "-"]
Plugins
暂不支持 Plugin system · helix-editor/helix · Discussion #3806 · GitHub
Tips
复制到系统剪切板
<space>y
全选
%
跳到文首文尾
gg ge
删除字符、行
单个字符: d
一行: xd
hlsearch
不支持?
列编辑
C Alt-C , 退出