Skip to content

Instantly share code, notes, and snippets.

@storopoli
Last active July 28, 2025 08:46
Show Gist options
  • Save storopoli/e63b10dafdcc764f2bfe84f75c61e20a to your computer and use it in GitHub Desktop.
Save storopoli/e63b10dafdcc764f2bfe84f75c61e20a to your computer and use it in GitHub Desktop.
Helix Config
theme = "gruvbox_dark_hard_transparent"
[editor]
line-number = "relative"
mouse = true
scrolloff = 8
cursorline = true
rulers = [80]
true-color = true
color-modes = true
completion-trigger-len = 1
idle-timeout = 50
bufferline = "multiple"
[editor.cursor-shape]
insert = "bar"
normal = "block"
select = "underline"
[editor.file-picker]
hidden = false
[editor.statusline]
left = ["mode", "spinner", "version-control"]
center = ["file-name"]
right = [
"workspace-diagnostics",
"selections",
"position-percentage",
"position",
"file-encoding",
"file-type",
]
[editor.indent-guides]
render = true
character = ""
[editor.lsp]
display-messages = true
display-progress-messages = true
display-inlay-hints = true
[keys.normal]
Cmd-s = ":write"
esc = ["collapse_selection", "keep_primary_selection"]
A-x = "extend_to_line_bounds"
X = ["extend_line_up", "extend_to_line_bounds"]
A-g = ":reset-diff-change"
# lazygit integration: https://github.com/helix-editor/helix/discussions/12045
C-g = [
":write-all",
":new",
":insert-output lazygit >/dev/tty",
":set mouse false",
":set mouse true",
":buffer-close!",
":redraw",
":reload-all",
]
# yazi integration: https://github.com/helix-editor/helix/discussions/12934
C-y = [
':sh rm -f /tmp/files2open',
':set mouse false',
':insert-output yazi "%{buffer_name}" --chooser-file=/tmp/files2open',
':redraw',
':set mouse true',
':open /tmp/files2open',
'select_all',
'split_selection_on_newline',
'goto_file',
':buffer-close! /tmp/files2open',
]
# Swap lines up and down
A-j = [
"ensure_selections_forward",
"extend_to_line_bounds",
"extend_char_right",
"extend_char_left",
"delete_selection",
"add_newline_below",
"move_line_down",
"replace_with_yanked",
]
A-k = [
"ensure_selections_forward",
"extend_to_line_bounds",
"extend_char_right",
"extend_char_left",
"delete_selection",
"move_line_up",
"add_newline_above",
"move_line_up",
"replace_with_yanked",
]
[keys.normal.space]
w = ":write"
q = ":quit"
Q = ":quit-all!"
# Generate permalink for current line
# o = [":sh echo \"$(git remote get-url origin | sed 's/\\.git$//' | sed 's/git@github\\.com:/https:\\/\\/github\\.com\\//')/blob/$(git rev-parse HEAD)/%{buffer_name}#L%{cursor_line}\" | pbcopy"]
o = [
":sh echo \"$(git remote get-url origin | sed 's/\\.git$//' | sed 's/git@github\\.com:/https:\\/\\/github\\.com\\//')/blob/$(git rev-parse HEAD)/%{buffer_name}#L%{selection_line_start}-L%{selection_line_end}\" | pbcopy",
]
[keys.select]
X = ["extend_line_up", "extend_to_line_bounds"]
A-x = "extend_to_line_bounds"
A-g = ":reset-diff-change"
[keys.select.space]
# Generate permalink for current selection line range
o = [
":sh echo \"$(git remote get-url origin | sed 's/\\.git$//' | sed 's/git@github\\.com:/https:\\/\\/github\\.com\\//')/blob/$(git rev-parse HEAD)/%{buffer_name}#L%{selection_line_start}-L%{selection_line_end}\" | pbcopy",
]
# ~/.config/helix/themes/gruvbox_dark_hard_transparent.toml
inherits = "gruvbox_dark_hard"
"ui.background" = {}
[[language]]
name = "nix"
formatter = { command = "nixfmt" }
auto-format = true
[[language]]
name = "haskell"
auto-format = true
[[language]]
name = "toml"
formatter = { command = "taplo", args = ["fmt", "-"] }
auto-format = true
[[language]]
name = "python"
language-servers = ["pyright", "ruff"]
formatter = { command = "sh", args = [
"-c",
"ruff format - | ruff check --select I --fix - ",
] }
auto-format = true
[[language]]
name = "bash"
formatter = { command = "shfmt", args = ["-i", "2", "-"] }
auto-format = true
[[language]]
name = "typst"
auto-format = true
[language-server.haskell-language-server.config]
"formattingProvider" = "fourmolu"
cabalFormattingProvider = "cabal-fmt"
[language-server.haskell-language-server.config.plugin]
fourmolu.config.external = true
rename.config.crossModule = true
[language-server.tinymist.config]
tinymist.formatterMode = "typstyle"
[language-server.yaml-language-server.config.yaml.format]
enable = true
[language-server.yaml-language-server.config.yaml.schemas]
kubernetes = "/*.yaml"
"https://json.schemastore.org/github-action.json" = "/.github/**/actions.yml"
"https://json.schemastore.org/github-workflow.json" = "/.github/workflows/*.{yml,yaml}"
[language-server.yaml-language-server.config.yaml.schemaStore]
url = "https://json.schemastore.org/package.json"
@storopoli
Copy link
Author

How to make Helix work with pyright-lsp: microsoft/pyright#9797 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment