There are many very nice plugins in vim, which make vim a very charming one. As I introduced at first, why people like vim, the most reliable reason is the powerful plugins in Vim.
Vim-plug
Every great success begins with a dream, and why vim becomes great, I think it is because of vim-plug.
Vim-plug is very powerful vim plugin manager, very easy install and control. You can find a detail description here.
Here I cite some advantages introductions from vim-plug README:
- Easier to setup: Single file. No boilerplate code required.
- Easier to use: Concise, intuitive syntax
- [Super-fast][40/4] parallel installation/update
(with any of
+job
,+python
,+python3
,+ruby
, or [Neovim][nv]) - Creates shallow clones to minimize disk space usage and download time
- On-demand loading for [faster startup time][startup-time]
- Can review and rollback updates
- Branch/tag/commit support
- Post-update hooks
- Support for externally managed plugins
The Installation of vim-plug:
For Unix:
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
It will help download the plug.vim and put it in the .vim/autoload
.
The use of vim-plug:
Add these lines in your vimrc:
Plug 'your plugins here'
" for example, install the vim-airline (a vim theme)
Plug 'vim-airline/vim-airline'
After you have input all the Plug ''
, in your .markdown
file, input,
:PlugInstall
Every installation will be done within seconds.
MarkdownPreview
MarkdownPrefview can help you edit and show your markdown file at the same time. After the installation, you can just input:
:MarkdownPreview
and enter. To set the rapid key, you can set like this:
map <LEADER>t :MarkdownPreview<CR>
In this way you can enter the explorer to see the output of your markdown file.
There is something we need to know about the markdown.
- Markdown only supports vim >= 8.1 ver.
- There are some default settings of MarkdownPreview:
let g:mkdp_auto_start = 0
let g:mkdp_auto_close = 1
let g:mkdp_refresh_slow = 0
let g:mkdp_command_for_global = 0
let g:mkdp_open_to_the_world = 0
let g:mkdp_open_ip = ''
let g:mkdp_browser = ''
let g:mkdp_echo_preview_url = 0
let g:mkdp_browserfunc = ''
let g:mkdp_preview_options = {
\ 'mkit': {},
\ 'katex': {},
\ 'uml': {},
\ 'maid': {},
\ 'disable_sync_scroll': 0,
\ 'sync_scroll_type': 'middle',
\ 'hide_yaml_meta': 1
\ }
let g:mkdp_markdown_css = ''
let g:mkdp_highlight_css = ''
let g:mkdp_port = ''
let g:mkdp_page_title = '「${name}」'
I just copied them here, just copy them to your vimrc to set the MarkdownPreview plugin.
Look at this line:
let g:mkdp_browserfunc = ''
Set your expolorer here, or just leave this place blank, escape from some other troubles.
And now, you can enjoy your happy input and explore your post at the same time.