-
Notifications
You must be signed in to change notification settings - Fork 0
/
config_local_keybinding.nu
39 lines (35 loc) · 1.04 KB
/
config_local_keybinding.nu
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
# keybindings grid
def kbg [] {
$env.config.keybindings
| sort-by modifier
| upsert name {|r| $"($r.modifier) ($r.keycode) ($r.name)"}
| grid
}
# remove existing keybindings for tab and control n
$env.config.keybindings = ( $env.config.keybindings
| where name != 'completion_menu'
| where name != 'ide_completion_menu'
| where name != 'undo_or_previous_page_menu'
| where name != 'undo_change' ) # control z
# add control j to insert new line
$env.config.keybindings = ({
name : insert_line
modifier : control
keycode : char_j
mode : [emacs, vi_insert, vi_normal]
event: {edit: InsertNewline}
} | append $env.config.keybindings)
# add ide_completion_menu for tab key
$env.config.keybindings = ({
name : tab_ide_completion_menu
modifier : none
keycode : tab
mode : [emacs, vi_insert, vi_normal]
event: {
until: [
{ send: menu name: ide_completion_menu }
{ send: menunext }
{ edit: complete }
]
}
} | append $env.config.keybindings)