LumaKernel / fern-mapping-fzf.vim

fern.vim plugin for fzf.
24 stars 2 forks source link
fern fern-vim-plugin fzf vim

fern-mapping-fzf.vim

fern plugin

Dependencies

Installation

Example for dein with TOML.

[[plugins]]
repo = 'LumaKernel/fern-mapping-fzf.vim'
depends = ['fzf', 'fern.vim']

Usage

Mapping Action Description
ff fzf-files Fzf for files
fd fzf-dirs Fzf for directories
fa fzf-both Fzf for both files and directories
frf fzf-root-files Fzf for files from root
frd fzf-root-dirs Fzf for directories from root
fra fzf-root-both Fzf for both files and directories from root

More details, see :help fern-mapping-fzf .

Screenshot

fern-mapping-fzf

Sample settings

FZF multiple and mark on Fern

function! Fern_mapping_fzf_customize_option(spec)
    let a:spec.options .= ' --multi'
    " Note that fzf#vim#with_preview comes from fzf.vim
    if exists('*fzf#vim#with_preview')
        return fzf#vim#with_preview(a:spec)
    else
        return a:spec
    endif
endfunction

function! Fern_mapping_fzf_before_all(dict)
    if !len(a:dict.lines)
        return
    endif
    return a:dict.fern_helper.async.update_marks([])
endfunction

function! s:reveal(dict)
    execute "FernReveal -wait" a:dict.relative_path
    execute "normal \<Plug>(fern-action-mark:set)"
endfunction

let g:Fern_mapping_fzf_file_sink = function('s:reveal')
let g:Fern_mapping_fzf_dir_sink = function('s:reveal')

License

MIT