Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yuki-yano/fern-preview.vim
Add a file preview window to fern.vim.
https://github.com/yuki-yano/fern-preview.vim
fern-vim-plugin neovim vim
Last synced: 20 days ago
JSON representation
Add a file preview window to fern.vim.
- Host: GitHub
- URL: https://github.com/yuki-yano/fern-preview.vim
- Owner: yuki-yano
- License: mit
- Created: 2021-05-30T10:00:36.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-28T03:11:45.000Z (about 2 years ago)
- Last Synced: 2024-08-01T17:41:26.739Z (3 months ago)
- Topics: fern-vim-plugin, neovim, vim
- Language: Vim Script
- Homepage:
- Size: 46.9 KB
- Stars: 45
- Watchers: 1
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fern-preview.vim
Add a file preview window to [fern.vim](https://github.com/lambdalisue/fern.vim).
## Features
- File preview in popup window or floating window
- Toggle auto preview mode
- Scroll preview window## Demo
![fern-preview](https://user-images.githubusercontent.com/5423775/120148266-ec0ec680-c222-11eb-9a3f-42ff148708ec.gif "fern-preview")
## Requirements
- [fern.vim](https://github.com/lambdalisue/fern.vim)
## Installation
### vim-plug
```vim
Plug 'lambdalisue/fern.vim'
Plug 'yuki-yano/fern-preview.vim'
```### dein
```vim
call dein#add('lambdalisue/fern.vim')
call dein#add('yuki-yano/fern-preview.vim')
```## Usage
### Mapping
```vim
function! s:fern_settings() abort
nmap p (fern-action-preview:toggle)
nmap (fern-action-preview:auto:toggle)
nmap (fern-action-preview:scroll:down:half)
nmap (fern-action-preview:scroll:up:half)
endfunctionaugroup fern-settings
autocmd!
autocmd FileType fern call s:fern_settings()
augroup END
```### Use smart_preview function example
```vim
function! s:fern_settings() abort
nmap (fern-quit-or-close-preview) fern_preview#smart_preview("\(fern-action-preview:close)", ":q\")
nmap q (fern-quit-or-close-preview)
endfunction
```