"3.7 (created: 2013/04/03 18:20:07)

nnoremap J <C-d>
nnoremap K <C-u>
nnoremap H gT
nnoremap L gt
nnoremap <F1> <Nop>
nnoremap <C-P> <Nop>
nnoremap <C-j> <Nop>
nnoremap <C-k> <Nop>
nnoremap <Esc> <C-c>

noremap <C-a> <Ins><C-a><Ins>
inoremap <C-a> <Ins><C-a><Ins>

noremap <C-S-w> <Nop>
inoremap <C-S-w> <Nop>
noremap <Alt><F4> <Nop>
inoremap <Alt><F4> <Nop>
noremap <C-q> <Nop>
inoremap <C-q> <Nop>

nnoremap <C-p> :js if(!getBrowser().mCurrentTab.pinned){getBrowser().pinTab(getBrowser().mCurrentTab)}else{getBrowser().unpinTab(getBrowser().mCurrentTab)}<CR>
nnoremap <C-S-p> :winopen -private<CR>
nnoremap gi gi<C-e>
nnoremap gI gi<Ins><C-a><Ins><C-c>
nnoremap j 12j
nnoremap k 12k
nnoremap F f
nnoremap f F
nnoremap ; :
nnoremap : ;
nnoremap , <C-o>
nnoremap . <C-i>

noremap  <C-t> <C-t>o
inoremap <C-t> <C-t>o

colorscheme Mediterranean
set maxitems=7
set history=200
set animations=true
set defsearch=e
set hintchars=asdfg;lkjh
set noscrollbars
set tabnumbers
set gui=nonavigation
set toolbars=nonavigation
"highlight Hint font-size:115%;color:white;background-color:red;padding:2px

hi HintExt::before opacity: .5
source! ~/.vimperatorrc.local

" auto pass
autocmd LocationChange .* js modes.passAllKeys = /feedly\.com/.test(buffer.URL)
"autocmd LocationChange .* js modes.passAllKeys = /www\.inoreader\.com/.test(buffer.URL)
"autocmd LocationChange .* js modes.passAllKeys = /none\.iblogger\.org/ttrss/.test(buffer.URL)

" vim: set ft=vimperator:

" hide bottombar
noremap <silent> <F8> :js toggle_bottombar()<CR>
noremap : :js toggle_bottombar('on')<CR>:
noremap b :js toggle_bottombar('on')<CR>b
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>/
noremap <Esc> <Esc>:js toggle_bottombar('off')<CR>
cnoremap <CR> <CR>:js toggle_bottombar('off')<CR>
cnoremap ` <CR> g<

: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

" This is for all the patches to vimperator until next release comes out
" VimperatorPatches: {

    "  Fix search highlighting
    js <<EOF
    finder.highlight = function() {
        this.setupFindbar();
        this.findbar.toggleHighlight(true);
    }
EOF
" }
