VIM: FuzzyFinder usage, tips, gotchas - how can one make use of this plugin?

后端 未结 6 2227
萌比男神i
萌比男神i 2020-12-23 21:23

http://www.vim.org/scripts/script.php?script_id=1984

You can launch FuzzyFinder by following commands:

     Command           Mode ~         


        
6条回答
  •  甜味超标
    2020-12-23 22:25

    FuzzyFinder on itself is pretty useless to me. I use it in combination with FuzzyFinder-TextMate and a Ruby library that traverses all files and subdirectories to find a file, much like the Cmd+T option for TextMate on a Mac. You can see it in action here.

    Unfortunately, it takes some effort to get it to work since the original author stopped maintaining the script. There are still some people regularly posting updates to github though. You will need two scripts, fuzzyfinder_textmate.vim and fuzzy_file_finder.rb.

    The latest versions work without a problem in combination with Vim FuzzyFinder 2.22.3. Your Vim has to be compiled with Ruby support otherwise it will not work. The blog of the original author contains more information on how to use it properly. Alternatively, have a look at my Vim setup to see how it can be used. The setup defines two keymappings ,s and ,e to fuzzy find a file and open it in a new window or the current window respectively:

    function IdeFindTextMate()
      let g:FuzzyFinderOptions.Base.key_open = ''
      let g:FuzzyFinderOptions.Base.key_open_split = ''
      exe "FuzzyFinderTextMate"
    endfunction
    
    function IdeSplitFindTextMate()
      let g:FuzzyFinderOptions.Base.key_open = ''
      let g:FuzzyFinderOptions.Base.key_open_split = ''
      exe "FuzzyFinderTextMate"
    endfunction
    
    let mapleader = ","
    map  e :call IdeFindTextMate()
    map  s :call IdeSplitFindTextMate()
    

    Update:

    Right now I use the excellent Command-T plugin instead of FuzzyFinder. Have a look at this superuser answer of mine for the reasons why.

提交回复
热议问题