view vimperatorrc @ 174:7b34721d0d3d

Fix UI problems in Firefox 29+.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 07 Jun 2014 18:14:56 -0700
parents a6ef05d484a4
children 095fb39b2096
line wrap: on
line source

" Config for Vimperator

let mapleader=","

" Scroll faster
nnoremap h 3h
nnoremap j 3j
nnoremap k 3k
nnoremap l 3l

" Scroll easier
nnoremap d <C-d>
nnoremap e <C-u>

" Close tab with `x` since `d` is for scrolling down now
nnoremap x :bd<cr>

" Change tabs without awkward `CTRL` combinations
nnoremap J :tabprevious<cr>
nnoremap K :tabnext<cr>

" Reorder tabs
nnoremap > :tabmove +1<cr>
nnoremap < :tabmove -1<cr>

"New tab using the old classic way
nnoremap <C-t> :tabnew<cr>

" Use `i` to get into a persistent insert mode,
" and `I` for the quick one.
nnoremap i <S-Esc>
nnoremap I i

" Shortcuts for common extensions
nnoremap <leader>f i<D-\>
nnoremap <leader>p <S-Esc><A-D-\>
nnoremap <leader>b I<A-b>

" Quickly hide search highlighting
nnoremap <leader><Space> :noh<cr>

" Quickly open some dialogs
nnoremap <leader>b :downloads<cr>

" Super minimal UI
"set toolbars=noaddons,nobookmarks,nomenu,nonavigation,notabs

" Websites with useful keyboard shortcuts already
ignorekeys add -except=:,J,K,b fastmail.fm
ignorekeys add -except=:,J,K,b feedly.com
ignorekeys add -except=:,J,K,b mnmlrdr.com

" The new Firefox fucked up vimperator's ability to hide
" things. Let's do it ourselves for now.
map <silent> <F2> :js toggle_ui()<CR>

:js << EOF
function toggle_ui() {
    var nb = document.getElementById('nav-bar');
    nb.style.visibility = (nb.style.visibility == '') ? 'collapse' : '';
    nb.style.overflow = (nb.style.height == '') ? '' : 'hidden';

    var tb = document.getElementById('TabsToolbar');
    tb.style.visibility = (tb.style.visibility == '') ? 'hidden' : '';
    }
toggle_ui();
EOF

" vim: ft=vim