Helix
- FAQ,
keymap,
repo.
Keyboard prefixes:
A-
Alt+,C-
Control+. - Show whitespace:
:set whitespace.render all
- Tutorial is available as
hx --tutor
or:tutor
. - Open an arbitrary file:
:o
- Modes:
C-w
window (C-w
next window)]
right bracket goto next (]d
diagnostic;]f
function)g
goto (gd
definition;gs
first non-blank in line;gn
next buffer)i
insert (C-c
close popup;C-k
delete to end of line)m
match (mim
select inside matching pair;mi"
select inside double quotes;ms"
surround selection with double quotes);maf
select function definition;mat
select type (class) definition.space
(k
documentation;f
file picker (C-n
next;C-p
previous;C-v
open vertical;C-s
open horizontal))v
visual selectz
view (zt
align to window top)
[n]x
select lines; Undo by switching to visual select and moving.- Tree-sitter:
A-p
(previous),A-o
(extend),A-i
(reduce) andA-n
(next) allow you to move the selection according to its location in the syntax tree. A
insert at end of line;I
insert at first non-whitespace in line.A-;
Goto other end of selection- Deduplicate:
%
;:pipe sort
;:pipe uniq
(wrap selected text::pipe fmt -w 80
) - Create cursor on next line:
C
- Make selection the search string:
*
- Collapse selection onto a single cursor
;
- Swap case:
~
; Lowercase:`
w
start of next word;e
end of current word;b
beginning of current word (WEB
for WORD movement)- Jumplist/history:
C-i
in/forwards;C-o
out/backwards;C-s
add C-c
toggle commentQ
toggle recording;q
play recording- Replace all:
%
select alls
select matches, followed by old string/regex and<CR>
c
replace all with cursors, followed by new string<ESC>,
deactivate and deselect cursors,
collapse multiple cursors down to one.
:insert-output
to run shell command and insert its output.
Configuration
In ~/.config/helix/
:
config.toml
theme = "ahernp"
[editor]
line-number = "relative"
mouse = false
bufferline = "always"
color-modes = true
[editor.cursor-shape]
insert = "bar"
[editor.soft-wrap]
enable = true
[editor.statusline]
left = ["mode", "spinner", "version-control", "file-name", "file-modification-indicator"]
languages.toml
[[language]]
name = "python"
roots = [".git"]
auto-format = true
formatter = {command = 'black', args = ["--quiet", "-"]}
[language-server.pylsp]
config = {pylsp={plugins={pycodestyle={enabled=false},flake8={enabled=true,maxLineLength=120},pyflakes={enabled=false}}}}
[[language]]
name = "html"
auto-format = false
indent = { tab-width = 4, unit = " " }
[[language]]
name = "css"
auto-format = false
indent = { tab-width = 4, unit = " " }
[[language]]
name = "javascript"
auto-format = true
themes/ahernp.toml
inherits = "penumbra+"
"ui.statusline.insert" = { fg = "white", bg = "#FF0000" }
Language servers
Check: hx --health [python|javascript|html|css]
- Python (
pylsp
):pip install python-lsp-server flake8
- Javascript:
sudo npm install -g typescript typescript-language-server
- CSS, HTML and JSON:
sudo npm i -g vscode-langservers-extracted