Sunday, April 15, 2012

Re: MRU plugin

Hi,


>
> From: Evan LeCompte <evanlec@gmail.com>
> To: vim_use@googlegroups.com 
> Sent: Saturday, April 14, 2012 8:13 PM
> Subject: Re: MRU plugin

> Hmm... this is all good fixes for MRU plugin, I like it very much.
>
> One thing I always wanted was ability to "Toggle" the :MRU window
> on/off , so that a single keybind (I use F12 currently to open :MRU
> list) could be pressed again to close the MRU window if what I needed
> wasn't found in the mru window (this happens fairly often), requiring
> me to close the mru window manually with :q .. which is tedious...I
> like nerdtree's ability to toggle on/off...anyways sorry if I'm OT but
> just a thought..
>

You can add  the following code to your .vimrc file. You can press <F7> to
toggle the MRU window.


Note that you can use the tab completion support to the :Mru command to
open the matching file from the MRU list. You don't have to open the

MRU window.

- Yegappan

------------------------------------------------------------------------------------------------
function! s:Mru_Window_Toggle()
    let wnum = bufwinnr('__MRU_Files__')

    " Open or jump to the MRU window
    MRU

    if wnum != -1
" MRU window was already open. Close it
close
    endif
endfunction

nnoremap <silent> <F7> :call <SID>Mru_Window_Toggle()<CR>

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: