/
colemak.vimperator
223 lines (159 loc) · 5.14 KB
/
colemak.vimperator
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
""" License
"" This software is licensed under the CC0 1.0 Public Domain Dedication, as
"" released by Creative Commons <http://creativecommons.org/publicdomain/zero/1.0/>.
"" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS",
"" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
"" THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
"" NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
"" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
"" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
"" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
"" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
"" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
"" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
" Pentadactyl configuration
" Colemak-vim-based
" Very incomplete
" Instructions:
" Add to your .pentadactyl.rc:
" source /path/to/colemak.vimperator
:colorscheme darkness3
" :colorscheme Mediterranean
:set titlestring="Firefox"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Start command line mode
nnoremap ; :
nnoremap \' :
nnoremap \" :
" Start an extended hint mode
nnoremap , ;
nnoremap y 2k
nnoremap e 2j
nnoremap u 15k
nnoremap n 15j
" nnoremap u <C-u>
" nnoremap n <C-d>
nnoremap tu $
nnoremap tn 0
"amount to scroll with C-u, C-d
set scroll=20
nnoremap <C-n> 4h
nnoremap <C-u> 4l
nnoremap N h
nnoremap U l
nnoremap <C-y> $
nnoremap <C-e> 0
nnoremap te gg
nnoremap ty G
nnoremap tl gg0
nnoremap ti G$
" Tab navigation
nnoremap h <C-p>
nnoremap o <C-n>
nnoremap v :buffer!
" Go back in the browser history
nnoremap l :back<CR>
nnoremap L :back
" Go forward in the browser history
nnoremap i :forward<CR>
nnoremap I :forward
""""""""""""
"Bypass vim search
"noremap / <C-v><C-f>
" nnoremap <C-f> /
nnoremap <C-f> <S-Esc><C-f><S-Esc>
set hlsearch=true
" Find next
nnoremap k n
" Find previous
nnoremap K N
""""""""""""
inoremap <C-n> <C-a>
cnoremap <C-n> <C-a>
"C-o opens up editor
inoremap <C-o> <C-i>
" Undo closing of a tab
nnoremap x u
"" U list closed tabs
nnoremap X :undo<Space>
"Cut
vnoremap <C-x> d
"Copy
"noremap x <yank-word>
" nnoremap c <C-v><C-c>
nnoremap <C-c> <S-Esc><C-c><S-Esc>
"Copy all
inoremap <C-q> <S-Esc><C-a><C-c><S-Esc>
"Paste
"noremap v <C-v><C-v>
nnoremap <C-v> <S-Esc><C-v><S-Esc>
inoremap <C-p> <S-Esc><C-a><C-v><S-Esc>
"Select all
inoremap <C-a> <S-Esc><C-a><S-Esc>
" inoremap <C-s> <S-Esc><C-a><S-Esc>
"Makes sure close tab works e.g. in the address bar
inoremap <C-w> <S-Esc><C-w><S-Esc>
vnoremap <backspace> d
" Copy url link
nnoremap ca ;y
" Copy url
nnoremap cc y
"Close tab
" nnoremap w :tabclose<CR>
nnoremap j :tabclose<CR>
"only way to make compatible with tabclose ordering
nnoremap w <S-Esc><C-w><S-Esc>
nnoremap W :tabdetach<CR>
""""""""""""
" set hintchars=NEOIKUYHL
" set hintchars=hdvkwuyarstneiof
" set hintchars=ntfuwyaoresivkhd\'
set hintchars=ntfuwyaoresivkhd\"
"follow hint as soon as uniquely identified
" set hinttimeout 100
" set hinttags="//input[not(@type='hidden')] | //xhtml:input[not(@type='hidden')] | //a | //xhtml:a | //area | //xhtml:area | //iframe | //xhtml:iframe | //textarea | //xhtml:textarea | //button | //xhtml:button | //select | //xhtml:select | //*[@onclick or @onmouseover or @onmousedown or @onmouseup or @oncommand or @role='link' or @tabindex or @role='button' or contains(@class, 'button') or @contenteditable='' or translate(@contenteditable, 'TRUE', 'true')='true']"
" set hinttags="//input[not(@type='hidden' or @disabled or @readonly)] | //xhtml:input[not(@type='hidden' or @disabled or @readonly)] | //a | //xhtml:a | //area | //xhtml:area | //iframe | //xhtml:iframe | //textarea | //xhtml:textarea | //button | //xhtml:button | //select | //xhtml:select | //*[@onclick or @onmouseover or @onmousedown or @onmouseup or @oncommand or @role='link' or @tabindex or @role='button' or contains(@class, 'button') or @contenteditable='' or translate(@contenteditable, 'TRUE', 'true')='true'] | //area[@href]"
"hint in current tab
nnoremap a ;o
"hint in new tab
nnoremap s ;b
nnoremap ta gg$;o
nnoremap tv G;o
""""""""""""
"Go to url
nnoremap R :tabopen!<Space>
nnoremap ta :tabopen!<Space>
nnoremap r :tabopen<Space>
nnoremap A :winopen<Space>
nnoremap b :open<Space>
nnoremap tr :open<Space>
inoremap <C-t> <S-Esc><C-t><S-Esc>
""""""""""""
" Go to an older position in the jump list
" nnoremap <C-n> <C-o>
" Start caret mode
nnoremap V <S-Esc>
"save object
nnoremap f ;S
"save page
nnoremap ts <S-Esc><C-s><S-Esc>
"save link
nnoremap F ;s
nnoremap tf ;s
""""""""""
"Reload
""""""""""
nnoremap d :reload<CR>
nnoremap D :reload!<CR>
"""""""""""
"Goto clipboard url
"""""""""""
nnoremap p <S-Esc><C-t><C-l><C-v><CR><S-Esc>
nnoremap P <S-Esc><C-l><C-v><CR><S-Esc>
" set insertmode=false
set editor="emacsc"
" au DownloadPost .* !~/bin/cut_with_rgr.zsh "<file>"
set status="input,location,bookmark,history,tabcount,ssl,position"
" set status="input,location,bookmark,history,tabcount,ssl"
" set tabnumbers=true
nnoremap ct c