https://github.com/leafoftree/vim-preview
Open browser to preview files in current directory from vim
https://github.com/leafoftree/vim-preview
file image preview vim
Last synced: about 2 months ago
JSON representation
Open browser to preview files in current directory from vim
- Host: GitHub
- URL: https://github.com/leafoftree/vim-preview
- Owner: leafOfTree
- Created: 2019-11-20T09:50:34.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-07-16T09:46:10.000Z (over 1 year ago)
- Last Synced: 2025-02-28T18:48:18.170Z (12 months ago)
- Topics: file, image, preview, vim
- Language: JavaScript
- Homepage:
- Size: 121 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vim-preview
Open browser to preview files in current directory from vim.
## Installation
- [VundleVim][2]
Plugin 'leafOfTree/vim-preview'
- [vim-pathogen][5]
cd ~/.vim/bundle && \
git clone https://github.com/leafOfTree/vim-preview --depth 1
- [vim-plug][7]
Plug 'leafOfTree/vim-preview'
:PlugInstall
- Or manually, clone this plugin to `path/to/this_plugin`, and add it to `rtp` in vimrc
set rtp+=path/to/this_plugin
## Usage
Open any file in vim and call `:Preview`.
## Configuration
Set global variable to customize specific feature:
let g:preview_image_filetypes = 'png,apng,jpg,jpeg,webp,ico,bmp,gif,svg'
| variable | description | default |
|------------------------------|---------------------------------------------|--------------------------------------------------------------------------|
| `g:preview_open_browser` | Command to open browser with generated html | Mac: 'open',
Linux: 'xdg-open',
win32: 'start cmd /c start chrome' |
| `g:preview_image_filetypes` | Filetypes to preview with `
` | 'png,apng,jpg,jpeg,webp,ico,bmp,gif,svg' |
| `g:preview_video_filetypes` | Filetypes to preview with `` | 'mp4,webm,ogg' |
| `g:preview_audio_filetypes` | Filetypes to preview with `` | 'mp3,wav' |
| `g:preview_object_filetypes` | Filetypes to preview with `` | 'pdf,swf' |
## Development
The preview page at `./public/index.html` that is based on React. Run
npm install
npm start
Then call `:Preview` . You can check `src/index.js`, `src/index.css` and `public/index.html` first.
[2]: https://github.com/VundleVim/Vundle.vim
[5]: https://github.com/tpope/vim-pathogen
[7]: https://github.com/junegunn/vim-plug