From 701d97389b5fed038bd0be59f789c81ef4e40dc7 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 26 May 2020 17:40:45 +0200 Subject: [PATCH] [nvim] Set all markdown-like documents to pandoc Whenever I write markdown, I want it to be interpreted by pandoc rather than markdown itself. I write the pandoc flavor of md, I want the pandoc plugin to handle the files, and I want to enable citations and compilation in every markdown file. --- nvim/.config/nvim/after/plugin/prose.vim | 2 -- nvim/.config/nvim/init.vim | 8 ++++---- nvim/.config/nvim/plugin/vim-polyglot.vim | 7 +++++++ 3 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 nvim/.config/nvim/plugin/vim-polyglot.vim diff --git a/nvim/.config/nvim/after/plugin/prose.vim b/nvim/.config/nvim/after/plugin/prose.vim index ad7c0d0..c4dd1a6 100644 --- a/nvim/.config/nvim/after/plugin/prose.vim +++ b/nvim/.config/nvim/after/plugin/prose.vim @@ -11,8 +11,6 @@ function! s:Prose() setlocal conceallevel=2 setlocal foldlevel=2 endfunction -" enable syntax highlighting for codeblocks WITHIN markdown -let g:markdown_fenced_languages = ['html', 'python', 'bash=sh', 'javascipt', 'go'] " invoke it manually by writing :Prose " or, it will get automatically sourced for certain filetypes in diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim index 0a65536..9b57cc5 100644 --- a/nvim/.config/nvim/init.vim +++ b/nvim/.config/nvim/init.vim @@ -63,7 +63,7 @@ Plug 'edkolev/tmuxline.vim' " Colorschemes Plug 'chriskempson/base16-vim' Plug 'reedes/vim-colors-pencil' -Plug 'rakr/vim-togglebg' + " RMarkdown & LaTeX workflow Plug 'vim-pandoc/vim-pandoc-syntax' Plug 'vim-pandoc/vim-pandoc' @@ -77,9 +77,9 @@ Plug 'ron89/thesaurus_query.vim' " find thesaurus backed synonyms for word under Plug 'kana/vim-textobj-user' " dependency for most other textobj plugins Plug 'reedes/vim-textobj-sentence' " extends the capabilities of sentence detection " and allows you to jump to the *end* of this or last sentence. -Plug 'reedes/vim-pencil', { 'for': ['markdown', 'txt'], 'on': 'Goyo' } " provide md convenience functions like hard/softwrap -Plug 'junegunn/goyo.vim', { 'for': ['markdown', 'txt'], 'on': 'Goyo' } " provide distraction free writing -Plug 'junegunn/limelight.vim', { 'for': ['markdown', 'txt'], 'on': 'Goyo' } " provide even distraction free-er writing (lowlight paragraphs) +Plug 'reedes/vim-pencil', { 'for': ['pandoc', 'markdown', 'txt'], 'on': 'Goyo' } " provide md convenience functions like hard/softwrap +Plug 'junegunn/goyo.vim', { 'for': ['pandoc', 'markdown', 'txt'], 'on': 'Goyo' } " provide distraction free writing +Plug 'junegunn/limelight.vim', { 'for': ['pandoc', 'markdown', 'txt'], 'on': 'Goyo' } " provide even distraction free-er writing (lowlight paragraphs) " Language Integration Plug 'sheerun/vim-polyglot' " syntax plugins for almost every language Plug 'stephpy/vim-yaml' diff --git a/nvim/.config/nvim/plugin/vim-polyglot.vim b/nvim/.config/nvim/plugin/vim-polyglot.vim new file mode 100644 index 0000000..a73abef --- /dev/null +++ b/nvim/.config/nvim/plugin/vim-polyglot.vim @@ -0,0 +1,7 @@ +" PLUGIN: vim-polyglot +" +" we disable markdown so that every markdown file can be given pandoc type +let g:polyglot_disabled = ['markdown'] + +au BufNewFile,BufRead *.{md,mdown,mkd,mkdn,markdown,mdwn} set ft=pandoc +au BufNewFile,BufRead *.{md,mdown,mkd,mkdn,markdown,mdwn}.{des3,des,bf,bfa,aes,idea,cast,rc2,rc4,rc5,desx} set ft=pandoc