wfxr / minimap.vim

📡 Blazing fast minimap / scrollbar for vim, powered by code-minimap written in Rust.
MIT License
1.2k stars 24 forks source link

New setting: prevent ever entering the minimap #146

Open ZNielsen opened 2 years ago

ZNielsen commented 2 years ago

Details in #142:

This is what I ended up with: https://github.com/dsully/dotfiles/commit/caa22b703cdee4b96c023050964c8ce32bdd48c1 based off of your answer in https://github.com/wfxr/minimap.vim/issues/106#issuecomment-994143555

Originally posted by @dsully in https://github.com/wfxr/minimap.vim/issues/142#issuecomment-1089457753

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

ZNielsen commented 2 years ago

not stale

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

malonehedges commented 1 year ago

not stale

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

jjj11x commented 5 months ago

This seems to work for me (translated to vimscript for a .vimrc):

augroup minimap_group
    " get rid of existing
    autocmd!
    autocmd WinEnter * call CheckSkipMinimap()
augroup END
function! CheckSkipMinimap()
    let l:mmwinnr = bufwinnr('-MINIMAP-')
    if l:mmwinnr == -1
        " no minimap window
        return
    endif

    if winnr() == l:mmwinnr
        " Go to the other window.
        wincmd w
    endif
endfunction
jjj11x commented 5 months ago

Preventing entering the minimap does unfortunately also seem to prevent using the mouse in the minimap for scrolling though.