-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathvimperatorrc
271 lines (229 loc) · 11.7 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
259
260
261
262
263
264
265
266
267
268
269
270
271
" vim: set ft=vimperator
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" _ _ "
" __ _(_)_ __ ___ _ __ ___ _ __ __ _| |_ ___ _ __ _ __ ___ "
" \ \ / / | '_ ` _ \| '_ \ / _ \ '__/ _` | __/ _ \| '__| '__/ __| "
" \ V /| | | | | | | |_) | __/ | | (_| | || (_) | | | | | (__ "
" \_/ |_|_| |_| |_| .__/ \___|_| \__,_|\__\___/|_| |_| \___| "
" |_| "
" "
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" written by Shotaro Fujimoto (https://github.com/ssh0)
"------------------------------------------------------------------------------
" vimppm (install and update the plugins) {{{
"------------------------------------------------------------------------------
" see documentation @ https://github.com/cd01/vimppm
" If you use vimppm for the first time, you should run below command before
" restarting firefox or setting this file.
"
" ```sh
" mkdir -p ~/.vimperator/vimppm; cd ~/.vimperator/vimppm
" git clone https://github.com/cd01/vimppm.git
" ```
"
source ~/.vimperator/vimppm/vimppm/plugin/vimppm.js
vimppm "appendAnchor.js"
vimppm "copy.js"
vimppm "PDF.js.js"
vimppm "nicontroller.js"
let g:auto_append_anchor = "true"
"---------------------------------------------------------------------------}}}
" Set options {{{
"------------------------------------------------------------------------------
" completion for history only
set complete=bh
" clean titlestring (Don't show 'Vimperator - ')
set titlestring=
" Don't focus input box when opening new tab
set focuscontent
" set default editor for vim
set editor='urxvt -g 90x15 -title "urxvt_float" -name "urxvt_float" -e nvim'
" activate
set activate=addons,downloads,extoptions,help,homepage,quickmark,paste
" No GUI
set gui=nonavigation
" no close buttons on tabs (abandoned option from Firefox version 31)
" set! browser.tabs.closeButtons=2
" no scrollbar
set noscrollbars
" Set hintcharacter for easily reachable keys
set hintchars=ifjkasdhguonmerwc
" to prevent d on the last tab from closing the window:
set! browser.tabs.closeWindowWithLastTab=false
" Add new tab to the last
set! browser.tabs.insertRelatedAfterCurrent=false
"---------------------------------------------------------------------------}}}
" Appearance {{{
"------------------------------------------------------------------------------
" set colorscheme
" [vimpr/vimperator-colors](https://github.com/vimpr/vimperator-colors)
" git clone https://github.com/vimpr/vimperator-colors.git ~/.vimperator/colors
colorscheme darkness
" Hint font, font-size, and colors
hi Hint font-family: "Droid Sans Mono"; font-size: 12px; font-weight: bold; background-color: #1c1c1c; color: #fefefe; padding: 2px 2px;
hi HintElem background-color:#e4efff; color:;
hi HintActive background-color:#cedef8; color:;
"---------------------------------------------------------------------------}}}
" Key bindings {{{
"------------------------------------------------------------------------------
" completion for history only
" set v and v key for showing tab
noremap v :set<Space>gui=tabs<CR>
noremap V :set<space>gui=navigation<CR>
noremap <F11> :set<Space>gui=nonavigation,notabs<CR>
" scroll more than one line using the j and k keys
" noremap j 3j
" noremap k 3k
" yank the title by "Y"
nnoremap Y :js util.copyToClipboard(buffer.title, true)<CR>
" move between tabs
noremap <A-h> <C-p>
noremap <A-l> <C-n>
noremap <A-Left> <C-p>
noremap <A-Right> <C-n>
" move the tab
noremap <A-S-h> :tabmove! -1<CR>
noremap <A-S-l> :tabmove! +1<CR>
noremap <A-S-Left> :tabmove! -1<CR>
noremap <A-S-Right> :tabmove! +1<CR>
" for with 'Tile Tabs' plugins
" New\Close Layout
nnoremap <A-return> <A-S-F12>
" Untile Tab
nnoremap <A-S-1> <A-S-F4>
" Expand tile
nnoremap <A-f> <A-S-F2>
" Show Properties
" <A-S-F12>
" Sync Scroll
" <A-S-F8>
"
" Tile New Tab
nnoremap <C-A-l> <C-A-Right>
nnoremap <C-A-h> <C-A-Left>
nnoremap <C-A-j> <C-A-Down>
nnoremap <C-A-k> <C-A-Up>
" Tile Duplicate Tab
nnoremap <C-A-S-l> <C-A-S-Right>
nnoremap <C-A-S-h> <C-A-S-Left>
nnoremap <C-A-S-j> <C-A-S-Down>
nnoremap <C-A-S-k> <C-A-S-Up>
" Activate Tile
nnoremap <C-l> <C-Right>
nnoremap <C-h> <C-Left>
nnoremap <C-j> <C-Down>
nnoremap <C-k> <C-Up>
" open undo prompt
nnoremap U :undo<Space>
" more Vim like
cnoremap <C-n> <Tab>
cnoremap <C-p> <S-Tab>
" move cursor in command mode
cnoremap <C-h> <Left>
cnoremap <C-l> <Right>
" cursor move
inoremap <C-h> <Left>
inoremap <C-l> <Right>
" Clear search hilights
nnoremap <ESC> :nohlsearch<CR><ESC>
" :source ~/.vimperatorrc
nnoremap <C-r> :source<Space>~/.vimperatorrc<CR>
" Toggle hide statusbar
" >* [firefox - Hide status line / bottom bar in vimperator? - Super User](http://superuser.com/questions/704015/hide-status-line-bottom-bar-in-vimperator)
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 w :js toggle_bottombar('on')<CR>w
noremap W :js toggle_bottombar('on')<CR>W
noremap / :js toggle_bottombar('on')<CR>/
cnoremap <CR> <CR>:js toggle_bottombar('off')<CR>
cnoremap <C-c> <C-c>:js toggle_bottombar('off')<CR>
cnoremap <Esc> <Esc>:js toggle_bottombar('off')<CR>
cnoremap <C-o> <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('off');
EOF
"---------------------------------------------------------------------------}}}
" Ignorekeys {{{
"------------------------------------------------------------------------------
ignorekeys add plus\\.google\\.com -except f,F,o,t,;,:
ignorekeys add mail\\.google\\.com -except f,F,o,t,;,:
ignorekeys add inbox\\.google\\.com -except F,v,V,:,;
ignorekeys add www\\.google\\.com/calendar -except f,F,o,t,;,:
ignorekeys add twitter\\.com -except F,v,V,d,;,:
ignorekeys add feedly\\.com -except f,F,;,:
" for jupyter notebook
ignorekeys add localhost:8888 -except :
"---------------------------------------------------------------------------}}}
" Bookmarks (for search) {{{
"------------------------------------------------------------------------------
bmark -title="Google - I'm feeling lucky!" -tags=keyword -keyword=l https://www.google.co.jp/search?q=%s&btnI=I
bmark -title="Wikipedia" -tags=keyword -keyword=w https://ja.wikipedia.org/wiki/%s
bmark -title="niconico" -tags=keyword -keyword=n http://www.nicovideo.jp/search/%s
bmark -title="niconico dictionary" -tags=keyword -keyword=nd http://dic.nicovideo.jp/s/al/a/%s
bmark -title="Google image" -tags=keyword -keyword=p http://www.google.com/search?site=imghp&tbm=isch&q=%s
bmark -title="Google Map" -tags=keyword -keyword=m https://www.google.com/maps/place/%s
bmark -title="Google Map Navigation from Home to ***" -tags=keyword -keyword=mfh https://www.google.com/maps/dir/自宅/%s
bmark -title="Google Map Navigation from Work to ***" -tags=keyword -keyword=mfw https://www.google.com/maps/dir/職場/%s
bmark -title="Google Map Navigation from *** to Home" -tags=keyword -keyword=mth https://www.google.com/maps/dir/%s/自宅
bmark -title="Google Map Navigation from *** to Work" -tags=keyword -keyword=mtw https://www.google.com/maps/dir/%s/職場
bmark -title="Google Trends" -tags=keyword -keyword=tr https://www.google.co.jp/trends/explore#q=%s
bmark -title="IP address" -tags=keyword -keyword=ip http://www.ip-adress.com/whois/%s
bmark -title="flickr" -tags=keyword -keyword=f https://www.flickr.com/search/?text=%s&safe_search=3
bmark -title="Youtube" -tags=keyword -keyword=y http://www.youtube.com/results?search_query=%s&sm=3
bmark -title="Yahoo real time search" -tags=keyword -keyword=rt http://realtime.search.yahoo.co.jp/search?p=%s&ei=UTF-8
bmark -title="twitter" -tags=keyword -keyword=tw https://twitter.com/search?f=tweets&vertical=default&src=typd&q=%s
bmark -title="Google Scholar" -tags=keyword -keyword=sc http://scholar.google.co.jp/scholar?as_vis=1&q=%s&hl=ja&as_sdt=1
bmark -title="Qiita" -tags=keyword -keyword=q http://qiita.com/search?q=%s
bmark -title="Github - repo" -tags=keyword -keyword=g https://github.com/search?q=%s
bmark -title="Github - user" -tags=keyword -keyword=gu https://github.com/search?q=%s&type=Users
bmark -title="Github - code" -tags=keyword -keyword=gc https://github.com/search?q=%s&type=Code
bmark -title="Github - code filename" -tags=keyword -keyword=gf https://github.com/search?q=filename:%s&type=Code
bmark -title="Github - topic" -tags=keyword -keyword=gt https://github.com/search?q=topic:%s&type=Repositories
bmark -title="Gist" -tags=keyword -keyword=gs https://gist.github.com/search?utf8=✓&q=%s
bmark -title="translate ja <-> en" -tags=keyword -keyword=t http://ejje.weblio.jp/content/%s
bmark -title="wordnik" -tags=keyword -keyword=wd https://www.wordnik.com/words/%s
bmark -title="Pandas documentation" -tags=keyword -keyword=pd http://pandas.pydata.org/pandas-docs/stable/search.html?q=%s
bmark -title="matplotlib documentation" -tags=keyword -keyword=mpl http://matplotlib.org/search.html?q=%s
bmark -title="Python 2.7 documentation" -tags=keyword -keyword=py2 https://docs.python.org/2.7/search.html?q=%s
bmark -title="Python 3.4 documentation" -tags=keyword -keyword=py3 https://docs.python.org/3.4/search.html?q=%s
bmark -title="8tracks" -tags=keyword -keyword=8tr https://8tracks.com/explore/%s
bmark -title="arxiv" -tags=keyword -keyword=arx http://arxiv.org/find/all/1/all:+%s/0/1/0/all/0/1
bmark -title="Digg" -tags=keyword -keyword="dig" https://digg.com/search?q=%s
bmark -title="duckduckgo" -tags=keyword -keyword=dg https://duckduckgo.com/?q=%s
bmark -title="Gmail" -tags=keyword -keyword=gm https://mail.google.com/mail/u/0/#search/%s
bmark -title="Google Plus" -tags=keyword -keyword=gg https://plus.google.com/s/%s/top
bmark -title="Hacker News" -tags=keyword -keyword=hn https://hn.algolia.com/?q=%s
bmark -title="Pinterest" -tags=keyword -keyword=pin https://www.pinterest.com/search/pins/?q=%s
bmark -title="Reddit" -tags=keyword -keyword=reddit https://www.reddit.com/search?q=%s
bmark -title="SoundCloud" -tags=keyword -keyword=sdc https://soundcloud.com/search?q=%s
bmark -title="Stackoverflow" -tags=keyword -keyword=stack https://stackoverflow.com/search?q=%s
bmark -title="Torentz" -tags=keyword -keyword=tor https://www.torrentz.eu/search?q=%s
bmark -title="Anitube.se" -tags=keyword -keyword=ani http://www.anitube.se/search/?search_id=%s
bmark -title="Facebook" -tags=keyword -keyword=fb https://www.facebook.com/search/top/?q=%s
bmark -title="Instagram" -tags=keyword -keyword=in https://www.instagram.com/explore/tags/%s
"---------------------------------------------------------------------------}}}
" set local settings {{{
"------------------------------------------------------------------------------
source! $HOME/.vimperatorrc.local
"---------------------------------------------------------------------------}}}