aboutsummaryrefslogtreecommitdiff
path: root/vim/after/ftplugin/markdown.vim
blob: 82fbe9daa83f74a2a251cbe0edf7195a63b4dc84 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
" Spellchecking features
if has('spell')

  " Spellcheck documents we're actually editing (not just viewing)
  if &modifiable && !&readonly
    setlocal spell
    let b:undo_ftplugin .= '|setlocal spell<'
  endif

  " Tolerate leading lowercase letters in README.md files, for things like
  " headings being filenames
  if expand('%:t') ==# 'README.md'
    setlocal spellcapcheck=
    let b:undo_ftplugin .= '|setlocal spellcapcheck<'
  endif

endif

" Stop here if the user doesn't want ftplugin mappings
if exists('g:no_plugin_maps') || exists('g:no_markdown_maps')
  finish
endif

" Quote operator
nnoremap <buffer> <expr> <LocalLeader>q
      \ quote#Quote()
xnoremap <buffer> <expr> <LocalLeader>q
      \ quote#Quote()
let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>q'
      \ . '|xunmap <buffer> <LocalLeader>q'

" Quote operator with reformatting
nnoremap <buffer> <expr> <LocalLeader>Q
      \ quote#QuoteReformat()
xnoremap <buffer> <expr> <LocalLeader>Q
      \ quote#QuoteReformat()
let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>Q'
      \ . '|xunmap <buffer> <LocalLeader>Q'