2010-05-12 02:00:00 +02:00
|
|
|
" vim:tabstop=2:shiftwidth=2:expandtab:foldmethod=marker:textwidth=79
|
2010-01-20 01:00:00 +01:00
|
|
|
" Vimwiki filetype plugin file
|
|
|
|
" Author: Maxim Kim <habamax@gmail.com>
|
|
|
|
" Home: http://code.google.com/p/vimwiki/
|
|
|
|
|
|
|
|
if exists("b:did_ftplugin")
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
let b:did_ftplugin = 1 " Don't load another plugin for this buffer
|
2013-07-18 07:55:24 +02:00
|
|
|
|
|
|
|
call vimwiki#u#reload_regexes()
|
2014-12-04 21:18:58 +01:00
|
|
|
call vimwiki#u#reload_omni_regexes()
|
2010-01-20 01:00:00 +01:00
|
|
|
|
|
|
|
" UNDO list {{{
|
|
|
|
" Reset the following options to undo this plugin.
|
2010-02-23 01:00:00 +01:00
|
|
|
let b:undo_ftplugin = "setlocal ".
|
2013-07-08 11:37:35 +02:00
|
|
|
\ "suffixesadd< isfname< formatlistpat< ".
|
2010-01-20 01:00:00 +01:00
|
|
|
\ "formatoptions< foldtext< ".
|
|
|
|
\ "foldmethod< foldexpr< commentstring< "
|
|
|
|
" UNDO }}}
|
|
|
|
|
|
|
|
" MISC STUFF {{{
|
|
|
|
|
2011-06-11 02:00:00 +02:00
|
|
|
setlocal commentstring=%%%s
|
2010-08-24 02:00:00 +02:00
|
|
|
|
|
|
|
if g:vimwiki_conceallevel && exists("+conceallevel")
|
2013-04-19 05:46:58 +02:00
|
|
|
let &l:conceallevel = g:vimwiki_conceallevel
|
2010-08-24 02:00:00 +02:00
|
|
|
endif
|
|
|
|
|
2010-01-20 01:00:00 +01:00
|
|
|
" GOTO FILE: gf {{{
|
|
|
|
execute 'setlocal suffixesadd='.VimwikiGet('ext')
|
|
|
|
setlocal isfname-=[,]
|
|
|
|
" gf}}}
|
|
|
|
|
2015-01-09 23:44:25 +01:00
|
|
|
setlocal tags+=./.tags
|
|
|
|
|
2014-12-04 21:18:58 +01:00
|
|
|
" MISC }}}
|
2014-02-13 12:42:24 +01:00
|
|
|
|
2014-12-04 21:18:58 +01:00
|
|
|
" COMPLETION {{{
|
2014-07-30 21:46:22 +02:00
|
|
|
function! Complete_wikifiles(findstart, base)
|
2014-02-13 12:42:24 +01:00
|
|
|
if a:findstart == 1
|
|
|
|
let column = col('.')-1
|
|
|
|
let line = getline('.')[:column]
|
|
|
|
let startoflink = match(line, '\[\[\zs[^\\[]*$')
|
|
|
|
if startoflink != -1
|
|
|
|
return startoflink
|
|
|
|
endif
|
|
|
|
if VimwikiGet('syntax') == 'markdown'
|
|
|
|
let startofinlinelink = match(line, '\[.*\](\zs.*$')
|
|
|
|
if startofinlinelink != -1
|
|
|
|
return startofinlinelink
|
|
|
|
endif
|
|
|
|
endif
|
2015-01-04 23:29:42 +01:00
|
|
|
let startoftag = match(line, ':\zs[^:[:space:]]*$')
|
|
|
|
if startoftag != -1
|
|
|
|
return startoftag
|
|
|
|
endif
|
2014-02-13 12:42:24 +01:00
|
|
|
return -1
|
|
|
|
else
|
2015-01-04 23:29:42 +01:00
|
|
|
" Completion works for wikilinks/anchors, and for tags. So first we have
|
|
|
|
" to find out what we're about to complete.
|
|
|
|
let column = col('.')
|
|
|
|
let line = getline('.')[:(column - len(a:base))]
|
|
|
|
let char_before_start = line[-1:-1]
|
|
|
|
if char_before_start == ':'
|
|
|
|
" Tags completion
|
|
|
|
let metadata = vimwiki#base#load_tags_metadata()
|
|
|
|
let tags = vimwiki#base#get_tags(metadata)
|
|
|
|
call filter(tags,
|
|
|
|
\ "v:val[:" . (len(a:base)-1) . "] == '" . substitute(a:base, "'", "''", '') . "'" )
|
|
|
|
return tags
|
|
|
|
elseif a:base !~ '#'
|
2014-02-13 12:42:24 +01:00
|
|
|
" we look for wiki files
|
|
|
|
|
|
|
|
if a:base =~# '^wiki\d:'
|
|
|
|
let wikinumber = eval(matchstr(a:base, '^wiki\zs\d'))
|
2014-09-16 10:18:40 +02:00
|
|
|
if wikinumber >= len(g:vimwiki_list)
|
|
|
|
return []
|
|
|
|
endif
|
2014-02-13 12:42:24 +01:00
|
|
|
let prefix = matchstr(a:base, '^wiki\d:\zs.*')
|
|
|
|
let scheme = matchstr(a:base, '^wiki\d:\ze')
|
|
|
|
elseif a:base =~# '^diary:'
|
2014-12-04 21:18:58 +01:00
|
|
|
let wikinumber = -1
|
2014-02-13 12:42:24 +01:00
|
|
|
let prefix = matchstr(a:base, '^diary:\zs.*')
|
|
|
|
let scheme = matchstr(a:base, '^diary:\ze')
|
2014-09-16 10:18:40 +02:00
|
|
|
else " current wiki
|
|
|
|
let wikinumber = g:vimwiki_current_idx
|
2014-02-13 12:42:24 +01:00
|
|
|
let prefix = a:base
|
|
|
|
let scheme = ''
|
|
|
|
endif
|
|
|
|
|
2014-12-04 21:18:58 +01:00
|
|
|
let links = vimwiki#base#get_wikilinks(wikinumber)
|
2014-02-13 12:42:24 +01:00
|
|
|
let result = []
|
2014-12-04 21:18:58 +01:00
|
|
|
for wikifile in links
|
|
|
|
if wikifile =~ '^'.vimwiki#u#escape(prefix)
|
|
|
|
call add(result, scheme . wikifile)
|
2014-02-13 12:42:24 +01:00
|
|
|
endif
|
|
|
|
endfor
|
|
|
|
return result
|
|
|
|
|
|
|
|
else
|
|
|
|
" we look for anchors in the given wikifile
|
|
|
|
|
|
|
|
let segments = split(a:base, '#', 1)
|
2014-08-18 09:16:41 +02:00
|
|
|
let given_wikifile = segments[0]=='' ? expand('%:t:r') : segments[0]
|
2014-12-14 14:49:06 +01:00
|
|
|
let link_infos = vimwiki#base#resolve_scheme(given_wikifile.'#', 0, 1)
|
2014-02-13 12:42:24 +01:00
|
|
|
let wikifile = link_infos[6]
|
|
|
|
let syntax = VimwikiGet('syntax', link_infos[0])
|
2014-08-14 13:08:24 +02:00
|
|
|
let anchors = vimwiki#base#get_anchors(wikifile, syntax)
|
2014-02-13 12:42:24 +01:00
|
|
|
|
|
|
|
let filtered_anchors = []
|
|
|
|
let given_anchor = join(segments[1:], '#')
|
|
|
|
for anchor in anchors
|
2014-08-14 13:08:24 +02:00
|
|
|
if anchor =~# '^'.vimwiki#u#escape(given_anchor)
|
2014-02-13 12:42:24 +01:00
|
|
|
call add(filtered_anchors, segments[0].'#'.anchor)
|
|
|
|
endif
|
|
|
|
endfor
|
|
|
|
return filtered_anchors
|
2014-08-14 13:08:24 +02:00
|
|
|
|
2014-02-13 12:42:24 +01:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endfunction
|
|
|
|
|
2014-12-04 21:18:58 +01:00
|
|
|
setlocal omnifunc=Complete_wikifiles
|
|
|
|
" COMPLETION }}}
|
2014-02-13 12:42:24 +01:00
|
|
|
|
2014-01-06 14:11:16 +01:00
|
|
|
" LIST STUFF {{{
|
|
|
|
" settings necessary for the automatic formatting of lists
|
2013-07-08 11:37:35 +02:00
|
|
|
setlocal autoindent
|
|
|
|
setlocal nosmartindent
|
|
|
|
setlocal nocindent
|
|
|
|
setlocal comments=""
|
|
|
|
setlocal formatoptions-=c
|
|
|
|
setlocal formatoptions-=r
|
|
|
|
setlocal formatoptions-=o
|
|
|
|
setlocal formatoptions-=2
|
|
|
|
setlocal formatoptions+=n
|
|
|
|
|
|
|
|
"Create 'formatlistpat'
|
2013-07-17 15:57:35 +02:00
|
|
|
let &formatlistpat = g:vimwiki_rxListItem
|
2013-07-08 11:37:35 +02:00
|
|
|
|
2010-05-12 02:00:00 +02:00
|
|
|
if !empty(&langmap)
|
|
|
|
" Valid only if langmap is a comma separated pairs of chars
|
2014-02-24 12:16:23 +01:00
|
|
|
let s:l_o = matchstr(&langmap, '\C,\zs.\zeo,')
|
|
|
|
if s:l_o
|
|
|
|
exe 'nnoremap <silent> <buffer> '.s:l_o.' :call vimwiki#lst#kbd_o()<CR>a'
|
2010-05-12 02:00:00 +02:00
|
|
|
endif
|
|
|
|
|
2014-02-24 12:16:23 +01:00
|
|
|
let s:l_O = matchstr(&langmap, '\C,\zs.\zeO,')
|
|
|
|
if s:l_O
|
|
|
|
exe 'nnoremap <silent> <buffer> '.s:l_O.' :call vimwiki#lst#kbd_O()<CR>a'
|
2010-05-12 02:00:00 +02:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2014-01-06 14:11:16 +01:00
|
|
|
" LIST STUFF }}}
|
2010-01-20 01:00:00 +01:00
|
|
|
|
2013-07-24 09:30:29 +02:00
|
|
|
" FOLDING {{{
|
|
|
|
" Folding list items {{{
|
2013-04-19 05:46:58 +02:00
|
|
|
function! VimwikiFoldListLevel(lnum) "{{{
|
2013-07-24 09:09:41 +02:00
|
|
|
return vimwiki#lst#fold_level(a:lnum)
|
2013-04-19 05:46:58 +02:00
|
|
|
endfunction "}}}
|
|
|
|
" Folding list items }}}
|
|
|
|
|
2013-07-24 09:30:29 +02:00
|
|
|
" Folding sections and code blocks {{{
|
2013-04-19 05:46:58 +02:00
|
|
|
function! VimwikiFoldLevel(lnum) "{{{
|
|
|
|
let line = getline(a:lnum)
|
|
|
|
|
|
|
|
" Header/section folding...
|
|
|
|
if line =~ g:vimwiki_rxHeader
|
|
|
|
return '>'.vimwiki#u#count_first_sym(line)
|
|
|
|
" Code block folding...
|
|
|
|
elseif line =~ '^\s*'.g:vimwiki_rxPreStart
|
|
|
|
return 'a1'
|
|
|
|
elseif line =~ '^\s*'.g:vimwiki_rxPreEnd.'\s*$'
|
|
|
|
return 's1'
|
|
|
|
else
|
|
|
|
return "="
|
|
|
|
endif
|
|
|
|
|
|
|
|
endfunction "}}}
|
|
|
|
|
|
|
|
" Constants used by VimwikiFoldText {{{
|
|
|
|
" use \u2026 and \u21b2 (or \u2424) if enc=utf-8 to save screen space
|
|
|
|
let s:ellipsis = (&enc ==? 'utf-8') ? "\u2026" : "..."
|
|
|
|
let s:ell_len = strlen(s:ellipsis)
|
|
|
|
let s:newline = (&enc ==? 'utf-8') ? "\u21b2 " : " "
|
|
|
|
let s:tolerance = 5
|
|
|
|
" }}}
|
|
|
|
|
|
|
|
function! s:shorten_text_simple(text, len) "{{{ unused
|
|
|
|
let spare_len = a:len - len(a:text)
|
|
|
|
return (spare_len>=0) ? [a:text,spare_len] : [a:text[0:a:len].s:ellipsis, -1]
|
|
|
|
endfunction "}}}
|
|
|
|
|
|
|
|
" s:shorten_text(text, len) = [string, spare] with "spare" = len-strlen(string)
|
|
|
|
" for long enough "text", the string's length is within s:tolerance of "len"
|
|
|
|
" (so that -s:tolerance <= spare <= s:tolerance, "string" ends with s:ellipsis)
|
|
|
|
function! s:shorten_text(text, len) "{{{ returns [string, spare]
|
|
|
|
let spare_len = a:len - strlen(a:text)
|
|
|
|
if (spare_len + s:tolerance >= 0)
|
|
|
|
return [a:text, spare_len]
|
|
|
|
endif
|
|
|
|
" try to break on a space; assumes a:len-s:ell_len >= s:tolerance
|
|
|
|
let newlen = a:len - s:ell_len
|
|
|
|
let idx = strridx(a:text, ' ', newlen + s:tolerance)
|
|
|
|
let break_idx = (idx + s:tolerance >= newlen) ? idx : newlen
|
|
|
|
return [a:text[0:break_idx].s:ellipsis, newlen - break_idx]
|
|
|
|
endfunction "}}}
|
|
|
|
|
2010-01-20 01:00:00 +01:00
|
|
|
function! VimwikiFoldText() "{{{
|
2013-04-19 05:46:58 +02:00
|
|
|
let line = getline(v:foldstart)
|
|
|
|
let main_text = substitute(line, '^\s*', repeat(' ',indent(v:foldstart)), '')
|
|
|
|
let fold_len = v:foldend - v:foldstart + 1
|
|
|
|
let len_text = ' ['.fold_len.'] '
|
|
|
|
if line !~ '^\s*'.g:vimwiki_rxPreStart
|
|
|
|
let [main_text, spare_len] = s:shorten_text(main_text, 50)
|
|
|
|
return main_text.len_text
|
|
|
|
else
|
|
|
|
" fold-text for code blocks: use one or two of the starting lines
|
|
|
|
let [main_text, spare_len] = s:shorten_text(main_text, 24)
|
|
|
|
let line1 = substitute(getline(v:foldstart+1), '^\s*', ' ', '')
|
|
|
|
let [content_text, spare_len] = s:shorten_text(line1, spare_len+20)
|
|
|
|
if spare_len > s:tolerance && fold_len > 3
|
|
|
|
let line2 = substitute(getline(v:foldstart+2), '^\s*', s:newline, '')
|
|
|
|
let [more_text, spare_len] = s:shorten_text(line2, spare_len+12)
|
|
|
|
let content_text .= more_text
|
|
|
|
endif
|
|
|
|
return main_text.len_text.content_text
|
|
|
|
endif
|
2010-01-20 01:00:00 +01:00
|
|
|
endfunction "}}}
|
|
|
|
|
2013-04-19 05:46:58 +02:00
|
|
|
" Folding sections and code blocks }}}
|
2010-01-20 01:00:00 +01:00
|
|
|
" FOLDING }}}
|
|
|
|
|
|
|
|
" COMMANDS {{{
|
|
|
|
command! -buffer Vimwiki2HTML
|
2014-10-23 12:18:28 +02:00
|
|
|
\ if filewritable(expand('%')) | silent noautocmd w | endif
|
|
|
|
\ <bar>
|
2014-02-03 11:41:55 +01:00
|
|
|
\ let res = vimwiki#html#Wiki2HTML(expand(VimwikiGet('path_html')),
|
2010-01-20 01:00:00 +01:00
|
|
|
\ expand('%'))
|
2014-10-23 12:18:28 +02:00
|
|
|
\ <bar>
|
2014-09-12 11:15:47 +02:00
|
|
|
\ if res != '' | echo 'Vimwiki: HTML conversion is done, output: '.expand(VimwikiGet('path_html')) | endif
|
2011-06-11 02:00:00 +02:00
|
|
|
command! -buffer Vimwiki2HTMLBrowse
|
2014-10-23 12:18:28 +02:00
|
|
|
\ if filewritable(expand('%')) | silent noautocmd w | endif
|
|
|
|
\ <bar>
|
2012-06-07 02:00:00 +02:00
|
|
|
\ call vimwiki#base#system_open_link(vimwiki#html#Wiki2HTML(
|
|
|
|
\ expand(VimwikiGet('path_html')),
|
|
|
|
\ expand('%')))
|
2010-01-20 01:00:00 +01:00
|
|
|
command! -buffer VimwikiAll2HTML
|
2014-02-03 11:41:55 +01:00
|
|
|
\ call vimwiki#html#WikiAll2HTML(expand(VimwikiGet('path_html')))
|
2010-01-20 01:00:00 +01:00
|
|
|
|
2014-02-18 14:47:42 +01:00
|
|
|
command! -buffer VimwikiTOC call vimwiki#base#table_of_contents(1)
|
2014-02-13 12:42:24 +01:00
|
|
|
|
2011-06-11 02:00:00 +02:00
|
|
|
command! -buffer VimwikiNextLink call vimwiki#base#find_next_link()
|
|
|
|
command! -buffer VimwikiPrevLink call vimwiki#base#find_prev_link()
|
|
|
|
command! -buffer VimwikiDeleteLink call vimwiki#base#delete_link()
|
|
|
|
command! -buffer VimwikiRenameLink call vimwiki#base#rename_link()
|
|
|
|
command! -buffer VimwikiFollowLink call vimwiki#base#follow_link('nosplit')
|
|
|
|
command! -buffer VimwikiGoBackLink call vimwiki#base#go_back_link()
|
|
|
|
command! -buffer VimwikiSplitLink call vimwiki#base#follow_link('split')
|
|
|
|
command! -buffer VimwikiVSplitLink call vimwiki#base#follow_link('vsplit')
|
2010-01-20 01:00:00 +01:00
|
|
|
|
2012-06-07 02:00:00 +02:00
|
|
|
command! -buffer -nargs=? VimwikiNormalizeLink call vimwiki#base#normalize_link(<f-args>)
|
|
|
|
|
2011-06-11 02:00:00 +02:00
|
|
|
command! -buffer VimwikiTabnewLink call vimwiki#base#follow_link('tabnew')
|
2010-01-20 01:00:00 +01:00
|
|
|
|
2011-06-11 02:00:00 +02:00
|
|
|
command! -buffer VimwikiGenerateLinks call vimwiki#base#generate_links()
|
|
|
|
|
2012-06-07 02:00:00 +02:00
|
|
|
command! -buffer -nargs=0 VimwikiBacklinks call vimwiki#base#backlinks()
|
|
|
|
command! -buffer -nargs=0 VWB call vimwiki#base#backlinks()
|
|
|
|
|
2011-06-11 02:00:00 +02:00
|
|
|
exe 'command! -buffer -nargs=* VimwikiSearch lvimgrep <args> '.
|
2010-01-20 01:00:00 +01:00
|
|
|
\ escape(VimwikiGet('path').'**/*'.VimwikiGet('ext'), ' ')
|
|
|
|
|
2011-06-11 02:00:00 +02:00
|
|
|
exe 'command! -buffer -nargs=* VWS lvimgrep <args> '.
|
2010-01-20 01:00:00 +01:00
|
|
|
\ escape(VimwikiGet('path').'**/*'.VimwikiGet('ext'), ' ')
|
|
|
|
|
2014-11-10 21:04:06 +01:00
|
|
|
command! -buffer -nargs=+ -complete=custom,vimwiki#base#complete_links_escaped
|
2014-11-06 22:02:37 +01:00
|
|
|
\ VimwikiGoto call vimwiki#base#goto(<f-args>)
|
2010-08-24 02:00:00 +02:00
|
|
|
|
2014-12-04 21:18:58 +01:00
|
|
|
command! -buffer VimwikiCheckLinks call vimwiki#base#check_links()
|
2012-06-07 02:00:00 +02:00
|
|
|
|
|
|
|
" list commands
|
2014-01-06 14:11:16 +01:00
|
|
|
command! -buffer -nargs=+ VimwikiReturn call <SID>CR(<f-args>)
|
|
|
|
command! -buffer -range -nargs=1 VimwikiChangeSymbolTo call vimwiki#lst#change_marker(<line1>, <line2>, <f-args>, 'n')
|
|
|
|
command! -buffer -range -nargs=1 VimwikiListChangeSymbolI call vimwiki#lst#change_marker(<line1>, <line2>, <f-args>, 'i')
|
|
|
|
command! -buffer -nargs=1 VimwikiChangeSymbolInListTo call vimwiki#lst#change_marker_in_list(<f-args>)
|
2014-02-04 10:40:14 +01:00
|
|
|
command! -buffer -range VimwikiToggleListItem call vimwiki#lst#toggle_cb(<line1>, <line2>)
|
2014-01-06 14:11:16 +01:00
|
|
|
command! -buffer -range -nargs=+ VimwikiListChangeLvl call vimwiki#lst#change_level(<line1>, <line2>, <f-args>)
|
|
|
|
command! -buffer -range VimwikiRemoveSingleCB call vimwiki#lst#remove_cb(<line1>, <line2>)
|
|
|
|
command! -buffer VimwikiRemoveCBInList call vimwiki#lst#remove_cb_in_list()
|
|
|
|
command! -buffer VimwikiRenumberList call vimwiki#lst#adjust_numbered_list()
|
|
|
|
command! -buffer VimwikiRenumberAllLists call vimwiki#lst#adjust_whole_buffer()
|
|
|
|
command! -buffer VimwikiListToggle call vimwiki#lst#toggle_list_item()
|
2012-06-07 02:00:00 +02:00
|
|
|
|
2010-02-23 01:00:00 +01:00
|
|
|
" table commands
|
2011-06-11 02:00:00 +02:00
|
|
|
command! -buffer -nargs=* VimwikiTable call vimwiki#tbl#create(<f-args>)
|
|
|
|
command! -buffer VimwikiTableAlignQ call vimwiki#tbl#align_or_cmd('gqq')
|
|
|
|
command! -buffer VimwikiTableAlignW call vimwiki#tbl#align_or_cmd('gww')
|
|
|
|
command! -buffer VimwikiTableMoveColumnLeft call vimwiki#tbl#move_column_left()
|
|
|
|
command! -buffer VimwikiTableMoveColumnRight call vimwiki#tbl#move_column_right()
|
2010-02-23 01:00:00 +01:00
|
|
|
|
2010-08-24 02:00:00 +02:00
|
|
|
" diary commands
|
2011-06-11 02:00:00 +02:00
|
|
|
command! -buffer VimwikiDiaryNextDay call vimwiki#diary#goto_next_day()
|
|
|
|
command! -buffer VimwikiDiaryPrevDay call vimwiki#diary#goto_prev_day()
|
2010-08-24 02:00:00 +02:00
|
|
|
|
2015-01-06 20:30:28 +01:00
|
|
|
" tags commands
|
|
|
|
command! -buffer VimwikiRebuildTags call vimwiki#base#update_tags(1)
|
2015-01-06 20:44:41 +01:00
|
|
|
command! -buffer -nargs=* -complete=custom,vimwiki#base#complete_tags
|
|
|
|
\ VimwikiSearchTags VimwikiSearch /:<args>:/
|
2015-01-06 21:13:28 +01:00
|
|
|
command! -buffer -nargs=* -complete=custom,vimwiki#base#complete_tags
|
|
|
|
\ VimwikiGenerateTags call vimwiki#base#generate_tags(<f-args>)
|
2015-01-06 20:30:28 +01:00
|
|
|
|
2010-01-20 01:00:00 +01:00
|
|
|
" COMMANDS }}}
|
|
|
|
|
|
|
|
" KEYBINDINGS {{{
|
|
|
|
if g:vimwiki_use_mouse
|
|
|
|
nmap <buffer> <S-LeftMouse> <NOP>
|
|
|
|
nmap <buffer> <C-LeftMouse> <NOP>
|
2012-06-07 02:00:00 +02:00
|
|
|
nnoremap <silent><buffer> <2-LeftMouse> :call vimwiki#base#follow_link("nosplit", "\<lt>2-LeftMouse>")<CR>
|
2011-06-11 02:00:00 +02:00
|
|
|
nnoremap <silent><buffer> <S-2-LeftMouse> <LeftMouse>:VimwikiSplitLink<CR>
|
|
|
|
nnoremap <silent><buffer> <C-2-LeftMouse> <LeftMouse>:VimwikiVSplitLink<CR>
|
|
|
|
nnoremap <silent><buffer> <RightMouse><LeftMouse> :VimwikiGoBackLink<CR>
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
if !hasmapto('<Plug>Vimwiki2HTML')
|
2014-11-05 23:12:21 +01:00
|
|
|
exe 'nmap <buffer> '.g:vimwiki_map_prefix.'h <Plug>Vimwiki2HTML'
|
2011-06-11 02:00:00 +02:00
|
|
|
endif
|
|
|
|
nnoremap <script><buffer>
|
|
|
|
\ <Plug>Vimwiki2HTML :Vimwiki2HTML<CR>
|
|
|
|
|
|
|
|
if !hasmapto('<Plug>Vimwiki2HTMLBrowse')
|
2014-11-05 23:12:21 +01:00
|
|
|
exe 'nmap <buffer> '.g:vimwiki_map_prefix.'hh <Plug>Vimwiki2HTMLBrowse'
|
2010-01-20 01:00:00 +01:00
|
|
|
endif
|
2011-06-11 02:00:00 +02:00
|
|
|
nnoremap <script><buffer>
|
|
|
|
\ <Plug>Vimwiki2HTMLBrowse :Vimwiki2HTMLBrowse<CR>
|
2010-01-20 01:00:00 +01:00
|
|
|
|
2010-08-24 02:00:00 +02:00
|
|
|
if !hasmapto('<Plug>VimwikiFollowLink')
|
|
|
|
nmap <silent><buffer> <CR> <Plug>VimwikiFollowLink
|
2010-01-20 01:00:00 +01:00
|
|
|
endif
|
2011-06-11 02:00:00 +02:00
|
|
|
nnoremap <silent><script><buffer>
|
2010-08-24 02:00:00 +02:00
|
|
|
\ <Plug>VimwikiFollowLink :VimwikiFollowLink<CR>
|
2010-01-20 01:00:00 +01:00
|
|
|
|
2010-08-24 02:00:00 +02:00
|
|
|
if !hasmapto('<Plug>VimwikiSplitLink')
|
|
|
|
nmap <silent><buffer> <S-CR> <Plug>VimwikiSplitLink
|
2010-01-20 01:00:00 +01:00
|
|
|
endif
|
2011-06-11 02:00:00 +02:00
|
|
|
nnoremap <silent><script><buffer>
|
2010-08-24 02:00:00 +02:00
|
|
|
\ <Plug>VimwikiSplitLink :VimwikiSplitLink<CR>
|
2010-01-20 01:00:00 +01:00
|
|
|
|
2010-08-24 02:00:00 +02:00
|
|
|
if !hasmapto('<Plug>VimwikiVSplitLink')
|
|
|
|
nmap <silent><buffer> <C-CR> <Plug>VimwikiVSplitLink
|
2010-01-20 01:00:00 +01:00
|
|
|
endif
|
2011-06-11 02:00:00 +02:00
|
|
|
nnoremap <silent><script><buffer>
|
2010-08-24 02:00:00 +02:00
|
|
|
\ <Plug>VimwikiVSplitLink :VimwikiVSplitLink<CR>
|
2010-01-20 01:00:00 +01:00
|
|
|
|
2012-06-07 02:00:00 +02:00
|
|
|
if !hasmapto('<Plug>VimwikiNormalizeLink')
|
|
|
|
nmap <silent><buffer> + <Plug>VimwikiNormalizeLink
|
|
|
|
endif
|
|
|
|
nnoremap <silent><script><buffer>
|
|
|
|
\ <Plug>VimwikiNormalizeLink :VimwikiNormalizeLink 0<CR>
|
|
|
|
|
|
|
|
if !hasmapto('<Plug>VimwikiNormalizeLinkVisual')
|
|
|
|
vmap <silent><buffer> + <Plug>VimwikiNormalizeLinkVisual
|
|
|
|
endif
|
|
|
|
vnoremap <silent><script><buffer>
|
|
|
|
\ <Plug>VimwikiNormalizeLinkVisual :<C-U>VimwikiNormalizeLink 1<CR>
|
|
|
|
|
|
|
|
if !hasmapto('<Plug>VimwikiNormalizeLinkVisualCR')
|
|
|
|
vmap <silent><buffer> <CR> <Plug>VimwikiNormalizeLinkVisualCR
|
|
|
|
endif
|
|
|
|
vnoremap <silent><script><buffer>
|
|
|
|
\ <Plug>VimwikiNormalizeLinkVisualCR :<C-U>VimwikiNormalizeLink 1<CR>
|
|
|
|
|
2011-06-11 02:00:00 +02:00
|
|
|
if !hasmapto('<Plug>VimwikiTabnewLink')
|
|
|
|
nmap <silent><buffer> <D-CR> <Plug>VimwikiTabnewLink
|
|
|
|
nmap <silent><buffer> <C-S-CR> <Plug>VimwikiTabnewLink
|
|
|
|
endif
|
|
|
|
nnoremap <silent><script><buffer>
|
|
|
|
\ <Plug>VimwikiTabnewLink :VimwikiTabnewLink<CR>
|
|
|
|
|
2010-08-24 02:00:00 +02:00
|
|
|
if !hasmapto('<Plug>VimwikiGoBackLink')
|
|
|
|
nmap <silent><buffer> <BS> <Plug>VimwikiGoBackLink
|
2010-01-20 01:00:00 +01:00
|
|
|
endif
|
2011-06-11 02:00:00 +02:00
|
|
|
nnoremap <silent><script><buffer>
|
2010-08-24 02:00:00 +02:00
|
|
|
\ <Plug>VimwikiGoBackLink :VimwikiGoBackLink<CR>
|
2010-01-20 01:00:00 +01:00
|
|
|
|
2010-08-24 02:00:00 +02:00
|
|
|
if !hasmapto('<Plug>VimwikiNextLink')
|
|
|
|
nmap <silent><buffer> <TAB> <Plug>VimwikiNextLink
|
2010-01-20 01:00:00 +01:00
|
|
|
endif
|
2011-06-11 02:00:00 +02:00
|
|
|
nnoremap <silent><script><buffer>
|
2010-08-24 02:00:00 +02:00
|
|
|
\ <Plug>VimwikiNextLink :VimwikiNextLink<CR>
|
2010-01-20 01:00:00 +01:00
|
|
|
|
2010-08-24 02:00:00 +02:00
|
|
|
if !hasmapto('<Plug>VimwikiPrevLink')
|
|
|
|
nmap <silent><buffer> <S-TAB> <Plug>VimwikiPrevLink
|
2010-01-20 01:00:00 +01:00
|
|
|
endif
|
2011-06-11 02:00:00 +02:00
|
|
|
nnoremap <silent><script><buffer>
|
2010-08-24 02:00:00 +02:00
|
|
|
\ <Plug>VimwikiPrevLink :VimwikiPrevLink<CR>
|
2010-01-20 01:00:00 +01:00
|
|
|
|
2010-08-24 02:00:00 +02:00
|
|
|
if !hasmapto('<Plug>VimwikiDeleteLink')
|
2014-11-05 23:12:21 +01:00
|
|
|
exe 'nmap <silent><buffer> '.g:vimwiki_map_prefix.'d <Plug>VimwikiDeleteLink'
|
2010-01-20 01:00:00 +01:00
|
|
|
endif
|
2011-06-11 02:00:00 +02:00
|
|
|
nnoremap <silent><script><buffer>
|
2010-08-24 02:00:00 +02:00
|
|
|
\ <Plug>VimwikiDeleteLink :VimwikiDeleteLink<CR>
|
2010-01-20 01:00:00 +01:00
|
|
|
|
2010-08-24 02:00:00 +02:00
|
|
|
if !hasmapto('<Plug>VimwikiRenameLink')
|
2014-11-05 23:12:21 +01:00
|
|
|
exe 'nmap <silent><buffer> '.g:vimwiki_map_prefix.'r <Plug>VimwikiRenameLink'
|
2010-01-20 01:00:00 +01:00
|
|
|
endif
|
2011-06-11 02:00:00 +02:00
|
|
|
nnoremap <silent><script><buffer>
|
2010-08-24 02:00:00 +02:00
|
|
|
\ <Plug>VimwikiRenameLink :VimwikiRenameLink<CR>
|
2010-01-20 01:00:00 +01:00
|
|
|
|
2014-01-06 14:11:16 +01:00
|
|
|
if !hasmapto('<Plug>VimwikiDiaryNextDay')
|
|
|
|
nmap <silent><buffer> <C-Down> <Plug>VimwikiDiaryNextDay
|
|
|
|
endif
|
|
|
|
nnoremap <silent><script><buffer>
|
|
|
|
\ <Plug>VimwikiDiaryNextDay :VimwikiDiaryNextDay<CR>
|
|
|
|
|
|
|
|
if !hasmapto('<Plug>VimwikiDiaryPrevDay')
|
|
|
|
nmap <silent><buffer> <C-Up> <Plug>VimwikiDiaryPrevDay
|
|
|
|
endif
|
|
|
|
nnoremap <silent><script><buffer>
|
|
|
|
\ <Plug>VimwikiDiaryPrevDay :VimwikiDiaryPrevDay<CR>
|
|
|
|
|
|
|
|
" List mappings
|
2014-02-04 10:40:14 +01:00
|
|
|
if !hasmapto('<Plug>VimwikiToggleListItem')
|
|
|
|
nmap <silent><buffer> <C-Space> <Plug>VimwikiToggleListItem
|
|
|
|
vmap <silent><buffer> <C-Space> <Plug>VimwikiToggleListItem
|
2010-01-20 01:00:00 +01:00
|
|
|
if has("unix")
|
2014-02-04 10:40:14 +01:00
|
|
|
nmap <silent><buffer> <C-@> <Plug>VimwikiToggleListItem
|
|
|
|
vmap <silent><buffer> <C-@> <Plug>VimwikiToggleListItem
|
2010-01-20 01:00:00 +01:00
|
|
|
endif
|
|
|
|
endif
|
2011-06-11 02:00:00 +02:00
|
|
|
nnoremap <silent><script><buffer>
|
2014-02-04 10:40:14 +01:00
|
|
|
\ <Plug>VimwikiToggleListItem :VimwikiToggleListItem<CR>
|
2013-07-08 11:37:35 +02:00
|
|
|
vnoremap <silent><script><buffer>
|
2014-02-04 10:40:14 +01:00
|
|
|
\ <Plug>VimwikiToggleListItem :VimwikiToggleListItem<CR>
|
2010-01-20 01:00:00 +01:00
|
|
|
|
2014-01-06 14:11:16 +01:00
|
|
|
if !hasmapto('<Plug>VimwikiDecreaseLvlSingleItem', 'i')
|
|
|
|
imap <silent><buffer> <C-D>
|
|
|
|
\ <Plug>VimwikiDecreaseLvlSingleItem
|
|
|
|
endif
|
|
|
|
inoremap <silent><script><buffer> <Plug>VimwikiDecreaseLvlSingleItem
|
|
|
|
\ <C-O>:VimwikiListChangeLvl decrease 0<CR>
|
|
|
|
|
|
|
|
if !hasmapto('<Plug>VimwikiIncreaseLvlSingleItem', 'i')
|
|
|
|
imap <silent><buffer> <C-T>
|
|
|
|
\ <Plug>VimwikiIncreaseLvlSingleItem
|
|
|
|
endif
|
|
|
|
inoremap <silent><script><buffer> <Plug>VimwikiIncreaseLvlSingleItem
|
|
|
|
\ <C-O>:VimwikiListChangeLvl increase 0<CR>
|
|
|
|
|
|
|
|
if !hasmapto('<Plug>VimwikiListNextSymbol', 'i')
|
|
|
|
imap <silent><buffer> <C-L><C-J>
|
|
|
|
\ <Plug>VimwikiListNextSymbol
|
|
|
|
endif
|
|
|
|
inoremap <silent><script><buffer> <Plug>VimwikiListNextSymbol
|
|
|
|
\ <C-O>:VimwikiListChangeSymbolI next<CR>
|
|
|
|
|
|
|
|
if !hasmapto('<Plug>VimwikiListPrevSymbol', 'i')
|
|
|
|
imap <silent><buffer> <C-L><C-K>
|
|
|
|
\ <Plug>VimwikiListPrevSymbol
|
|
|
|
endif
|
|
|
|
inoremap <silent><script><buffer> <Plug>VimwikiListPrevSymbol
|
|
|
|
\ <C-O>:VimwikiListChangeSymbolI prev<CR>
|
|
|
|
|
|
|
|
if !hasmapto('<Plug>VimwikiListToggle', 'i')
|
|
|
|
imap <silent><buffer> <C-L><C-M> <Plug>VimwikiListToggle
|
|
|
|
endif
|
|
|
|
inoremap <silent><script><buffer> <Plug>VimwikiListToggle <Esc>:VimwikiListToggle<CR>
|
|
|
|
|
|
|
|
nnoremap <silent> <buffer> o :call vimwiki#lst#kbd_o()<CR>
|
|
|
|
nnoremap <silent> <buffer> O :call vimwiki#lst#kbd_O()<CR>
|
|
|
|
|
|
|
|
if !hasmapto('<Plug>VimwikiRenumberList')
|
|
|
|
nmap <silent><buffer> glr <Plug>VimwikiRenumberList
|
2010-08-24 02:00:00 +02:00
|
|
|
endif
|
2011-06-11 02:00:00 +02:00
|
|
|
nnoremap <silent><script><buffer>
|
2014-01-06 14:11:16 +01:00
|
|
|
\ <Plug>VimwikiRenumberList :VimwikiRenumberList<CR>
|
2010-08-24 02:00:00 +02:00
|
|
|
|
2014-01-06 14:11:16 +01:00
|
|
|
if !hasmapto('<Plug>VimwikiRenumberAllLists')
|
|
|
|
nmap <silent><buffer> gLr <Plug>VimwikiRenumberAllLists
|
|
|
|
nmap <silent><buffer> gLR <Plug>VimwikiRenumberAllLists
|
2010-08-24 02:00:00 +02:00
|
|
|
endif
|
2011-06-11 02:00:00 +02:00
|
|
|
nnoremap <silent><script><buffer>
|
2014-01-06 14:11:16 +01:00
|
|
|
\ <Plug>VimwikiRenumberAllLists :VimwikiRenumberAllLists<CR>
|
|
|
|
|
|
|
|
if !hasmapto('<Plug>VimwikiDecreaseLvlSingleItem')
|
|
|
|
map <silent><buffer> glh <Plug>VimwikiDecreaseLvlSingleItem
|
|
|
|
endif
|
|
|
|
noremap <silent><script><buffer>
|
|
|
|
\ <Plug>VimwikiDecreaseLvlSingleItem :VimwikiListChangeLvl decrease 0<CR>
|
|
|
|
|
|
|
|
if !hasmapto('<Plug>VimwikiIncreaseLvlSingleItem')
|
|
|
|
map <silent><buffer> gll <Plug>VimwikiIncreaseLvlSingleItem
|
|
|
|
endif
|
|
|
|
noremap <silent><script><buffer>
|
|
|
|
\ <Plug>VimwikiIncreaseLvlSingleItem :VimwikiListChangeLvl increase 0<CR>
|
|
|
|
|
|
|
|
if !hasmapto('<Plug>VimwikiDecreaseLvlWholeItem')
|
|
|
|
map <silent><buffer> gLh <Plug>VimwikiDecreaseLvlWholeItem
|
|
|
|
map <silent><buffer> gLH <Plug>VimwikiDecreaseLvlWholeItem
|
|
|
|
endif
|
|
|
|
noremap <silent><script><buffer>
|
|
|
|
\ <Plug>VimwikiDecreaseLvlWholeItem :VimwikiListChangeLvl decrease 1<CR>
|
|
|
|
|
|
|
|
if !hasmapto('<Plug>VimwikiIncreaseLvlWholeItem')
|
|
|
|
map <silent><buffer> gLl <Plug>VimwikiIncreaseLvlWholeItem
|
|
|
|
map <silent><buffer> gLL <Plug>VimwikiIncreaseLvlWholeItem
|
|
|
|
endif
|
|
|
|
noremap <silent><script><buffer>
|
|
|
|
\ <Plug>VimwikiIncreaseLvlWholeItem :VimwikiListChangeLvl increase 1<CR>
|
|
|
|
|
|
|
|
if !hasmapto('<Plug>VimwikiRemoveSingleCB')
|
|
|
|
map <silent><buffer> gl<Space> <Plug>VimwikiRemoveSingleCB
|
|
|
|
endif
|
|
|
|
noremap <silent><script><buffer>
|
|
|
|
\ <Plug>VimwikiRemoveSingleCB :VimwikiRemoveSingleCB<CR>
|
|
|
|
|
|
|
|
if !hasmapto('<Plug>VimwikiRemoveCBInList')
|
|
|
|
map <silent><buffer> gL<Space> <Plug>VimwikiRemoveCBInList
|
|
|
|
endif
|
|
|
|
noremap <silent><script><buffer>
|
|
|
|
\ <Plug>VimwikiRemoveCBInList :VimwikiRemoveCBInList<CR>
|
|
|
|
|
2014-07-30 21:26:07 +02:00
|
|
|
for s:char in keys(g:vimwiki_bullet_types)
|
|
|
|
if !hasmapto(':VimwikiChangeSymbolTo '.s:char.'<CR>')
|
|
|
|
exe 'noremap <silent><buffer> gl'.s:char.' :VimwikiChangeSymbolTo '.s:char.'<CR>'
|
2014-01-06 14:11:16 +01:00
|
|
|
endif
|
2014-07-30 21:26:07 +02:00
|
|
|
if !hasmapto(':VimwikiChangeSymbolInListTo '.s:char.'<CR>')
|
|
|
|
exe 'noremap <silent><buffer> gL'.s:char.' :VimwikiChangeSymbolInListTo '.s:char.'<CR>'
|
2014-01-06 14:11:16 +01:00
|
|
|
endif
|
|
|
|
endfor
|
2014-07-30 21:26:07 +02:00
|
|
|
|
|
|
|
for s:typ in g:vimwiki_number_types
|
|
|
|
if !hasmapto(':VimwikiChangeSymbolTo '.s:typ.'<CR>')
|
|
|
|
exe 'noremap <silent><buffer> gl'.s:typ[0].' :VimwikiChangeSymbolTo '.s:typ.'<CR>'
|
2014-01-06 14:11:16 +01:00
|
|
|
endif
|
2014-07-30 21:26:07 +02:00
|
|
|
if !hasmapto(':VimwikiChangeSymbolInListTo '.s:typ.'<CR>')
|
|
|
|
exe 'noremap <silent><buffer> gL'.s:typ[0].' :VimwikiChangeSymbolInListTo '.s:typ.'<CR>'
|
2014-01-06 14:11:16 +01:00
|
|
|
endif
|
|
|
|
endfor
|
|
|
|
|
|
|
|
|
2010-08-24 02:00:00 +02:00
|
|
|
|
2013-07-08 11:37:35 +02:00
|
|
|
function! s:CR(normal, just_mrkr) "{{{
|
|
|
|
if g:vimwiki_table_mappings
|
2011-06-11 02:00:00 +02:00
|
|
|
let res = vimwiki#tbl#kbd_cr()
|
2013-07-08 11:37:35 +02:00
|
|
|
if res != ""
|
|
|
|
exe "normal! " . res . "\<Right>"
|
2013-07-30 09:56:33 +02:00
|
|
|
startinsert
|
2013-07-08 11:37:35 +02:00
|
|
|
return
|
|
|
|
endif
|
2010-08-24 02:00:00 +02:00
|
|
|
endif
|
2013-07-08 11:37:35 +02:00
|
|
|
call vimwiki#lst#kbd_cr(a:normal, a:just_mrkr)
|
2010-08-24 02:00:00 +02:00
|
|
|
endfunction "}}}
|
|
|
|
|
2014-01-06 14:11:16 +01:00
|
|
|
if maparg('<CR>', 'i') !~? '<Esc>:VimwikiReturn'
|
|
|
|
inoremap <silent><buffer> <CR> <Esc>:VimwikiReturn 1 5<CR>
|
|
|
|
endif
|
|
|
|
if maparg('<S-CR>', 'i') !~? '<Esc>:VimwikiReturn'
|
|
|
|
inoremap <silent><buffer> <S-CR> <Esc>:VimwikiReturn 2 2<CR>
|
|
|
|
endif
|
2013-07-08 11:37:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
"Table mappings
|
|
|
|
if g:vimwiki_table_mappings
|
|
|
|
inoremap <expr> <buffer> <Tab> vimwiki#tbl#kbd_tab()
|
|
|
|
inoremap <expr> <buffer> <S-Tab> vimwiki#tbl#kbd_shift_tab()
|
|
|
|
endif
|
2012-06-07 02:00:00 +02:00
|
|
|
|
2010-01-20 01:00:00 +01:00
|
|
|
|
2010-02-23 01:00:00 +01:00
|
|
|
|
|
|
|
nnoremap <buffer> gqq :VimwikiTableAlignQ<CR>
|
|
|
|
nnoremap <buffer> gww :VimwikiTableAlignW<CR>
|
2011-06-11 02:00:00 +02:00
|
|
|
if !hasmapto('<Plug>VimwikiTableMoveColumnLeft')
|
|
|
|
nmap <silent><buffer> <A-Left> <Plug>VimwikiTableMoveColumnLeft
|
|
|
|
endif
|
|
|
|
nnoremap <silent><script><buffer>
|
|
|
|
\ <Plug>VimwikiTableMoveColumnLeft :VimwikiTableMoveColumnLeft<CR>
|
|
|
|
if !hasmapto('<Plug>VimwikiTableMoveColumnRight')
|
|
|
|
nmap <silent><buffer> <A-Right> <Plug>VimwikiTableMoveColumnRight
|
|
|
|
endif
|
|
|
|
nnoremap <silent><script><buffer>
|
|
|
|
\ <Plug>VimwikiTableMoveColumnRight :VimwikiTableMoveColumnRight<CR>
|
2010-05-12 02:00:00 +02:00
|
|
|
|
2010-02-23 01:00:00 +01:00
|
|
|
|
|
|
|
|
2010-01-20 01:00:00 +01:00
|
|
|
" Text objects {{{
|
2011-06-11 02:00:00 +02:00
|
|
|
onoremap <silent><buffer> ah :<C-U>call vimwiki#base#TO_header(0, 0)<CR>
|
|
|
|
vnoremap <silent><buffer> ah :<C-U>call vimwiki#base#TO_header(0, 1)<CR>
|
2010-05-12 02:00:00 +02:00
|
|
|
|
2011-06-11 02:00:00 +02:00
|
|
|
onoremap <silent><buffer> ih :<C-U>call vimwiki#base#TO_header(1, 0)<CR>
|
|
|
|
vnoremap <silent><buffer> ih :<C-U>call vimwiki#base#TO_header(1, 1)<CR>
|
2010-05-12 02:00:00 +02:00
|
|
|
|
2011-06-11 02:00:00 +02:00
|
|
|
onoremap <silent><buffer> a\ :<C-U>call vimwiki#base#TO_table_cell(0, 0)<CR>
|
|
|
|
vnoremap <silent><buffer> a\ :<C-U>call vimwiki#base#TO_table_cell(0, 1)<CR>
|
2010-05-12 02:00:00 +02:00
|
|
|
|
2011-06-11 02:00:00 +02:00
|
|
|
onoremap <silent><buffer> i\ :<C-U>call vimwiki#base#TO_table_cell(1, 0)<CR>
|
|
|
|
vnoremap <silent><buffer> i\ :<C-U>call vimwiki#base#TO_table_cell(1, 1)<CR>
|
2010-05-12 02:00:00 +02:00
|
|
|
|
2011-06-11 02:00:00 +02:00
|
|
|
onoremap <silent><buffer> ac :<C-U>call vimwiki#base#TO_table_col(0, 0)<CR>
|
|
|
|
vnoremap <silent><buffer> ac :<C-U>call vimwiki#base#TO_table_col(0, 1)<CR>
|
2010-01-20 01:00:00 +01:00
|
|
|
|
2011-06-11 02:00:00 +02:00
|
|
|
onoremap <silent><buffer> ic :<C-U>call vimwiki#base#TO_table_col(1, 0)<CR>
|
|
|
|
vnoremap <silent><buffer> ic :<C-U>call vimwiki#base#TO_table_col(1, 1)<CR>
|
2010-01-20 01:00:00 +01:00
|
|
|
|
2013-10-30 10:53:34 +01:00
|
|
|
onoremap <silent><buffer> al :<C-U>call vimwiki#lst#TO_list_item(0, 0)<CR>
|
|
|
|
vnoremap <silent><buffer> al :<C-U>call vimwiki#lst#TO_list_item(0, 1)<CR>
|
|
|
|
|
|
|
|
onoremap <silent><buffer> il :<C-U>call vimwiki#lst#TO_list_item(1, 0)<CR>
|
|
|
|
vnoremap <silent><buffer> il :<C-U>call vimwiki#lst#TO_list_item(1, 1)<CR>
|
|
|
|
|
2012-06-07 02:00:00 +02:00
|
|
|
if !hasmapto('<Plug>VimwikiAddHeaderLevel')
|
|
|
|
nmap <silent><buffer> = <Plug>VimwikiAddHeaderLevel
|
|
|
|
endif
|
|
|
|
nnoremap <silent><buffer> <Plug>VimwikiAddHeaderLevel :
|
|
|
|
\<C-U>call vimwiki#base#AddHeaderLevel()<CR>
|
|
|
|
|
|
|
|
if !hasmapto('<Plug>VimwikiRemoveHeaderLevel')
|
|
|
|
nmap <silent><buffer> - <Plug>VimwikiRemoveHeaderLevel
|
|
|
|
endif
|
|
|
|
nnoremap <silent><buffer> <Plug>VimwikiRemoveHeaderLevel :
|
|
|
|
\<C-U>call vimwiki#base#RemoveHeaderLevel()<CR>
|
|
|
|
|
2010-01-20 01:00:00 +01:00
|
|
|
|
|
|
|
" }}}
|
|
|
|
|
|
|
|
" KEYBINDINGS }}}
|
2010-02-23 01:00:00 +01:00
|
|
|
|
|
|
|
" AUTOCOMMANDS {{{
|
2014-11-11 13:52:18 +01:00
|
|
|
if VimwikiGet('auto_export')
|
|
|
|
" Automatically generate HTML on page write.
|
|
|
|
augroup vimwiki
|
|
|
|
au BufWritePost <buffer>
|
|
|
|
\ call vimwiki#html#Wiki2HTML(expand(VimwikiGet('path_html')),
|
|
|
|
\ expand('%'))
|
|
|
|
augroup END
|
|
|
|
endif
|
2014-02-18 14:47:42 +01:00
|
|
|
|
2014-11-11 13:52:18 +01:00
|
|
|
if VimwikiGet('auto_toc')
|
|
|
|
" Automatically update the TOC *before* the file is written
|
2010-02-23 01:00:00 +01:00
|
|
|
augroup vimwiki
|
2014-11-11 13:52:18 +01:00
|
|
|
au BufWritePre <buffer> call vimwiki#base#table_of_contents(0)
|
2010-02-23 01:00:00 +01:00
|
|
|
augroup END
|
|
|
|
endif
|
2015-01-02 22:59:18 +01:00
|
|
|
|
|
|
|
if VimwikiGet('auto_tags')
|
|
|
|
" Automatically update tags metadata on page write.
|
|
|
|
augroup vimwiki
|
|
|
|
au BufWritePost <buffer> call vimwiki#base#update_tags(0)
|
|
|
|
augroup END
|
|
|
|
endif
|
2010-02-23 01:00:00 +01:00
|
|
|
" AUTOCOMMANDS }}}
|
2012-06-07 02:00:00 +02:00
|
|
|
|
|
|
|
" PASTE, CAT URL {{{
|
|
|
|
" html commands
|
|
|
|
command! -buffer VimwikiPasteUrl call vimwiki#html#PasteUrl(expand('%:p'))
|
|
|
|
command! -buffer VimwikiCatUrl call vimwiki#html#CatUrl(expand('%:p'))
|
|
|
|
" }}}
|
|
|
|
|
|
|
|
" DEBUGGING {{{
|
|
|
|
command! VimwikiPrintWikiState call vimwiki#base#print_wiki_state()
|
|
|
|
command! VimwikiReadLocalOptions call vimwiki#base#read_wiki_options(1)
|
|
|
|
" }}}
|