forked from ChrisThackrey/helix-conf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.toml
151 lines (129 loc) · 6.23 KB
/
config.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
theme = "embark"
[editor]
line-number = "relative"
mouse = true
cursorline = true
color-modes = true
[editor.lsp]
display-messages = true
[editor.cursor-shape]
insert = "bar"
normal = "block"
select = "block"
[editor.indent-guides]
render = true
[editor.statusline]
left = ["mode", "file-name"]
center = ["position-percentage"]
right = ["diagnostics", "selections", "position"]
[keys.normal]
"ret" = ["open_below", "normal_mode"] # Maps the enter key to open_below then re-enter normal mode
"A-ret" = ["open_above", "normal_mode"] # Maps the enter key to open_above then re-enter normal mode
"A-;" = ["save_selection", "insert_at_line_end", ":append-output echo ';'", "delete_char_forward", "jump_backward", "normal_mode"]
"backspace" = { c = ":config-open", l = ":config-reload", r = ":sh cargo run", s = [":write", ":config-reload"] }
# Quick iteration on config changes
C-o = ":config-open"
C-r = ":config-reload"
# Some nice Helix stuff
C-h = "select_prev_sibling"
C-j = "shrink_selection"
C-k = "expand_selection"
C-l = "select_next_sibling"
# Personal preference
o = ["open_below", "normal_mode"]
O = ["open_above", "normal_mode"]
# Muscle memory
"{" = ["goto_prev_paragraph", "collapse_selection"]
"}" = ["goto_next_paragraph", "collapse_selection"]
0 = "goto_line_start"
"$" = "goto_line_end"
"^" = "goto_first_nonwhitespace"
# "G" = "goto_last_line"
G = "goto_file_end"
"%" = "match_brackets"
V = ["select_mode", "extend_to_line_bounds"]
C = ["collapse_selection", "extend_to_line_end", "change_selection"] # Requires https://github.com/helix-editor/helix/issues/2051#issuecomment-1140358950
D = ["extend_to_line_end", "delete_selection"]
S = "surround_add" # Would be nice to be able to do something after this but it isn't chainable
# Extend and select commands that expect a manual input can't be chained
# I've kept d[X] commands here because it's better to at least have the stuff you want to delete
# selected so that it's just a keystroke away to delete
d = { d = ["extend_to_line_bounds", "delete_selection"], t = ["extend_till_char"], s = ["surround_delete"], i = ["select_textobject_inner"], a = ["select_textobject_around"] }
# Clipboards over registers ye ye
x = "delete_selection"
p = "paste_clipboard_after"
P = "paste_clipboard_before"
# Would be nice to add ya and yi, but the surround commands can't be chained
y = ["yank_main_selection_to_clipboard", "normal_mode", "flip_selections", "collapse_selection"]
Y = ["extend_to_line_bounds", "yank_main_selection_to_clipboard", "goto_line_start", "collapse_selection"]
# Uncanny valley stuff, this makes w and b behave as they do Vim
w = ["move_next_word_start", "move_char_right", "collapse_selection"]
e = ["move_next_word_end", "collapse_selection"]
b = ["move_prev_word_start", "collapse_selection"]
# If you want to keep the selection-while-moving behaviour of Helix, this two lines will help a lot,
# especially if you find having text remain selected while you have switched to insert or append mode
#
# There is no real difference if you have overriden the commands bound to 'w', 'e' and 'b' like above
# But if you really want to get familiar with the Helix way of selecting-while-moving, comment the
# bindings for 'w', 'e', and 'b' out and leave the bindings for 'i' and 'a' active below. A world of difference!
i = ["insert_mode", "collapse_selection"] # Requires https://github.com/helix-editor/helix/issues/2052#issuecomment-1140358950
a = ["append_mode", "collapse_selection"] # Requires https://github.com/helix-editor/helix/issues/2052#issuecomment-1140358950
# Escape the madness! No more fighting with the cursor! Or with multiple cursors!
esc = ["collapse_selection", "keep_primary_selection"]
[keys.insert]
# Escape the madness! No more fighting with the cursor! Or with multiple cursors!
esc = ["collapse_selection", "normal_mode"]
"up" = "move_line_up"
"down" = "move_line_down"
"left" = "move_char_left"
"right" = "move_char_right"
"C-b" = "move_char_left"
"C-f" = "move_char_right"
"A-b" = "move_prev_word_end"
"C-left" = "move_prev_word_end"
"A-f" = "move_next_word_start"
"C-right" = "move_next_word_start"
"A-<" = "goto_file_start"
"A->" = "goto_file_end"
"pageup" = "page_up"
"pagedown" = "page_down"
"home" = "goto_line_start"
"C-a" = "goto_line_start"
"end" = "goto_line_end_newline"
"C-e" = "goto_line_end_newline"
# "A-;" = ["normal_mode", "collapse_selection", "save_selection", "extend_to_line_bounds", "trim_selections", "collapse_selection", ":append-output echo ';'", "extend_line_below", "join_selections", "jump_backward", "insert_mode"]
"A-;" = ["save_selection", "insert_at_line_end", ":append-output echo ';'", "delete_char_forward", "jump_backward"]
"A-left" = "goto_line_start"
j = { j = "normal_mode", k = "normal_mode" }
[keys.select]
# Muscle memory
"{" = ["extend_to_line_bounds", "goto_prev_paragraph"]
"}" = ["extend_to_line_bounds", "goto_next_paragraph"]
0 = "goto_line_start"
"$" = "goto_line_end"
"G" = "goto_last_line"
"^" = "goto_first_nonwhitespace"
D = ["extend_to_line_bounds", "delete_selection", "normal_mode"]
C = ["goto_line_start", "extend_to_line_bounds", "change_selection"]
"%" = "match_brackets"
S = "surround_add" # Basically 99% of what I use vim-surround for
# Visual-mode specific muscle memory
i = "select_textobject_inner"
a = "select_textobject_around"
x = "delete_selection"
# Some extra binds to allow us to insert/append in select mode because it's nice with multiple cursors
tab = ["insert_mode", "collapse_selection"] # tab is read by most terminal editors as "C-i"
C-a = ["append_mode", "collapse_selection"]
# Make selecting lines in visual mode behave sensibly
k = ["extend_line_up", "extend_to_line_bounds"]
j = ["extend_line_down", "extend_to_line_bounds"]
# Clipboards over registers ye ye
d = ["yank_main_selection_to_clipboard", "delete_selection"]
# x = ["yank_main_selection_to_clipboard", "delete_selection"]
y = ["yank_main_selection_to_clipboard", "normal_mode", "flip_selections", "collapse_selection"]
# "Y" = ":clipboard-yank"
Y = ["extend_to_line_bounds", "yank_main_selection_to_clipboard", "goto_line_start", "collapse_selection", "normal_mode"]
p = "replace_selections_with_clipboard" # No life without this
P = "paste_clipboard_before"
# Escape the madness! No more fighting with the cursor! Or with multiple cursors!
esc = ["collapse_selection", "keep_primary_selection", "normal_mode"]