My Vim Set-Up
(Up to: Vim )
My Vim Set-up is pretty hodge-podge, with dodgily-commented config files and hacked Plugins :).
Here's my $HOME/.vimrc file, with added explanatory comments:
: " syntax highlighting please syntax on set ic "personal tab preferences set ts=2 set softtabstop=2 set expandtab set incsearch set autochdir set laststatus=2 set statusline=%-0n.\ %-0f\ -\ %-0l/%-0L,\ %-0c\ (%-0p%%)
" Markdown file formatting options augroup mkd autocmd BufRead *.mkd set ai formatoptions=tcroqn2 comments=n:> augroup END
My $HOME/.vim/filetype.vim does some extra Markdown stuff:
: " markdown filetype file if exists("didloadfiletypes") finish endif augroup markdown au! BufRead,BufNewFile *.mkd setfiletype mkd augroup END
My $HOME/.vim/syntax directory contains mkd.vim, which is linked to from Vim Plugins.
So far, that gives you Markdown formatting for any file with a .mkd extension. To get VimNotes to include Markdown highlighting, I basically applied the syntax colouring to the whole VimNotes document, and include all the other styling within that. Being pretty new to all this, there might be a better way to do it* - let me know if so. I basically added the highlighting import at the end of the "VN_Syntax" method:
: ... highlight link VNHTTP Function highlight link VNNumberedList Comment highlight link VNTopic Comment " import Markdown syntax syntax include @Markdownsyntax syntax/mkd.vim syntax region Markdown start="\%^" end="\%$" \ contains=VN.*,@Markdownsyntax endfunction
You can see my VimNotes.vim file in full, based on VimNotes v. 0.2.6 (which is now over a year old).
- I tried including the syntax for simply certain sections - using patterns to match the section dividers set up by VimNotes, but this seemed to clash with the existing VimNotes highlight sections, so I opted to inverse everything.
Future
I'd like to add in support for the Vim Outliner (see Vim Plugins again) within marked sections of a document (e.g. "OTL:" to ":OTL" maybe), but not sure how or if this is possible yet. As this is script functionality, rather than just highlighting, importing it in the same way doesn't work. Any tips greatly appreciated...