-
Notifications
You must be signed in to change notification settings - Fork 10
/
emacs_bindings
154 lines (135 loc) · 4.6 KB
/
emacs_bindings
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
152
153
154
" Set external editor command
set editorcmd emacsclient -a \"\" -c -e '(progn (find-file "%f") (forward-line (1- %l)) (forward-char %c))'
" Unbinding keys used both emacs and vim
unbind w
unbind <C-u>
unbind <C-x>
unbind <C-g>
unbind <C-Space>
" Ctrl-g is your friend (and hardcoded <C-,> of course)
bind --mode=browser <C-g> escapehatch
" Navigation
bind <C-v> scrollpage 1
bind <A-v> scrollpage -1
bind <Backspace> scrollpage -1
bind <A->> scrollto 100
bind <A-<> scrollto 0
bind <C-n> scrollline 10
bind <C-p> scrollline -10
bind <C-u><C-Space> jumpprev
bind n followpage next
bind p followpage prev
" bindings below remains same for
" backward compatibility reasons.
" should be removed some day
bind <C-c><C-n> followpage next
bind <C-c><C-p> followpage prev
" Commands
bind <A-x> fillcmdline_notrail
" Searching
" Fallback solution is / for find and win-G/win-g to select result
bind <C-s> fillcmdline find
bind --mode=ex <C-s> findnext 1
bind --mode=ex <C-r> findnext --reverse
" Hinting
bind f hint
bind <C-u>f hint -b
bind c hint -y
bind w clipboard yank
bind --mode=hint <C-g> hint.reset
bind --mode=hint <C-n> hint.focusBottomHint
bind --mode=hint <C-p> hint.focusTopHint
bind --mode=hint <C-f> hint.focusRightHint
bind --mode=hint <C-b> hint.focusLeftHint
" History
bind F forward
bind r forward
bind B back
bind l back
bind u urlparent
bind t urlroot
" Bookmarks
bind M current_url bmark
bind <C-x>rj fillcmdline bmarks
bind <C-u><C-x>rj fillcmdline bmarks -t
bind <C-x>rm current_url bmark
" Tabs
bind <A-n> tabnext
bind <A-p> tabprev
bind <A-N> tabmove +1
bind <A-P> tabmove -1
bind <C-x>b fillcmdline buffer
bind <C-x>k tabclose
bind <C-x>0 tabclose
bind q tabclose
bind <C-x>1 tabonly
bind <C-x>tp pin
bind <C-x>tm mute toggle
bind <A-g>a tabaudio
bind <C-x>u undo
bind <C-/> undo
" Pages
bind R reload
bind + zoom 0.1 true
bind - zoom -0.1 true
bind = zoom 1
" Frames
bind <C-x>50 winclose
bind <C-x>52 winopen
bind <C-u><C-x>52 winopen -private
" Open links
bind g fillcmdline open
bind <C-u>0g current_url open
bind <C-u>g fillcmdline tabopen
" Textfields
bind --mode=insert <C-d> text.delete_char
bind --mode=insert <C-t> text.transpose_char
bind --mode=insert <A-t> text.transpose_words
bind --mode=insert <A-u> text.upcase_word
bind --mode=insert <A-l> text.downcase_word
bind --mode=insert <A-c> text.capitalize_word
bind --mode=insert <C-k> text.kill_line
bind --mode=insert <A-0><C-k> text.backward_kill_line
bind --mode=insert <C-u>0<C-k> text.backward_kill_line
bind --mode=insert <CS-Backspace> text.kill_whole_line
bind --mode=insert <A-d> text.kill_word
bind --mode=insert <A-Backspace> text.backward_kill_word
bind --mode=insert <C-a> text.beginning_of_line
bind --mode=insert <C-e> text.end_of_line
bind --mode=insert <C-f> text.forward_char
bind --mode=insert <C-b> text.backward_char
bind --mode=insert <A-f> text.forward_word
bind --mode=insert <A-b> text.backward_word
bind --mode=insert <C-n> text.next_line
bind --mode=insert <C-p> text.previous_line
bind --mode=insert <C-y> text.insert_text
bind --mode=insert <C-g> composite unfocus | mode normal
bind --mode=insert <C-x>h js document.activeElement.select()
" Selection
bind <C-Space> hint -h
bind --mode=visual <C-g> composite js document.getSelection().empty(); mode normal; hidecmdline
bind --mode=visual <C-n> js document.getSelection().modify("extend","forward","line")
bind --mode=visual <C-p> js document.getSelection().modify("extend","backward","line")
bind --mode=visual <C-b> js document.getSelection().modify("extend","backward","character")
bind --mode=visual <C-f> js document.getSelection().modify("extend","forward","character")
bind --mode=visual <A-f> js document.getSelection().modify("extend","forward","word")
bind --mode=visual <A-b> js document.getSelection().modify("extend","backward","character"); document.getSelection().modify("extend","backward","word"); document.getSelection().modify("extend","forward","character")
bind --mode=visual <A-w> composite js document.getSelection().toString() | clipboard yank
" Edit field in external editor
bind --mode=insert <C-c><C-c> editor
bind --mode=input <C-c><C-c> editor
" Help
bind <C-h><h> help
bind <C-h><b> fillcmdline help -b
bind <C-h><f> fillcmdline help -e
bind <C-h><v> fillcmdline help -s
" Commands
bind --mode=ex <C-n> ex.next_completion
bind --mode=ex <C-p> ex.prev_completion
bind --mode=ex <A-n> ex.next_history
bind --mode=ex <A-p> ex.prev_history
bind --mode=ex <C-g> ex.hide_and_clear
bind --mode=ex <C-f> text.forward_char
bind --mode=ex <C-b> text.backward_char
" Functions
command emacs-bindings-update source --url https://raw.githubusercontent.com/jumper047/tridactyl_emacs_config/main/emacs_bindings