From b5ab5ecb2cd72c2430c2d48925d9614f4cabba81 Mon Sep 17 00:00:00 2001 From: tomit4 Date: Sun, 17 Oct 2021 12:05:52 -0700 Subject: [PATCH] added markdown preview to nvim --- nvim/init.vim | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/nvim/init.vim b/nvim/init.vim index 970b4fdf..dc83fe19 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -3,8 +3,7 @@ " Specify a directory for plugins call plug#begin('~/.vim/plugged') Plug 'neoclide/coc.nvim', {'branch': 'release'} -Plug 'scrooloose/nerdtree' -"Plug 'tsony-tsonev/nerdtree-git-plugin' +Plug 'scrooloose/nerdtree' "Plug 'tsony-tsonev/nerdtree-git-plugin' Plug 'Xuyuanp/nerdtree-git-plugin' Plug 'tiagofumo/vim-nerdtree-syntax-highlight' Plug 'ryanoasis/vim-devicons' @@ -15,6 +14,7 @@ Plug 'preservim/nerdcommenter' Plug 'Yggdroot/indentLine' Plug 'sheerun/vim-polyglot' Plug 'turbio/bracey.vim', {'do': 'npm install --prefix server'} +Plug 'iamcco/markdown-preview.nvim', {'do': { -> mkdp#util#install() }} Plug 'luochen1990/rainbow' Plug 'yaegassy/coc-volar' Plug 'prettier/vim-prettier', { 'do': 'npm install', 'for': ['javascript', 'typescript', 'css', 'less', 'scss', 'json', 'graphql', 'markdown', 'vue', 'svelte', 'yaml', 'html'] } @@ -61,7 +61,13 @@ let g:NERDTreeGitStatusWithFlags = 1 "\ "Ignored" : "#808080" "\ } -"let g:NERDTreeIgnore = ['^node_modules$'] +let g:NERDTreeIgnore = ['^node_modules$'] + +" do not close the markdown preview tab when switching to other buffers +let g:mkdp_auto_close = 0 + +" keybind map Ctrl + m to :MarkdownPreview +nmap MarkdownPreviewToggle " vim-prettier "let g:prettier#quickfix_enabled = 0 @@ -112,6 +118,7 @@ hi Normal guibg=NONE ctermbg=NONE "Enable Comments with Italics (below selected colorscheme) highlight Comment cterm=italic gui=italic + " sync open file with NERDTree " " Check if NERDTree is open or active function! IsNERDTreeOpen()