Skip to content

Latest commit

 

History

History

helix

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

Helix Configuration

Introduction

This is the config for Helix Editor. It’s a command line editor/IDE written in Rust that has syntax highlighting, tree sitter, LSP, multiple cursors support out of the box.

Theme

I like monokai themes

theme = "base16_transparent"

Editor

Basic Setup

Disable mouse mode, enable cursor line for better visibility on where the cursor is and set appropriate idle timeout for code completions to show up after right amount of delay.

[editor]
mouse = false
color-modes = true
cursorline = true
idle-timeout = 40
auto-save = true
bufferline = "multiple"

Cursor Shape

Change cursor shape based on different modes

[editor.cursor-shape]
insert = "bar"
normal = "block"
select = "underline"

File Picker

Ignore hidden files in file picker

[editor.file-picker]
hidden = false

Configure Statusline

Add things on the statusline at appropriate places.

[editor.statusline]
left = ["mode", "spinner", "file-name", "file-type", "total-line-numbers", "file-encoding"]
center = ["selections", "primary-selection-length", "position", "position-percentage"]
right = ["diagnostics", "workspace-diagnostics"]

LSP

[editor.lsp]
display-messages = true

Indent Guides

[editor.indent-guides]
render = true

Prettier Setup

Adding custom prettier to helix helix-editor/helix#3198

formatter = { command = 'npx', args = ["prettier", "--config", ".prettierrc", "--parser", "typescript"] }

Keybindings

Normal mode keybindings

Some keybindings in normal mode so that it’s easy to save and reload buffer.

[keys.normal]
C-s = ":w"
C-r = ":reload"
C-S-up = "expand_selection"
C-S-down = "shrink_selection"
C-n = "move_line_down"
C-p = "move_line_up"
C-j = ":buffer-previous"
C-k = ":buffer-next"
C-e = ["goto_line_end", "move_char_right"]
C-a = "goto_line_start"
D = ["extend_line_below", "delete_selection"]
C-c = ["toggle_comments", "move_line_down"]
esc = ["collapse_selection", "keep_primary_selection"]

[keys.normal.space]
w = ":write"
q = ":quit"
c = ":buffer-close"
C = ":buffer-close-others"

Insert mode keybindings

[keys.insert]
C-s = ":w"
C-f = "move_char_right"
C-b = "move_char_left"
C-c = ["toggle_comments", "move_line_down"]
C-e = ["goto_line_end", "move_char_right"]
C-a = "goto_line_start"
C-n = "move_line_down"
C-p = "move_line_up"