-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_vimperatorrc
executable file
·258 lines (211 loc) · 7.76 KB
/
_vimperatorrc
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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Name: _vimperatorrc
"
" Summary: Generic Vimperator rc file
"
" Replicate .vimrc where possible
"
" C:\Progra~1\Mozill~1\firefox.exe -vimperator "+u 'c:\cygwin\home\bheckel\.vimperatorrc'"
" C:\Program Files\Mozilla Firefox\firefox.exe" -vimperator "+u 'u:\code\misccode\_vimperatorrc'"
" C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -vimperator "+u 'u:\code\misccode\_vimperatorrc'"
"
" :so u:/code/misccode/_vimperatorrc
" :so u:\\code\\misccode\\_vimperatorrc
"
" Created: Mon 15 Oct 2007 11:21:26 (Bob Heckel)
" Modified: Sun 13 Jul 2014 13:14:17 (Bob Heckel)
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""
" Abbreviations
" E.g. :o g searchme
"""""""""""""""""""""""""
"""cabbrev b open bing
cabbrev g open google
"""cabbrev w open wikipedia
"""cabbrev y open yahoo
"""""""""""""""""""""""""
" Options
"""""""""""""""""""""""""
set complete=Sfs
"""set wildmode=list:full
" :mes[sages] if miss it
set messagetimeout=750
" See ,t
"""set guioptions=TrB
" Time allowed to disambiguate hint 1 vs 10, 2 vs 200 etc
"""set hinttimeout=1000
" Case sensitive if use capitals. Must use together if using smartcase.
"""set ignorecase
"""set smartcase
" Open these in a new tab (but see popups)
set newtab=addons,downloads,help,prefs
"""set nextpattern='Next Page »,\bnext,^>$,^(>>|»)$,^(>|»),(>|»)$,\bmore\b'
" So that a right click in the gutter will allow a new tab w/o keyboarding
"""set showtabline=2
"""""""""""""""""""""""""
" JavaScript
"""""""""""""""""""""""""
" :js preview()
"""javascript <<EOF
"""pp = function () {
""" PrintUtils.printPreview();
"""};
"""EOF
" Used by maps below
:js << EOF
toggle_element = function (name) {
document.getElementById(name).collapsed ^= 1;
}
EOF
" TODO how to call this from FF?
"""javascript <<EOF2
"""cbx = function () {
""" var allInputs = document.getElementsByTagName("input");
""" for (var i=0, max=allInputs.length; i<max; i++){
""" if (allInputs[i].type === 'checkbox')
""" // Toggle
""" if (allInputs[i].checked == false) {
""" allInputs[i].checked = true;
""" } else {
""" allInputs[i].checked = false;
""" }
""" }
"""}
"""EOF2
"""""""""""""""""""""""""
" Maps
"""""""""""""""""""""""""
map <F1> :echo "_vimperatorrc\n:us[age]\n:dia history\n:dia printpreview\n:downl\n:emenu\n:mes[sages]\n:se[t] all\n:pref[erences]\n:pref!\n:res[tart]\n:addo[ns]\n:dia console\nTAB and Shift-Tab to view choices, c for caret mode"<CR>
" Toggle fullscreen like many other apps
map <F11> :set invfs<CR>
"""map <F12> :qa<CR>
" Toggle usermode CSS display
map \\ :set invum<CR>
" ALT-less arrow key navigation. I rarely need to navigate using left-right keys in a webpage.
map <Right> gt
map <Left> gT
" Reorder/move current tab left/right
map <S-Right> :tabmove! +1<CR>
map <C-Right> :tabmove! +1<CR>
map <S-Left> :tabmove! -1<CR>
map <C-Left> :tabmove! -1<CR>
map <C-Q> :echomsg 'noop'<CR>
" Easier navigation (but harder left-right page scrolling)
noremap h H
noremap l L
noremap H h
noremap L l
" Speed up movements, we don't need precision in a browser like we do in vim
noremap k 3k
noremap j 3j
noremap T :tabduplicate
noremap <C-e> 3<C-e>
noremap <C-y> 3<C-y>
" Too risky, will just use multiple 'd's
map D <Nop>
" Not consistent with Vim so eliminate
map M <Nop>
""""""""""""
" Comma Maps
" Reserve comma maps for GUI controls
map ,c :dialog console<CR>
" In a new tab, not its own window
map ,d :downloads<CR>
"""map ,g :t https://mail.google.com<CR>
"""map ,h :sidebar history<CR>
map ,h :dia history<CR>
" Mnemonic (m)enubar
"""map <silent> ,m :js toggle_element('toolbar-menubar')<CR>
" 12-Mar-13 not working
"""map ,m :js toggle_element('toolbar-menubar')<CR>
map ,p :dia printpreview<CR>
" Mnemonic toggle (t)oolbar
map <silent> ,t :js toggle_element('PersonalToolbar')<CR>
" TODO hostname detection
"""map <silent> ,s :source $HOME/code/misccode/_vimperatorrc
map <silent> ,s :source u:/code/misccode/_vimperatorrc
" Reserve semicolon maps for commandline controls
" bmarks are hard to reach in vimperator, can't just tab to reach them
map ;b :bmarks<CR>
" Mnemonic like my vim map
map ;l :buffers<CR>
" Mnemonic like my shell 'alias cdp cd ~/code/perl':
map ;c o file:///u:/code/c/
map ;h o file:///u:/code/html/
map ;m o file:///u:/code/misccode/
map ;p o file:///u:/code/perl/
map ;r o file:///u:/code/readme/
map ;s o file:///u:/code/sas/
" NEXT/PREV links
map . ]]
"""map ,n ]]
"""map ,p [[
" :q! is actually the command when :q is used. :wq or ZZ to save tabs for next time
"""map ,qq :quitall<CR>
"""""""""""""""""""""""""
" Highlighting
" hi[ghlight] clear {group}
"""""""""""""""""""""""""
"""highlight! Bell color:grey; background-color:grey
highlight StatusLine color:white; background-color:#0066FF; font-family:monospace; font-size:11px
" 'Executing Location Change' etc.
highlight InfoMsg color:white; background-color:gray; font-family:monospace; font-size:12px
highlight CmdLine color:white; background-color:black; font-family:monospace; font-size:11px
"""highlight Hint font-family:monospace; font-size:13px; font-weight:bold; color:white; background-color:red; border-color:ButtonShadow; border-width:0px
"""highlight Hint font-family:monospace; font-size:14px; font-weight:bold; color:white; background-color:red; border-color:ButtonShadow; border-width:0px
" C:\Documents and Settings\rsh86800\vimperator\colors\
"""colorscheme zenburn
"""""""""""""""""""""""""
" Commands
"""""""""""""""""""""""""
"""command -nargs=* Goo open google <args>
"""""""""""""""""""""""""
" about:config overrides
"""""""""""""""""""""""""
"""set! browser.urlbar.maxRichResults=6
"""set! keywordlURL="http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=navclient&gfns=1&q="
"""""""""""""""""""""""""
" Hide statusbar
"""""""""""""""""""""""""
noremap <silent> <F8> :js toggle_bottombar()<CR>
noremap : :js toggle_bottombar('on')<CR>:
noremap o :js toggle_bottombar('on')<CR>o
noremap O :js toggle_bottombar('on')<CR>O
noremap t :js toggle_bottombar('on')<CR>t
noremap T :js toggle_bottombar('on')<CR>t
noremap / :js toggle_bottombar('on')<CR>/
cnoremap <CR> <CR>:js toggle_bottombar('off')<CR>
cnoremap <Esc> <Esc>:js toggle_bottombar('off')<CR>
:js << EOF
function toggle_bottombar(p) {
var bb = document.getElementById('liberator-bottombar');
if (!bb)
return;
if (p == 'on'){
bb.style.height = '';
bb.style.overflow = '';
return;
}
if (p == 'off'){
bb.style.height = '0px';
bb.style.overflow = 'hidden';
return;
}
bb.style.height = (bb.style.height == '') ? '0px' : '';
bb.style.overflow = (bb.style.height == '') ? '' : 'hidden';
}
toggle_bottombar();
EOF
"""""""""""""""""""""""""
" Autocommands
"""""""""""""""""""""""""
" All Google pages except Google [s]earch, [n]ews, [a]pis
"""autocmd LocationChange .* js modes.passAllKeys = /google\.com\/[^s|n|a]/.test(buffer.URL)
autocmd LocationChange .* js modes.passAllKeys = false
autocmd LocationChange mail\\.google\\.com js modes.passAllKeys = true
autocmd LocationChange www\\.google\\.com/calendar js modes.passAllKeys = true
autocmd LocationChange www\\.google\\.com/reader js modes.passAllKeys = true
autocmd LocationChange drive\\.google\\.com js modes.passAllKeys = true
autocmd LocationChange docs\\.google\\.com js modes.passAllKeys = true
autocmd LocationChange koding\\.com/Terminal js modes.passAllKeys = true
echomsg 'code/misccode/_vimperatorrc sourced'