Create a gist now

Instantly share code, notes, and snippets.

@brennen /.vimrc forked from averyvery/.vimrc
Created Dec 13, 2011

What would you like to do?
Tweaked Vim minimap
function! ToggleMinimap()
if exists("s:isMini") && s:isMini == 0
let s:isMini = 1
let s:isMini = 0
if (s:isMini == 0)
" save current visible lines
let s:firstLine = line("w0")
let s:lastLine = line("w$")
" don't change window size
let c = &columns * 12
let l = &lines * 12
exe "set columns=" . c
exe "set lines=" . l
" make font small
set guifont=ProggyTinyTT:h2
exe 'normal zR'
" highlight lines which were visible
let s:lines = ""
for i in range(s:firstLine, s:lastLine)
let s:lines = s:lines . "\\%" . i . "l"
if i < s:lastLine
let s:lines = s:lines . "\\|"
exe 'match Visible /' . s:lines . '/'
hi Visible guifg=#ffffff guibg=#2b3c43
set cursorline
no h 10j
no t 10k
nmap <space> :ToggleMinimap<CR>
set guifont=Anonymous\ Pro:h14
hi clear Visible
set nocursorline
no h j
no t k
nmap <space> a<space><ESC>
command! ToggleMinimap call ToggleMinimap()
nmap <d-space> :ToggleMinimap<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment