Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

sokinpui/my-fern-preview.vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

fern-preview.vim

Add a file preview window to fern.vim.

Features

  • File preview in popup window or floating window
  • Toggle auto preview mode
  • Scroll preview window

Demo

fern-preview

Requirements

Installation

vim-plug

Plug 'lambdalisue/fern.vim'
Plug 'yuki-yano/fern-preview.vim'

dein

call dein#add('lambdalisue/fern.vim')
call dein#add('yuki-yano/fern-preview.vim')

Usage

Mapping

function! s:fern_settings() abort
  nmap <silent> <buffer> p     <Plug>(fern-action-preview:toggle)
  nmap <silent> <buffer> <C-p> <Plug>(fern-action-preview:auto:toggle)
  nmap <silent> <buffer> <C-d> <Plug>(fern-action-preview:scroll:down:half)
  nmap <silent> <buffer> <C-u> <Plug>(fern-action-preview:scroll:up:half)
endfunction

augroup fern-settings
  autocmd!
  autocmd FileType fern call s:fern_settings()
augroup END

Use smart_preview function example

function! s:fern_settings() abort
  nmap <silent> <buffer> <expr> <Plug>(fern-quit-or-close-preview) fern_preview#smart_preview("\<Plug>(fern-action-preview:close)", ":q\<CR>")
  nmap <silent> <buffer> q <Plug>(fern-quit-or-close-preview)
endfunction

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published