Skip to content

Instantly share code, notes, and snippets.

@calorie
Last active October 11, 2015 17:48
Show Gist options
  • Save calorie/3896134 to your computer and use it in GitHub Desktop.
Save calorie/3896134 to your computer and use it in GitHub Desktop.
vichrome key map
### Sample Settings
# aliases
# in this example you can open extensions page by the command ':ext'
# and Chrome's option page by the command ':option'
alias ext TabOpenNew chrome://extensions/
alias op TabOpenNew chrome://settings/browser
alias dl TabOpenNew chrome://downloads
alias hist TabOpenNew chrome://history
alias clear TabOpenNew chrome://chrome/settings/clearBrowserData
# F for continuous f-Mode
# this is recomended setting but commented out by default.
# if you want to use this setting, use the following
#nmap F :GoFMode --newtab --continuous
# you can use <DISCARD> to discard the key so that chrome's default
# action isn't triggered.
#nmap <BS> <DISCARD>
nmap <C-h> <DISCARD>
imap <C-h> <DISCARD>
cmap <C-h> <DISCARD>
emap <C-h> <DISCARD>
# if you want to change the key used to escape EmergencyMode mode,
# use emap like the following
#emap <ESC> :Escape
emap e <ESC>
nmap e :GoEmergencyMode
## pagecmd offers you page specific key mapping.
# in this example you can use <C-l>, <C-h> for moving between tabs
# on all web pages regardless of your ignored list setting
# because pagecmd has higher priority than ignored URLs.
pagecmd * nmap <C-l> :TabFocusNext
pagecmd * nmap <C-h> :TabFocusPrev
pagecmd * nmap l :TabFocusNext
pagecmd * nmap h :TabFocusPrev
# almost all Vichrome functions don't work properly for pdf contents
# so it's useful to enable default key bindings for pdf file.
pagecmd *.pdf nmap <C-f> <NOP>
# if you want to use twitter web's key binding, write settings like below
#pagecmd http*://twitter.com/* nmap f <NOP>
#pagecmd http*://twitter.com/* nmap r <NOP>
#bookmark
nmap <C-d> <NOP>
#nmap b <NOP>
#nmap B <NOP>
#search
#nmap <C-f> <NOP>
#command
nmap ; :GoCommandMode
#nmap , :GoExtFMode
#scroll
#nmap <Space>j :PageDown
#nmap <Space>k :PageUp
nmap <C-a> :Open javascript:(function(){inc=function(val){n=String(Number(val)+1);while(n.length<val.length)n="0"+n;return%20n;};location.href=decodeURI(location.href).replace(/([0-9]+)([^0-9]*)$/,function(w,a,b){return%20inc(a)+b;});})()
nmap <C-x> :Open javascript:(function(){dec=function(val){n=String(Number(val)-1);while(n.length<val.length)n="0"+n;return%20n;};location.href=location.href.replace(/([0-9]+)([^0-9]*)$/,function(w,a,b){return%20dec(a)+b;});})()
#app
nmap ,tw :TabOpenNew http://www.twitter.com
nmap ,Tw :Open http://www.twitter.com
nmap ,td :TabOpenNew https://tweetdeck.twitter.com/
nmap ,Td :Open https://tweetdeck.twitter.com/
nmap ,gr :TabOpenNew http://www.google.com/reader
nmap ,Gr :Open http://www.google.com/reader
nmap ,gm :TabOpenNew https://mail.google.com/mail/#inbox
nmap ,Gm :Open https://mail.google.com/mail/#inbox
nmap ,hb :TabOpenNew http://calorie001.hatenablog.com/
nmap ,Hb :Open http://calorie001.hatenablog.com/
nmap ,gh :TabOpenNew https://github.com/calorie
nmap ,Gh :Open https://github.com/calorie
nmap ,gi :TabOpenNew https://gist.github.com/
nmap ,Gi :Open https://gist.github.com/
nmap ,so :TabOpenNew http://stackoverflow.com/
nmap ,So :Open http://stackoverflow.com/
nmap ,tu :TabOpenNew http://www.tumblr.com/dashboard
nmap ,Tu :Open http://www.tumblr.com/dashboard
nmap ,nf :TabOpenNew https://mail.nifty.com/mailer/
nmap ,Nf :Open https://mail.nifty.com/mailer/
nmap ,rm :TabOpenNew https://webmail.ritsumei.ac.jp/cgi-bin/start?m=1356548256&wrap=1
nmap ,Rm :Open https://webmail.ritsumei.ac.jp/cgi-bin/start?m=1356548256&wrap=1
nmap ,hp :TabOpenNew http://www.hpcss.is.ritsumei.ac.jp/?main=LabOnly&side=Side
nmap ,Hp :Open http://www.hpcss.is.ritsumei.ac.jp/?main=LabOnly&side=Side
nmap ,nc :TabOpenNew http://www.nicovideo.jp/
nmap ,Nc :Open http://www.nicovideo.jp/
nmap ,fb :TabOpenNew http://www.facebook.com/
nmap ,Fb :Open http://www.facebook.com/
nmap ,db :TabOpenNew https://www.dropbox.com/
nmap ,Db :Open https://www.dropbox.com/
nmap ,pd :TabOpenNew http://www.plug.dj/
nmap ,Pd :Open http://www.plug.dj/
nmap ,yt :TabOpenNew http://www.youtube.com/
nmap ,Yt :Open http://www.youtube.com/
nmap ,qi :TabOpenNew http://qiita.com/
nmap ,Qi :Open http://qiita.com/
nmap ,jl :TabOpenNew http://www.jorudan.co.jp/
nmap ,Jl :Open http://www.jorudan.co.jp/
#nop for tumblr
pagecmd http*://www.tumblr.com/* nmap k <Nop>
pagecmd http*://www.tumblr.com/* nmap j <Nop>
pagecmd http*://www.tumblr.com/* nmap <C-k> :ScrollUp
pagecmd http*://www.tumblr.com/* nmap <C-j> :ScrollDown
pagecmd http*://www.tumblr.com/* nmap r <Nop>
pagecmd http*://www.tumblr.com/* nmap l <Nop>
#nop for github
pagecmd http*://github.com/* nmap ? <Nop>
pagecmd http*://github.com/* nmap l <Nop>
# pagecmd http*://github.com/* nmap s <Nop>
pagecmd http*://github.com/* nmap o <Nop>
pagecmd http*://github.com/* nmap t <Nop>
#nop for tweetdeck
pagecmd http*://tweetdeck.twitter.com* nmap n <Nop>
pagecmd http*://tweetdeck.twitter.com* nmap <ESC> <Nop>
pagecmd http*://tweetdeck.twitter.com* nmap r <Nop>
pagecmd http*://tweetdeck.twitter.com* nmap t <Nop>
pagecmd http*://tweetdeck.twitter.com* nmap f <Nop>
pagecmd http*://tweetdeck.twitter.com* nmap s <Nop>
pagecmd http*://tweetdeck.twitter.com* nmap j <Nop>
pagecmd http*://tweetdeck.twitter.com* nmap k <Nop>
pagecmd http*://tweetdeck.twitter.com* nmap h <Nop>
pagecmd http*://tweetdeck.twitter.com* nmap l <Nop>
#nop for koding
pagecmd http*://koding.com* emap <ESC> <Nop>
pagecmd http*://koding.com* emap e <Nop>
pagecmd http*://koding.com* emap <C-w> <DISCARD>
#nop for facebook
pagecmd http*://www.facebook.com* nmap j <Nop>
pagecmd http*://www.facebook.com* nmap k <Nop>
pagecmd http*://www.facebook.com* nmap <C-k> :ScrollUp
pagecmd http*://www.facebook.com* nmap <C-j> :ScrollDown
# nop for bug
# nmap <C-f> <NOP>
# nmap s <NOP>
# nmap S <NOP>
# nmap / <NOP>
# nmap b <NOP>
# nmap B <NOP>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment