Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
272 lines (229 sloc) 11.7 KB
" 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
"---------------------------------------------------------------------------}}}