Created
August 26, 2015 05:00
-
-
Save localdisk/95629d2ce384c96c2650 to your computer and use it in GitHub Desktop.
vimperatorrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"============================ | |
" General | |
"============================ | |
" 入力欄に自動フォーカスしない | |
set focuscontent | |
" /,? 検索結果をハイライト | |
set hlsearch | |
" :oなどでの補完候補をサーチエンジン、履歴に限定 | |
set complete=lbS | |
" tabを押さなくても補完する | |
"set wildoptions=auto | |
" Hintモードでアルファベット使用 | |
set hintchars=hjklasdfgyuiopqwertnmzxcvb | |
" ツールバーはアドオンとタブのみ表示 | |
set gui=addons,nobookmarks,nomenu,nonavigation,tas | |
" commandモードでIMEオフ | |
style! -name=commandline-ime chrome://* #liberator-commandline-command input {ime-mode: inactive;} | |
" Gmail/LDR/はてブでは新規タブをバックグラウンドで開く | |
autocmd LocationChange '^(?!https?://(mail\.google\.com/(mail|a)/|reader\.livedoor\.com/reader/|b\.hatena\.ne\.jp/(?!(entry|articles|guide))))' :set! browser.tabs.loadDivertedInBackground=false | |
autocmd LocationChange '^https?://(mail\.google\.com/(mail|a)/|reader\.livedoor\.com/reader/|b\.hatena\.ne\.jp/(?!(entry|articles|guide)))' :set! browser.tabs.loadDivertedInBackground=true | |
"set! browser.tabs.loadDivertedInBackground=true | |
"============================ | |
" Key mapping | |
"============================ | |
" 移動幅 | |
noremap j 8j | |
noremap k 8k | |
" タブ移動 | |
nnoremap h <C-p> | |
nnoremap l <C-n> | |
" ブラウザ再起動 | |
nnoremap <C-r> :restart<CR> | |
" OS分岐 | |
" dをブラウザ標準の「タブを閉じる」にマッピング | |
" vimperatorrcのリロード | |
js<<EOM | |
if(liberator.has("MacUnix")) { | |
liberator.execute("map d <M-w>"); | |
liberator.execute("map ,r :source<Space>~/.vimperatorrc<CR>"); | |
} else { | |
liberator.execute("map d <C-w>"); | |
liberator.execute("map ,r :source<Space>~/_vimperatorrc<CR>"); | |
} | |
EOM | |
" google検索を手早くする | |
noremap s :open<Space>google<Space> | |
noremap ,s :tabopen<Space>google<Space> | |
"============================ | |
" colorscheme | |
"============================ | |
" デフォルトのヒント派手すぎ>< | |
hi Hint font-family: Arial; font-size: 21px; font-weight: bold; text-shadow: -1px -1px 2px black, 1px -1px 2px black, -1px 1px 2px black, 1px 1px 2px black; color: #33cccc; | |
hi HintElem color: gray; background-color: #a1e4e6; | |
hi HintActive color: black; background-color: #ff8700; | |
" デフォルトのエラー赤くてこわい>< | |
hi ErrorMsg color:white; background-color: #ec6aa1; | |
"============================ | |
" plugin | |
"============================ | |
" plugin_loader | |
let g:plugin_loader_roots = "~/.vimperator/vimperator-plugins/" | |
let g:plugin_loader_plugins = "_libly,copy,feedSomeKeys_3" | |
"============================ | |
" copy.js | |
"============================ | |
js <<EOM | |
(function () { | |
liberator.globalVariables.copy_templates = [ | |
{ label: 'titleAndURL', value: '%TITLE%\n%URL%' }, | |
{ label: 'markdown', value: '[%TITLE%](%URL%)' }, | |
{ label: 'title', value: '%TITLE%' }, | |
{ label: 'anchor', value: '<a href="%URL%">%TITLE%</a>' }, | |
{ label: 'selanchor', value: '<a href="%URL%" title="%TITLE%">%SEL%</a>' }, | |
]; | |
})(); | |
EOM | |
" 特によく使う機能をキーマッピング | |
map ,y :copy<Space>titleAndURL<CR> | |
map ,my :copy<Space>markdown<CR> | |
"============================ | |
" feedSomeKeys_3.js | |
"============================ | |
command! -nargs=+ lazy autocmd VimperatorEnter .* <args> | |
lazy fmaps -e=vkeydown -u='^https://www\.google\.(co\.jp|com)/search\?q=' j k | |
lazy fmaps -u='^https?://mail\.google\.com/(mail|a)/' c j k n p o u e x s r a # [ ] z ? gi gs gt gd ga gc | |
lazy fmaps -u='^http://b\.hatena\.ne\.jp/(?!(entry|articles|guide))' j k o,oj e a,b | |
lazy fmaps -e=vkeydown -u='^http://www\.tumblr\.com/' j k r,h q p n L,l <S-e> | |
lazy fmaps -u='^http://reader\.livedoor\.com/reader/' j k s a p v z <S-z> ,r,r < > o,vj J,<Space> K,<S-Space> q w g | |
"読み込み完了メッセージ | |
echo "vimperatorrc loaded." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment