diff --git a/.vimrc b/.vimrc index 4bfd979..d5df0a9 100644 --- a/.vimrc +++ b/.vimrc @@ -1,5 +1,4 @@ "Basic setup for all files {{{ -call system('message.py vimrc start') set nocompatible "VIM over VI filetype plugin indent on "turn plugins/indent on @@ -51,7 +50,7 @@ set t_vb= "Turn beeping off set tabstop=4 "Set tab stop to 4 set updatecount=50 "After typing this many chars the swap file will be written to disk set viewoptions-=options "Don't store options in view stored in ~/.vim/view dir -set viminfo='20,\"50 "Configure .viminfo +set viminfo='20,<1000,h,f0 "Configure .viminfo set whichwrap+=<,>,[,] "Cursor keys wrap to previous/next line set wildchar= "Character to start wildcard expansion in the command-line set wildmenu "Put command-line completion in an enhanced mode @@ -206,7 +205,7 @@ nmap ,cn :silent call CopyFileName(1) nmap ,cs :silent call CopyFileName(0) "FuzzyFinder plugin. Keys for file fuf -map :FufFile **/ +map :TlistToo!:FufFile **/ " }}} " FUNCTIONS: usefull functions for all of th files {{{ "Sessions diff --git a/GetLatest/GetLatestVimScripts.dat b/GetLatest/GetLatestVimScripts.dat index 8721ab5..ce444c5 100644 --- a/GetLatest/GetLatestVimScripts.dat +++ b/GetLatest/GetLatestVimScripts.dat @@ -1,14 +1,14 @@ ScriptID SourceID Filename -------------------------- ### plugins -102 9375 DirDiff.vim +102 13435 DirDiff.vim 1658 11834 NERD_tree.vim #2754 13139 :AutoInstall: delimitMate.vim 1984 11852 fuzzyfinder.vim 642 8136 :AutoInstall: getscript.vim 311 7645 grep.vim 2727 11120 jsbeautify.vim -2666 12423 Mark +2666 13424 Mark 2262 8944 occur.vim 910 13092 pydoc.vim #2421 9423 pysmell.vim @@ -17,18 +17,18 @@ ScriptID SourceID Filename 1697 12566 :AutoInstall: surround.vim #273 7701 taglist.vim # exchanged with taglisttoo 2607 10388 tasklist.vim -90 12743 vcscommand.vim -2226 12995 vimwiki.vim +90 13632 vcscommand.vim +2226 13667 vimwiki.vim 1334 6377 vst.vim ### colors 1975 7471 lettuce.vim -2536 13089 lucius.vim +2536 13588 lucius.vim 1165 3741 tolerable.vim -2465 11352 wombat256.vim +2465 13400 wombat256.vim # compiler 891 10365 pylint.vim # ftplugin -2441 13300 pyflakes.vim +2441 13378 pyflakes.vim 30 9196 python_fn.vim 1542 10872 pythoncomplete.vim ### indent diff --git a/autoload/mark.vim b/autoload/mark.vim index 1c7ffe7..9ebabb6 100644 --- a/autoload/mark.vim +++ b/autoload/mark.vim @@ -10,8 +10,14 @@ " Dependencies: " - SearchSpecial.vim autoload script (optional, for improved search messages). " -" Version: 2.3.3 +" Version: 2.4.0 " Changes: +" 13-Jul-2010, Ingo Karkat +" - ENH: The MarkSearch mappings ([*#/?]) add the original cursor +" position to the jump list, like the built-in [/?*#nN] commands. This allows +" to use the regular jump commands for mark matches, like with regular search +" matches. +" " 19-Feb-2010, Andy Wokula " - BUG: Clearing of an accidental zero-width match (e.g. via :Mark \zs) results " in endless loop. Thanks to Andy Wokula for the patch. @@ -386,8 +392,21 @@ function! s:Search( pattern, isBackward, currentMarkPosition, searchType ) " mark; that's why we exclude a possible wrap-around via v:count1 == 1. let l:isStuckAtCurrentMark = ([l:line, l:col] == a:currentMarkPosition && v:count1 == 1) if l:line > 0 && ! l:isStuckAtCurrentMark + let l:matchPosition = getpos('.') + + " Open fold at the search result, like the built-in commands. normal! zv + " Add the original cursor position to the jump list, like the + " [/?*#nN] commands. + " Implementation: Memorize the match position, restore the view to the state + " before the search, then jump straight back to the match position. This + " also allows us to set a jump only if a match was found. (:call + " setpos("''", ...) doesn't work in Vim 7.2) + call winrestview(l:save_view) + normal! m' + call setpos('.', l:matchPosition) + if l:isWrapped call s:WrapMessage(a:searchType, a:pattern, a:isBackward) else diff --git a/autoload/vimwiki.vim b/autoload/vimwiki.vim index 61c2972..c023ce2 100644 --- a/autoload/vimwiki.vim +++ b/autoload/vimwiki.vim @@ -65,7 +65,7 @@ function! vimwiki#current_subdir()"{{{ endfunction"}}} function! vimwiki#open_link(cmd, link, ...) "{{{ - if s:is_link_to_non_wiki_file(a:link) + if vimwiki#is_non_wiki_link(a:link) call s:edit_file(a:cmd, a:link) else if a:0 @@ -127,6 +127,13 @@ function! vimwiki#generate_links()"{{{ endfor endfunction " }}} +function! vimwiki#goto(key) "{{{ + call s:edit_file(':e', + \ VimwikiGet('path'). + \ a:key. + \ VimwikiGet('ext')) +endfunction "}}} + function! s:is_windows() "{{{ return has("win32") || has("win64") || has("win95") || has("win16") endfunction "}}} @@ -134,15 +141,21 @@ endfunction "}}} function! s:get_links(pat) "{{{ " search all wiki files in 'path' and its subdirs. let subdir = vimwiki#current_subdir() - let globlinks = glob(VimwikiGet('path').subdir.'**/'.a:pat) - " remove .wiki extensions - let globlinks = substitute(globlinks, '\'.VimwikiGet('ext'), "", "g") + " if current wiki is temporary -- was added by an arbitrary wiki file then do + " not search wiki files in subdirectories. Or it would hang the system if + " wiki file was created in $HOME or C:/ dirs. + if VimwikiGet('temp') + let search_dirs = '' + else + let search_dirs = '**/' + endif + let globlinks = glob(VimwikiGet('path').subdir.search_dirs.a:pat) + + " remove extensions (and backup extensions too: .wiki~) + let globlinks = substitute(globlinks, '\'.VimwikiGet('ext').'\~\?', "", "g") let links = split(globlinks, '\n') - " remove backup files (.wiki~) - call filter(links, 'v:val !~ ''.*\~$''') - " remove paths let rem_path = escape(expand(VimwikiGet('path')).subdir, '\') call map(links, 'substitute(v:val, rem_path, "", "g")') @@ -235,15 +248,15 @@ function! s:strip_word(word) "{{{ endfunction " }}} -function! s:is_link_to_non_wiki_file(link) "{{{ - " Check if link is to a non-wiki file. - " The easiest way is to check if it has extension like .txt or .html - if a:link =~ '\.\w\{1,4}$' +function! vimwiki#is_non_wiki_link(lnk) "{{{ + let exts = '.\+\.\%('. + \ join(split(g:vimwiki_file_exts, '\s*,\s*'), '\|'). + \ '\)$' + if a:lnk =~ exts return 1 endif return 0 -endfunction -" }}} +endfunction "}}} function! vimwiki#is_link_to_dir(link) "{{{ " Check if link is to a directory. @@ -252,8 +265,7 @@ function! vimwiki#is_link_to_dir(link) "{{{ return 1 endif return 0 -endfunction -" }}} +endfunction " }}} function! s:print_wiki_list() "{{{ let idx = 0 @@ -294,19 +306,23 @@ endfunction function! s:update_wiki_links_dir(dir, old_fname, new_fname) " {{{ let old_fname = substitute(a:old_fname, '[/\\]', '[/\\\\]', 'g') let new_fname = a:new_fname + let old_fname_r = old_fname + let new_fname_r = new_fname - if !s:is_wiki_word(new_fname) - let new_fname = '[['.new_fname.']]' + if !s:is_wiki_word(new_fname) && s:is_wiki_word(old_fname) + let new_fname_r = '[['.new_fname.']]' endif + if !s:is_wiki_word(old_fname) - let old_fname = '\[\['.vimwiki#unsafe_link(old_fname). - \ '\%(|.*\)\?\%(\]\[.*\)\?\]\]' + let old_fname_r = '\[\[\zs'.vimwiki#unsafe_link(old_fname). + \ '\ze\%(|.*\)\?\%(\]\[.*\)\?\]\]' else - let old_fname = '\<'.old_fname.'\>' + let old_fname_r = '\<'.old_fname.'\>' endif + let files = split(glob(VimwikiGet('path').a:dir.'*'.VimwikiGet('ext')), '\n') for fname in files - call s:update_wiki_link(fname, old_fname, new_fname) + call s:update_wiki_link(fname, old_fname_r, new_fname_r) endfor endfunction " }}} @@ -348,8 +364,7 @@ function! s:update_wiki_links(old_fname, new_fname) " {{{ \ new_dir.old_fname, new_dir.new_fname) let idx = idx + 1 endwhile -endfunction -" }}} +endfunction " }}} function! s:get_wiki_buffers() "{{{ let blist = [] @@ -365,21 +380,58 @@ function! s:get_wiki_buffers() "{{{ let bcount = bcount + 1 endwhile return blist -endfunction -" }}} +endfunction " }}} function! s:open_wiki_buffer(item) "{{{ call s:edit_file('e', a:item[0]) if !empty(a:item[1]) call setbufvar(a:item[0], "vimwiki_prev_link", a:item[1]) endif -endfunction -" }}} +endfunction " }}} " }}} " SYNTAX highlight {{{ -function! vimwiki#WikiHighlightLinks() "{{{ +function! vimwiki#highlight_links() "{{{ + try + syntax clear VimwikiNoExistsLink + syntax clear VimwikiNoExistsLinkT + syntax clear VimwikiLink + syntax clear VimwikiLinkT + catch + endtry + + "" use max highlighting - could be quite slow if there are too many wikifiles + if VimwikiGet('maxhi') + " Every WikiWord is nonexistent + if g:vimwiki_camel_case + execute 'syntax match VimwikiNoExistsLink /'.g:vimwiki_rxWikiWord.'/ display' + execute 'syntax match VimwikiNoExistsLinkT /'.g:vimwiki_rxWikiWord.'/ display contained' + endif + execute 'syntax match VimwikiNoExistsLink /'.g:vimwiki_rxWikiLink1.'/ display contains=VimwikiNoLinkChar' + execute 'syntax match VimwikiNoExistsLink /'.g:vimwiki_rxWikiLink2.'/ display contains=VimwikiNoLinkChar' + + execute 'syntax match VimwikiNoExistsLinkT /'.g:vimwiki_rxWikiLink1.'/ display contained' + execute 'syntax match VimwikiNoExistsLinkT /'.g:vimwiki_rxWikiLink2.'/ display contained' + + " till we find them in vimwiki's path + call s:highlight_existed_links() + else + " A WikiWord (unqualifiedWikiName) + execute 'syntax match VimwikiLink /\<'.g:vimwiki_rxWikiWord.'\>/' + " A [[bracketed wiki word]] + execute 'syntax match VimwikiLink /'.g:vimwiki_rxWikiLink1.'/ display contains=VimwikiLinkChar' + execute 'syntax match VimwikiLink /'.g:vimwiki_rxWikiLink2.'/ display contains=VimwikiLinkChar' + + execute 'syntax match VimwikiLinkT /\<'.g:vimwiki_rxWikiWord.'\>/ display contained' + execute 'syntax match VimwikiLinkT /'.g:vimwiki_rxWikiLink1.'/ display contained' + execute 'syntax match VimwikiLinkT /'.g:vimwiki_rxWikiLink2.'/ display contained' + endif + + execute 'syntax match VimwikiLink `'.g:vimwiki_rxWeblink.'` display contains=@NoSpell' +endfunction "}}} + +function! s:highlight_existed_links() "{{{ let links = s:get_links('*'.VimwikiGet('ext')) " Links with subdirs should be highlighted for linux and windows separators @@ -390,31 +442,116 @@ function! vimwiki#WikiHighlightLinks() "{{{ for link in links if g:vimwiki_camel_case && - \ link =~ g:vimwiki_rxWikiWord && !s:is_link_to_non_wiki_file(link) - execute 'syntax match VimwikiLink /!\@/' + \ link =~ g:vimwiki_rxWikiWord && !vimwiki#is_non_wiki_link(link) + execute 'syntax match VimwikiLink /!\@/ display' endif - execute 'syntax match VimwikiLink /\[\[\<'. - \ vimwiki#unsafe_link(link). - \ '\>\%(|\+.*\)*\]\]/' - execute 'syntax match VimwikiLink /\[\[\<'. - \ vimwiki#unsafe_link(link). - \ '\>\]\[.\+\]\]/' + execute 'syntax match VimwikiLink /\[\['. + \ escape(vimwiki#unsafe_link(link), '~&$.*'). + \ '\%(|\+.\{-}\)\{-}\]\]/ display contains=VimwikiLinkChar' + execute 'syntax match VimwikiLink /\[\['. + \ escape(vimwiki#unsafe_link(link), '~&$.*'). + \ '\]\[.\{-1,}\]\]/ display contains=VimwikiLinkChar' + + execute 'syntax match VimwikiLinkT /\[\['. + \ escape(vimwiki#unsafe_link(link), '~&$.*'). + \ '\%(|\+.\{-}\)\{-}\]\]/ display contained' + execute 'syntax match VimwikiLinkT /\[\['. + \ escape(vimwiki#unsafe_link(link), '~&$.*'). + \ '\]\[.\{-1,}\]\]/ display contained' endfor - execute 'syntax match VimwikiLink /\[\[.\+\.\%(jpg\|png\|gif\)\%(|\+.*\)*\]\]/' - execute 'syntax match VimwikiLink /\[\[.\+\.\%(jpg\|png\|gif\)\]\[.\+\]\]/' + execute 'syntax match VimwikiLink /\[\[.\+\.\%(jpg\|png\|gif\)\%(|\+.*\)*\]\]/ display contains=VimwikiLinkChar' + execute 'syntax match VimwikiLink /\[\[.\+\.\%(jpg\|png\|gif\)\]\[.\+\]\]/ display contains=VimwikiLinkChar' + + execute 'syntax match VimwikiLinkT /\[\[.\+\.\%(jpg\|png\|gif\)\%(|\+.*\)*\]\]/ display contained' + execute 'syntax match VimwikiLinkT /\[\[.\+\.\%(jpg\|png\|gif\)\]\[.\+\]\]/ display contained' + + " Issue 103: Always highlight links to non-wiki files as existed. + execute 'syntax match VimwikiLink /\[\[.\+\.\%('. + \join(split(g:vimwiki_file_exts, '\s*,\s*'), '\|'). + \'\)\%(|\+.*\)*\]\]/ display contains=VimwikiLinkChar' + execute 'syntax match VimwikiLink /\[\[.\+\.\%('. + \join(split(g:vimwiki_file_exts, '\s*,\s*'), '\|'). + \'\)\]\[.\+\]\]/ display contains=VimwikiLinkChar' + + execute 'syntax match VimwikiLinkT /\[\[.\+\.\%('. + \join(split(g:vimwiki_file_exts, '\s*,\s*'), '\|'). + \'\)\%(|\+.*\)*\]\]/ display contained' + execute 'syntax match VimwikiLinkT /\[\[.\+\.\%('. + \join(split(g:vimwiki_file_exts, '\s*,\s*'), '\|'). + \'\)\]\[.\+\]\]/ display contained' " highlight dirs let dirs = s:get_links('*/') call map(dirs, 'substitute(v:val, os_p, os_p2, "g")') for dir in dirs - execute 'syntax match VimwikiLink /\[\[\<'. - \ vimwiki#unsafe_link(dir). - \ '\>[/\\]*\%(|\+.*\)*\]\]/' - endfor -endfunction -" }}} + execute 'syntax match VimwikiLink /\[\['. + \ escape(vimwiki#unsafe_link(dir), '~&$.*'). + \ '[/\\]*\%(|\+.*\)*\]\]/ display contains=VimwikiLinkChar' + execute 'syntax match VimwikiLink /\[\['. + \ escape(vimwiki#unsafe_link(dir), '~&$.*'). + \ '[/\\]*\%(\]\[\+.*\)*\]\]/ display contains=VimwikiLinkChar' -function! vimwiki#hl_exists(hl)"{{{ + execute 'syntax match VimwikiLinkT /\[\['. + \ escape(vimwiki#unsafe_link(dir), '~&$.*'). + \ '[/\\]*\%(|\+.*\)*\]\]/ display contained' + execute 'syntax match VimwikiLinkT /\[\['. + \ escape(vimwiki#unsafe_link(dir), '~&$.*'). + \ '[/\\]*\%(\]\[\+.*\)*\]\]/ display contained' + endfor +endfunction "}}} + +function! vimwiki#setup_colors() "{{{ + + function! s:set_visible_ignore_color() "{{{ + if !exists("g:colors_name") || g:colors_name == 'default' + if &background == 'light' + hi VimwikiIgnore guifg=#d0d0d0 + else + hi VimwikiIgnore guifg=#505050 + endif + else + hi link VimwikiIgnore Normal + endif + endfunction "}}} + + let hlfg_ignore = vimwiki#get_hl_param('Ignore', 'guifg') + let hlbg_normal = vimwiki#get_hl_param('Normal', 'guibg') + if hlfg_ignore == 'bg' || hlfg_ignore == hlbg_normal + call s:set_visible_ignore_color() + else + hi link VimwikiIgnore Ignore + endif + + if g:vimwiki_hl_headers == 0 + hi def link VimwikiHeader Title + return + endif + + if &background == 'light' + hi def VimwikiHeader1 guibg=bg guifg=#aa5858 gui=bold ctermfg=DarkRed + hi def VimwikiHeader2 guibg=bg guifg=#507030 gui=bold ctermfg=DarkGreen + hi def VimwikiHeader3 guibg=bg guifg=#1030a0 gui=bold ctermfg=DarkBlue + hi def VimwikiHeader4 guibg=bg guifg=#103040 gui=bold ctermfg=Black + hi def VimwikiHeader5 guibg=bg guifg=#505050 gui=bold ctermfg=Black + hi def VimwikiHeader6 guibg=bg guifg=#636363 gui=bold ctermfg=Black + else + hi def VimwikiHeader1 guibg=bg guifg=#e08090 gui=bold ctermfg=Red + hi def VimwikiHeader2 guibg=bg guifg=#80e090 gui=bold ctermfg=Green + hi def VimwikiHeader3 guibg=bg guifg=#6090e0 gui=bold ctermfg=Blue + hi def VimwikiHeader4 guibg=bg guifg=#c0c0f0 gui=bold ctermfg=White + hi def VimwikiHeader5 guibg=bg guifg=#e0e0f0 gui=bold ctermfg=White + hi def VimwikiHeader6 guibg=bg guifg=#f0f0f0 gui=bold ctermfg=White + endif +endfunction "}}} + +function vimwiki#get_hl_param(hgroup, hparam) "{{{ + redir => hlstatus + exe "silent hi ".a:hgroup + redir END + return matchstr(hlstatus, a:hparam.'\s*=\s*\zs\S\+') +endfunction "}}} + +function! vimwiki#hl_exists(hl) "{{{ if !hlexists(a:hl) return 0 endif @@ -454,26 +591,38 @@ function! vimwiki#nested_syntax(filetype, start, end, textSnipHl) abort "{{{ else unlet b:current_syntax endif - execute 'syntax region textSnip'.ft.' - \ matchgroup='.a:textSnipHl.' - \ start="'.a:start.'" end="'.a:end.'" - \ contains=@'.group + execute 'syntax region textSnip'.ft. + \ ' matchgroup='.a:textSnipHl. + \ ' start="'.a:start.'" end="'.a:end.'"'. + \ ' contains=@'.group.' keepend' + + " A workaround to Issue 115: Nested Perl syntax highlighting differs from + " regular one. + " Perl syntax file has perlFunctionName which is usually has no effect due to + " 'contained' flag. Now we have 'syntax include' that makes all the groups + " included as 'contained' into specific group. + " Here perlFunctionName (with quite an angry regexp "\h\w*[^:]") clashes with + " the rest syntax rules as now it has effect being really 'contained'. + " Clear it! + if ft =~ 'perl' + syntax clear perlFunctionName + endif endfunction "}}} "}}} " WIKI functions {{{ -function! vimwiki#WikiNextWord() "{{{ +function! vimwiki#find_next_link() "{{{ call s:search_word(g:vimwiki_rxWikiLink.'\|'.g:vimwiki_rxWeblink, '') endfunction " }}} -function! vimwiki#WikiPrevWord() "{{{ +function! vimwiki#find_prev_link() "{{{ call s:search_word(g:vimwiki_rxWikiLink.'\|'.g:vimwiki_rxWeblink, 'b') endfunction " }}} -function! vimwiki#WikiFollowWord(split) "{{{ +function! vimwiki#follow_link(split) "{{{ if a:split == "split" let cmd = ":split " elseif a:split == "vsplit" @@ -486,7 +635,7 @@ function! vimwiki#WikiFollowWord(split) "{{{ if link == "" let weblink = s:strip_word(s:get_word_at_cursor(g:vimwiki_rxWeblink)) if weblink != "" - call VimwikiWeblinkHandler(weblink) + call VimwikiWeblinkHandler(escape(weblink, '#')) else execute "normal! \n" endif @@ -496,20 +645,18 @@ function! vimwiki#WikiFollowWord(split) "{{{ let subdir = vimwiki#current_subdir() call vimwiki#open_link(cmd, subdir.link) -endfunction -" }}} +endfunction " }}} -function! vimwiki#WikiGoBackWord() "{{{ +function! vimwiki#go_back_link() "{{{ if exists("b:vimwiki_prev_link") " go back to saved WikiWord let prev_word = b:vimwiki_prev_link execute ":e ".substitute(prev_word[0], '\s', '\\\0', 'g') call setpos('.', prev_word[1]) endif -endfunction -" }}} +endfunction " }}} -function! vimwiki#WikiGoHome(index) "{{{ +function! vimwiki#goto_index(index) "{{{ call vimwiki#select(a:index) call vimwiki#mkdir(VimwikiGet('path')) @@ -517,17 +664,15 @@ function! vimwiki#WikiGoHome(index) "{{{ execute ':e '.fnameescape( \ VimwikiGet('path').VimwikiGet('index').VimwikiGet('ext')) catch /E37/ " catch 'No write since last change' error - " this is really unsecure!!! - execute ':'.VimwikiGet('gohome').' '. + execute ':split '. \ VimwikiGet('path'). \ VimwikiGet('index'). \ VimwikiGet('ext') catch /E325/ " catch 'ATTENTION' error (:h E325) endtry -endfunction -"}}} +endfunction "}}} -function! vimwiki#WikiDeleteWord() "{{{ +function! vimwiki#delete_link() "{{{ "" file system funcs "" Delete WikiWord you are in from filesystem let val = input('Delete ['.expand('%').'] (y/n)? ', "") @@ -547,10 +692,9 @@ function! vimwiki#WikiDeleteWord() "{{{ if expand('%:p') != "" execute "e" endif -endfunction -"}}} +endfunction "}}} -function! vimwiki#WikiRenameWord() "{{{ +function! vimwiki#rename_link() "{{{ "" Rename WikiWord, update all links to renamed WikiWord let subdir = vimwiki#current_subdir() let old_fname = subdir.expand('%:t') @@ -575,18 +719,17 @@ function! vimwiki#WikiRenameWord() "{{{ return endif - let new_link = subdir.new_link - " check new_fname - it should be 'good', not empty if substitute(new_link, '\s', '', 'g') == '' echomsg 'vimwiki: Cannot rename to an empty filename!' return endif - if s:is_link_to_non_wiki_file(new_link) + if vimwiki#is_non_wiki_link(new_link) echomsg 'vimwiki: Cannot rename to a filename with extension (ie .txt .html)!' return endif + let new_link = subdir.new_link let new_link = s:strip_word(new_link) let new_fname = VimwikiGet('path').s:filename(new_link).VimwikiGet('ext') @@ -649,16 +792,15 @@ function! vimwiki#WikiRenameWord() "{{{ echomsg old_fname." is renamed to ".new_fname let &more = setting_more -endfunction -" }}} +endfunction " }}} -function! vimwiki#WikiUISelect()"{{{ +function! vimwiki#ui_select()"{{{ call s:print_wiki_list() let idx = input("Select Wiki (specify number): ") if idx == "" return endif - call vimwiki#WikiGoHome(idx) + call vimwiki#goto_index(idx) endfunction "}}} diff --git a/autoload/vimwiki_diary.vim b/autoload/vimwiki_diary.vim index 37b7eed..9803cc1 100644 --- a/autoload/vimwiki_diary.vim +++ b/autoload/vimwiki_diary.vim @@ -62,7 +62,7 @@ function! s:get_diary_range(lines, header) "{{{ let idx += 1 endfor - let ln_end = idx - 1 + let ln_end = idx return [ln_start, ln_end] endfunction "}}} @@ -99,10 +99,24 @@ function! s:get_links() "{{{ call map(links, 'fnamemodify(v:val, ":t")') call filter(links, 'v:val =~ "'.escape(rx, '\').'"') - call map(links, '"[[".v:val."]]"') return links endfunction "}}} +function! s:get_position_links(link) "{{{ + let idx = -1 + let links = [] + if a:link =~ '\d\{4}-\d\d-\d\d' + let links = s:get_links() + " include 'today' into links + if index(links, s:diary_date_link()) == -1 + call add(links, s:diary_date_link()) + endif + call sort(links) + let idx = index(links, a:link) + endif + return [idx, links] +endfunction "}}} + function! s:format_links(links) "{{{ let lines = [] let line = '| ' @@ -137,6 +151,7 @@ function! s:add_link(page, header, link) "{{{ if ln_start == -1 call insert(lines, '= '.a:header.' =') let ln_start = 1 + let ln_end = 1 endif " removing 'old' links @@ -148,6 +163,7 @@ function! s:add_link(page, header, link) "{{{ " get all diary links from filesystem let links = s:get_links() + call map(links, '"[[".v:val."]]"') " add current link if index(links, link) == -1 @@ -192,7 +208,7 @@ function! vimwiki_diary#make_note(index, ...) "{{{ call vimwiki#open_link(':e ', link, s:diary_index()) endfunction "}}} -" Calendar.vim callback and sign functions. +" Calendar.vim callback function. function! vimwiki_diary#calendar_action(day, month, year, week, dir) "{{{ let day = s:prefix_zero(a:day) let month = s:prefix_zero(a:month) @@ -213,8 +229,9 @@ function! vimwiki_diary#calendar_action(day, month, year, week, dir) "{{{ " Create diary note for a selected date in default wiki. call vimwiki_diary#make_note(1, link) -endfunction +endfunction "}}} +" Calendar.vim sign function. function vimwiki_diary#calendar_sign(day, month, year) "{{{ let day = s:prefix_zero(a:day) let month = s:prefix_zero(a:month) @@ -222,3 +239,43 @@ function vimwiki_diary#calendar_sign(day, month, year) "{{{ \ a:year.'-'.month.'-'.day.VimwikiGet('ext') return filereadable(expand(sfile)) endfunction "}}} + +function! vimwiki_diary#goto_next_day() "{{{ + let link = '' + let [idx, links] = s:get_position_links(expand('%:t:r')) + + if idx == (len(links) - 1) + return + endif + + if idx != -1 && idx < len(links) - 1 + let link = VimwikiGet('diary_rel_path').links[idx+1] + else + " goto today + let link = VimwikiGet('diary_rel_path').s:diary_date_link() + endif + + if len(link) + call vimwiki#open_link(':e ', link) + endif +endfunction "}}} + +function! vimwiki_diary#goto_prev_day() "{{{ + let link = '' + let [idx, links] = s:get_position_links(expand('%:t:r')) + + if idx == 0 + return + endif + + if idx > 0 + let link = VimwikiGet('diary_rel_path').links[idx-1] + else + " goto today + let link = VimwikiGet('diary_rel_path').s:diary_date_link() + endif + + if len(link) + call vimwiki#open_link(':e ', link) + endif +endfunction "}}} diff --git a/autoload/vimwiki_html.vim b/autoload/vimwiki_html.vim index 3c88ecc..1efa539 100644 --- a/autoload/vimwiki_html.vim +++ b/autoload/vimwiki_html.vim @@ -48,14 +48,6 @@ function! s:is_img_link(lnk) "{{{ return 0 endfunction "}}} -function! s:is_non_wiki_link(lnk) "{{{ - " TODO: Add more file extensions here - if a:lnk =~ '.\+\.\%(pdf\|txt\|doc\|rtf\|xls\)$' - return 1 - endif - return 0 -endfunction "}}} - function! s:has_abs_path(fname) "{{{ if a:fname =~ '\(^.:\)\|\(^/\)' return 1 @@ -102,15 +94,13 @@ function! s:create_default_CSS(path) " {{{ endif endfunction "}}} -function! s:get_html_header(wikifile, subdir, charset) "{{{ +function! s:get_html_header(title, subdir, charset) "{{{ let lines=[] - let title = fnamemodify(a:wikifile, ":t:r") - if VimwikiGet('html_header') != "" && !s:warn_html_header try let lines = readfile(expand(VimwikiGet('html_header'))) - call map(lines, 'substitute(v:val, "%title%", "'. title .'", "g")') + call map(lines, 'substitute(v:val, "%title%", "'. a:title .'", "g")') call map(lines, 'substitute(v:val, "%root_path%", "'. \ s:root_path(a:subdir) .'", "g")') return lines @@ -134,7 +124,7 @@ function! s:get_html_header(wikifile, subdir, charset) "{{{ call add(lines, '') call add(lines, '') - call add(lines, ''.title.'') + call add(lines, ''.a:title.'') call add(lines, '') call add(lines, '') @@ -171,11 +161,13 @@ function! s:safe_html(line) "{{{ let line = substitute(a:line, '&', '\&', 'g') - " let line = substitute(line, '<', '\<', 'g') - " let line = substitute(line, '>', '\>', 'g') - " XXX: I believe there should be a much nicer way to do it. - let line = substitute(line, '<\(br\|hr\)\@!', '\<', 'g') - let line = substitute(line, '\(\(br\|hr\)\s*/\?\)\@', '\>', 'g') + let tags = join(split(g:vimwiki_valid_html_tags, '\s*,\s*'), '\|') + let line = substitute(line,'<\%(/\?\%(' + \.tags.'\)\%(\s\{-1}\S\{-}\)\{-}/\?>\)\@!', + \'\<', 'g') + let line = substitute(line,'\%(', + \'\>', 'g') return line endfunction "}}} @@ -299,23 +291,36 @@ function! s:get_html_toc(toc_list) "{{{ return toc endfunction "}}} -" insert placeholder's contents into dest. -function! s:process_placeholders(dest, placeholders, type, ins_content) "{{{ +" insert toc into dest. +function! s:process_toc(dest, placeholders, toc) "{{{ if !empty(a:placeholders) for [placeholder, row, idx] in a:placeholders let [type, param] = placeholder - if type == a:type - let ins_content = a:ins_content[:] + if type == 'toc' + let toc = a:toc[:] if !empty(param) - call insert(ins_content, '

'.param.'

') + call insert(toc, '

'.param.'

') endif - let shift = idx * len(ins_content) - call extend(a:dest, ins_content, row + shift) + let shift = idx * len(toc) + call extend(a:dest, toc, row + shift) endif endfor endif endfunction "}}} +" get title. +function! s:process_title(placeholders, default_title) "{{{ + if !empty(a:placeholders) + for [placeholder, row, idx] in a:placeholders + let [type, param] = placeholder + if type == 'title' && !empty(param) + return param + endif + endfor + endif + return a:default_title +endfunction "}}} + "}}} " INLINE TAGS "{{{ @@ -371,7 +376,7 @@ function! s:tag_internal_link(value) "{{{ if s:is_img_link(a:caption) let link = ''. \ '' - elseif s:is_non_wiki_link(a:src) + elseif vimwiki#is_non_wiki_link(a:src) let link = ''.a:caption.'' elseif s:is_img_link(a:src) let link = ''.a:caption.'' @@ -592,8 +597,8 @@ endfunction " }}} " BLOCK TAGS {{{ function! s:close_tag_pre(pre, ldest) "{{{ - if a:pre - call insert(a:ldest, "") + if a:pre[0] + call insert(a:ldest, "") return 0 endif return a:pre @@ -671,8 +676,8 @@ endfunction "}}} function! s:close_tag_list(lists, ldest) "{{{ while len(a:lists) - let item = remove(a:lists, -1) - call add(a:ldest, item[0]) + let item = remove(a:lists, 0) + call insert(a:ldest, item[0]) endwhile endfunction! "}}} @@ -685,10 +690,11 @@ function! s:close_tag_def_list(deflist, ldest) "{{{ endfunction! "}}} function! s:process_tag_pre(line, pre) "{{{ + " pre is the list of [is_in_pre, indent_of_pre] let lines = [] let pre = a:pre let processed = 0 - if !pre && a:line =~ '{{{[^\(}}}\)]*\s*$' + if !pre[0] && a:line =~ '^\s*{{{[^\(}}}\)]*\s*$' let class = matchstr(a:line, '{{{\zs.*$') let class = substitute(class, '\s\+$', '', 'g') if class != "" @@ -696,15 +702,15 @@ function! s:process_tag_pre(line, pre) "{{{ else call add(lines, "
")
     endif
-    let pre = 1
+    let pre = [1, len(matchstr(a:line, '^\s*\ze{{{'))]
     let processed = 1
-  elseif pre && a:line =~ '^}}}\s*$'
-    let pre = 0
+  elseif pre[0] && a:line =~ '^\s*}}}\s*$'
+    let pre = [0, 0]
     call add(lines, "
") let processed = 1 - elseif pre + elseif pre[0] let processed = 1 - call add(lines, a:line) + call add(lines, substitute(a:line, '^\s\{'.pre[1].'}', '', '')) endif return [processed, lines, pre] endfunction "}}} @@ -713,7 +719,6 @@ function! s:process_tag_quote(line, quote) "{{{ let lines = [] let quote = a:quote let processed = 0 - " if a:line =~ '^\s\{4,}[^[:blank:]*#]' if a:line =~ '^\s\{4,}\S' if !quote call add(lines, "
") @@ -721,9 +726,6 @@ function! s:process_tag_quote(line, quote) "{{{ endif let processed = 1 call add(lines, substitute(a:line, '^\s*', '', '')) - elseif quote && a:line =~ '^\s*$' - let processed = 1 - call add(lines, a:line) elseif quote call add(lines, "
") let quote = 0 @@ -987,12 +989,14 @@ endfunction "}}} "}}} +" }}} + " WIKI2HTML "{{{ function! s:parse_line(line, state) " {{{ let state = {} let state.para = a:state.para let state.quote = a:state.quote - let state.pre = a:state.pre + let state.pre = a:state.pre[:] let state.table = a:state.table[:] let state.lists = a:state.lists[:] let state.deflist = a:state.deflist @@ -1014,6 +1018,15 @@ function! s:parse_line(line, state) " {{{ endif endif + " title -- placeholder + if !processed + if line =~ '^\s*%title' + let processed = 1 + let param = matchstr(line, '^\s*%title\s\zs.*') + let state.placeholder = ['title', param] + endif + endif + " toc -- placeholder "{{{ if !processed if line =~ '^\s*%toc' @@ -1027,9 +1040,10 @@ function! s:parse_line(line, state) " {{{ " pres "{{{ if !processed let [processed, lines, state.pre] = s:process_tag_pre(line, state.pre) - if processed && len(state.lists) - call s:close_tag_list(state.lists, lines) - endif + " pre is just fine to be in the list -- do not close list item here. + " if processed && len(state.lists) + " call s:close_tag_list(state.lists, lines) + " endif if processed && len(state.table) let state.table = s:close_tag_table(state.table, lines) endif @@ -1052,7 +1066,7 @@ function! s:parse_line(line, state) " {{{ if processed && state.quote let state.quote = s:close_tag_quote(state.quote, lines) endif - if processed && state.pre + if processed && state.pre[0] let state.pre = s:close_tag_pre(state.pre, lines) endif if processed && len(state.table) @@ -1109,7 +1123,7 @@ function! s:parse_line(line, state) " {{{ if processed && len(state.table) let state.table = s:close_tag_table(state.table, lines) endif - if processed && state.pre + if processed && state.pre[0] let state.pre = s:close_tag_pre(state.pre, lines) endif if processed && state.para @@ -1153,7 +1167,7 @@ function! s:parse_line(line, state) " {{{ if processed && state.quote let state.quote = s:close_tag_quote(state.quote, res_lines) endif - if processed && state.pre + if processed && state.pre[0] let state.pre = s:close_tag_pre(state.pre, res_lines) endif if processed && len(state.table) @@ -1186,7 +1200,7 @@ function! vimwiki_html#Wiki2HTML(path, wikifile) "{{{ let subdir = vimwiki#subdir(VimwikiGet('path'), wikifile) let lsource = s:remove_comments(readfile(wikifile)) - let ldest = s:get_html_header(wikifile, subdir, &fileencoding) + let ldest = [] let path = expand(a:path).subdir call vimwiki#mkdir(path) @@ -1201,7 +1215,7 @@ function! vimwiki_html#Wiki2HTML(path, wikifile) "{{{ let state = {} let state.para = 0 let state.quote = 0 - let state.pre = 0 + let state.pre = [0, 0] " [in_pre, indent_pre] let state.table = [] let state.deflist = 0 let state.lists = [] @@ -1236,8 +1250,7 @@ function! vimwiki_html#Wiki2HTML(path, wikifile) "{{{ if !nohtml let toc = s:get_html_toc(state.toc) - call s:process_placeholders(ldest, placeholders, 'toc', toc) - + call s:process_toc(ldest, placeholders, toc) call s:remove_blank_lines(ldest) "" process end of file @@ -1251,6 +1264,8 @@ function! vimwiki_html#Wiki2HTML(path, wikifile) "{{{ call s:close_tag_table(state.table, lines) call extend(ldest, lines) + let title = s:process_title(placeholders, fnamemodify(a:wikifile, ":t:r")) + call extend(ldest, s:get_html_header(title, subdir, &fileencoding), 0) call extend(ldest, s:get_html_footer()) "" make html file. @@ -1266,9 +1281,12 @@ function! vimwiki_html#WikiAll2HTML(path) "{{{ endif echomsg 'Saving vimwiki files...' + let save_eventignore = &eventignore + let &eventignore = "all" let cur_buf = bufname('%') bufdo call s:save_vimwiki_buffer() exe 'buffer '.cur_buf + let &eventignore = save_eventignore let path = expand(a:path) call vimwiki#mkdir(path) diff --git a/autoload/vimwiki_lst.vim b/autoload/vimwiki_lst.vim index 497bff3..fcdfe36 100644 --- a/autoload/vimwiki_lst.vim +++ b/autoload/vimwiki_lst.vim @@ -40,7 +40,6 @@ endfunction "}}} " Get regexp of the list item with checkbox. function! s:rx_cb_list_item() "{{{ - " return s:rx_list_item().'\s*\zs\[.\?\]' return s:rx_list_item().'\s*\zs\[.\?\]' endfunction "}}} @@ -182,9 +181,7 @@ function! s:get_sibling_items(lnum) "{{{ let lnum = a:lnum let ind = s:get_level(lnum) - while s:get_level(lnum) >= ind && - \ lnum != 0 - + while lnum != 0 && s:get_level(lnum) >= ind if s:get_level(lnum) == ind && s:is_cb_list_item(lnum) call add(result, lnum) endif @@ -192,9 +189,7 @@ function! s:get_sibling_items(lnum) "{{{ endwhile let lnum = s:prev_list_item(a:lnum) - while s:get_level(lnum) >= ind && - \ lnum != 0 - + while lnum != 0 && s:get_level(lnum) >= ind if s:get_level(lnum) == ind && s:is_cb_list_item(lnum) call add(result, lnum) endif @@ -227,7 +222,7 @@ function! s:create_cb_list_item(lnum) "{{{ let m = matchstr(line, s:rx_list_item()) if m != '' let li_content = substitute(strpart(line, len(m)), '^\s*', '', '') - let line = m.'[ ] '.li_content + let line = substitute(m, '\s*$', ' ', '').'[ ] '.li_content call setline(a:lnum, line) endif endfunction "}}} @@ -321,7 +316,7 @@ function! vimwiki_lst#ToggleListItem(line1, line2) "{{{ endfunction "}}} -function! vimwiki_lst#insertCR() "{{{ +function! vimwiki_lst#kbd_cr() "{{{ " This function is heavily relies on proper 'set comments' option. let cr = "\" if getline('.') =~ s:rx_cb_list_item() @@ -330,7 +325,7 @@ function! vimwiki_lst#insertCR() "{{{ return cr endfunction "}}} -function! vimwiki_lst#insertOo(cmd) "{{{ +function! vimwiki_lst#kbd_oO(cmd) "{{{ " cmd should be 'o' or 'O' let beg_lnum = foldclosed('.') @@ -343,11 +338,13 @@ function! vimwiki_lst#insertOo(cmd) "{{{ let lnum = line('.') endif + " let line = substitute(m, '\s*$', ' ', '').'[ ] '.li_content + let m = matchstr(line, s:rx_list_item()) let res = '' if line =~ s:rx_cb_list_item() - let res = matchstr(line, s:rx_list_item()).'[ ] ' + let res = substitute(m, '\s*$', ' ', '').'[ ] ' elseif line =~ s:rx_list_item() - let res = matchstr(line, s:rx_list_item()) + let res = substitute(m, '\s*$', ' ', '') elseif &autoindent || &smartindent let res = matchstr(line, '^\s*') endif diff --git a/autoload/vimwiki_tbl.vim b/autoload/vimwiki_tbl.vim index f61ce67..251c0ae 100644 --- a/autoload/vimwiki_tbl.vim +++ b/autoload/vimwiki_tbl.vim @@ -19,6 +19,12 @@ let s:textwidth = &tw " Misc functions {{{ function! s:wide_len(str) "{{{ + " vim73 has new function that gives correct string width. + if exists("*strdisplaywidth") + return strdisplaywidth(a:str) + endif + + " get str display width in vim ver < 7.2 if !g:vimwiki_CJK_length let ret = strlen(substitute(a:str, '.', 'x', 'g')) else diff --git a/colors/lucius.vim b/colors/lucius.vim index 410cc55..10a53fd 100644 --- a/colors/lucius.vim +++ b/colors/lucius.vim @@ -259,6 +259,9 @@ hi WarningMsg ctermfg=173 cterm=none " current match in the wildmenu completion hi WildMenu guifg=#cae682 guibg=#363946 gui=bold,underline hi WildMenu ctermfg=16 ctermbg=186 cterm=bold +" color column highlighting +hi ColorColumn guifg=NONE guibg=#403630 gui=none +hi ColorColumn ctermfg=NONE ctermbg=94 cterm=none " Diff @@ -274,7 +277,7 @@ hi DiffDelete guifg=#6c6661 guibg=#3c3631 gui=none hi DiffDelete ctermfg=fg ctermbg=58 cterm=none " changed text within line hi DiffText guifg=#f05060 guibg=#4a343a gui=bold -hi DiffText ctermfg=203 ctermbg=52 cterm=bold +hi DiffText ctermfg=203 ctermbg=52 cterm=bold " Folds @@ -347,3 +350,4 @@ hi Visual ctermfg=NONE ctermbg=24 " visual mode selection when vim is not owning the selection (x11 only) hi VisualNOS guifg=fg gui=underline hi VisualNOS ctermfg=fg cterm=underline + diff --git a/colors/wombat256grf.vim b/colors/wombat256grf.vim index ecda096..a742ed9 100644 --- a/colors/wombat256grf.vim +++ b/colors/wombat256grf.vim @@ -282,7 +282,7 @@ call X("WarningMsg", "ff0000", "", "") call X("Number", "e5786d", "", "none") call X("Constant", "e5786d", "", "none") call X("String", "95e454", "", s:italic) -call X("Comment", "c0bc6c", "", s:italic) +call X("Comment", "99968b", "", s:italic) call X("Identifier", "caeb82", "", "none") call X("Keyword", "87afff", "", "none") call X("Statement", "87afff", "", "none") diff --git a/doc/NERD_tree.txt b/doc/NERD_tree.txt deleted file mode 100644 index 2e2278c..0000000 --- a/doc/NERD_tree.txt +++ /dev/null @@ -1,1222 +0,0 @@ -*NERD_tree.txt* A tree explorer plugin that owns your momma! - - - - omg its ... ~ - - ________ ________ _ ____________ ____ __________ ____________~ - /_ __/ / / / ____/ / | / / ____/ __ \/ __ \ /_ __/ __ \/ ____/ ____/~ - / / / /_/ / __/ / |/ / __/ / /_/ / / / / / / / /_/ / __/ / __/ ~ - / / / __ / /___ / /| / /___/ _, _/ /_/ / / / / _, _/ /___/ /___ ~ - /_/ /_/ /_/_____/ /_/ |_/_____/_/ |_/_____/ /_/ /_/ |_/_____/_____/ ~ - - - Reference Manual~ - - - - -============================================================================== -CONTENTS *NERDTree-contents* - - 1.Intro...................................|NERDTree| - 2.Functionality provided..................|NERDTreeFunctionality| - 2.1.Global commands...................|NERDTreeGlobalCommands| - 2.2.Bookmarks.........................|NERDTreeBookmarks| - 2.2.1.The bookmark table..........|NERDTreeBookmarkTable| - 2.2.2.Bookmark commands...........|NERDTreeBookmarkCommands| - 2.2.3.Invalid bookmarks...........|NERDTreeInvalidBookmarks| - 2.3.NERD tree mappings................|NERDTreeMappings| - 2.4.The NERD tree menu................|NERDTreeMenu| - 3.Options.................................|NERDTreeOptions| - 3.1.Option summary....................|NERDTreeOptionSummary| - 3.2.Option details....................|NERDTreeOptionDetails| - 4.The NERD tree API.......................|NERDTreeAPI| - 4.1.Key map API.......................|NERDTreeKeymapAPI| - 4.2.Menu API..........................|NERDTreeMenuAPI| - 5.About...................................|NERDTreeAbout| - 6.Changelog...............................|NERDTreeChangelog| - 7.Credits.................................|NERDTreeCredits| - 8.License.................................|NERDTreeLicense| - -============================================================================== -1. Intro *NERDTree* - -What is this "NERD tree"?? - -The NERD tree allows you to explore your filesystem and to open files and -directories. It presents the filesystem to you in the form of a tree which you -manipulate with the keyboard and/or mouse. It also allows you to perform -simple filesystem operations. - -The following features and functionality are provided by the NERD tree: - * Files and directories are displayed in a hierarchical tree structure - * Different highlighting is provided for the following types of nodes: - * files - * directories - * sym-links - * windows .lnk files - * read-only files - * executable files - * Many (customisable) mappings are provided to manipulate the tree: - * Mappings to open/close/explore directory nodes - * Mappings to open files in new/existing windows/tabs - * Mappings to change the current root of the tree - * Mappings to navigate around the tree - * ... - * Directories and files can be bookmarked. - * Most NERD tree navigation can also be done with the mouse - * Filtering of tree content (can be toggled at runtime) - * custom file filters to prevent e.g. vim backup files being displayed - * optional displaying of hidden files (. files) - * files can be "turned off" so that only directories are displayed - * The position and size of the NERD tree window can be customised - * The order in which the nodes in the tree are listed can be customised. - * A model of your filesystem is created/maintained as you explore it. This - has several advantages: - * All filesystem information is cached and is only re-read on demand - * If you revisit a part of the tree that you left earlier in your - session, the directory nodes will be opened/closed as you left them - * The script remembers the cursor position and window position in the NERD - tree so you can toggle it off (or just close the tree window) and then - reopen it (with NERDTreeToggle) the NERD tree window will appear exactly - as you left it - * You can have a separate NERD tree for each tab, share trees across tabs, - or a mix of both. - * By default the script overrides the default file browser (netw), so if - you :edit a directory a (slighly modified) NERD tree will appear in the - current window - * A programmable menu system is provided (simulates right clicking on a - node) - * one default menu plugin is provided to perform basic filesytem - operations (create/delete/move/copy files/directories) - * There's an API for adding your own keymappings - - -============================================================================== -2. Functionality provided *NERDTreeFunctionality* - ------------------------------------------------------------------------------- -2.1. Global Commands *NERDTreeGlobalCommands* - -:NERDTree [ | ] *:NERDTree* - Opens a fresh NERD tree. The root of the tree depends on the argument - given. There are 3 cases: If no argument is given, the current directory - will be used. If a directory is given, that will be used. If a bookmark - name is given, the corresponding directory will be used. For example: > - :NERDTree /home/marty/vim7/src - :NERDTree foo (foo is the name of a bookmark) -< -:NERDTreeFromBookmark *:NERDTreeFromBookmark* - Opens a fresh NERD tree with the root initialized to the dir for - . This only reason to use this command over :NERDTree is for - the completion (which is for bookmarks rather than directories). - -:NERDTreeToggle [ | ] *:NERDTreeToggle* - If a NERD tree already exists for this tab, it is reopened and rendered - again. If no NERD tree exists for this tab then this command acts the - same as the |:NERDTree| command. - -:NERDTreeMirror *:NERDTreeMirror* - Shares an existing NERD tree, from another tab, in the current tab. - Changes made to one tree are reflected in both as they are actually the - same buffer. - - If only one other NERD tree exists, that tree is automatically mirrored. If - more than one exists, the script will ask which tree to mirror. - -:NERDTreeClose *:NERDTreeClose* - Close the NERD tree in this tab. - -:NERDTreeFind *:NERDTreeFind* - Find the current file in the tree. If no tree exists for the current tab, - or the file is not under the current root, then initialize a new tree where - the root is the directory of the current file. - ------------------------------------------------------------------------------- -2.2. Bookmarks *NERDTreeBookmarks* - -Bookmarks in the NERD tree are a way to tag files or directories of interest. -For example, you could use bookmarks to tag all of your project directories. - ------------------------------------------------------------------------------- -2.2.1. The Bookmark Table *NERDTreeBookmarkTable* - -If the bookmark table is active (see |NERDTree-B| and -|'NERDTreeShowBookmarks'|), it will be rendered above the tree. You can double -click bookmarks or use the |NERDTree-o| mapping to activate them. See also, -|NERDTree-t| and |NERDTree-T| - ------------------------------------------------------------------------------- -2.2.2. Bookmark commands *NERDTreeBookmarkCommands* - -Note that the following commands are only available in the NERD tree buffer. - -:Bookmark - Bookmark the current node as . If there is already a - bookmark, it is overwritten. must not contain spaces. - -:BookmarkToRoot - Make the directory corresponding to the new root. If a treenode - corresponding to is already cached somewhere in the tree then - the current tree will be used, otherwise a fresh tree will be opened. - Note that if points to a file then its parent will be used - instead. - -:RevealBookmark - If the node is cached under the current root then it will be revealed - (i.e. directory nodes above it will be opened) and the cursor will be - placed on it. - -:OpenBookmark - must point to a file. The file is opened as though |NERDTree-o| - was applied. If the node is cached under the current root then it will be - revealed and the cursor will be placed on it. - -:ClearBookmarks [] - Remove all the given bookmarks. If no bookmarks are given then remove all - bookmarks on the current node. - -:ClearAllBookmarks - Remove all bookmarks. - -:ReadBookmarks - Re-read the bookmarks in the |'NERDTreeBookmarksFile'|. - -See also |:NERDTree| and |:NERDTreeFromBookmark|. - ------------------------------------------------------------------------------- -2.2.3. Invalid Bookmarks *NERDTreeInvalidBookmarks* - -If invalid bookmarks are detected, the script will issue an error message and -the invalid bookmarks will become unavailable for use. - -These bookmarks will still be stored in the bookmarks file (see -|'NERDTreeBookmarksFile'|), down the bottom. There will always be a blank line -after the valid bookmarks but before the invalid ones. - -Each line in the bookmarks file represents one bookmark. The proper format is: - - -After you have corrected any invalid bookmarks, either restart vim, or go -:ReadBookmarks from the NERD tree window. - ------------------------------------------------------------------------------- -2.3. NERD tree Mappings *NERDTreeMappings* - -Default Description~ help-tag~ -Key~ - -o.......Open files, directories and bookmarks....................|NERDTree-o| -go......Open selected file, but leave cursor in the NERDTree.....|NERDTree-go| -t.......Open selected node/bookmark in a new tab.................|NERDTree-t| -T.......Same as 't' but keep the focus on the current tab........|NERDTree-T| -i.......Open selected file in a split window.....................|NERDTree-i| -gi......Same as i, but leave the cursor on the NERDTree..........|NERDTree-gi| -s.......Open selected file in a new vsplit.......................|NERDTree-s| -gs......Same as s, but leave the cursor on the NERDTree..........|NERDTree-gs| -O.......Recursively open the selected directory..................|NERDTree-O| -x.......Close the current nodes parent...........................|NERDTree-x| -X.......Recursively close all children of the current node.......|NERDTree-X| -e.......Edit the current dif.....................................|NERDTree-e| - -...............same as |NERDTree-o|. -double-click.......same as the |NERDTree-o| map. -middle-click.......same as |NERDTree-i| for files, same as - |NERDTree-e| for dirs. - -D.......Delete the current bookmark .............................|NERDTree-D| - -P.......Jump to the root node....................................|NERDTree-P| -p.......Jump to current nodes parent.............................|NERDTree-p| -K.......Jump up inside directories at the current tree depth.....|NERDTree-K| -J.......Jump down inside directories at the current tree depth...|NERDTree-J| -...Jump down to the next sibling of the current directory...|NERDTree-C-J| -...Jump up to the previous sibling of the current directory.|NERDTree-C-K| - -C.......Change the tree root to the selected dir.................|NERDTree-C| -u.......Move the tree root up one directory......................|NERDTree-u| -U.......Same as 'u' except the old root node is left open........|NERDTree-U| -r.......Recursively refresh the current directory................|NERDTree-r| -R.......Recursively refresh the current root.....................|NERDTree-R| -m.......Display the NERD tree menu...............................|NERDTree-m| -cd......Change the CWD to the dir of the selected node...........|NERDTree-cd| - -I.......Toggle whether hidden files displayed....................|NERDTree-I| -f.......Toggle whether the file filters are used.................|NERDTree-f| -F.......Toggle whether files are displayed.......................|NERDTree-F| -B.......Toggle whether the bookmark table is displayed...........|NERDTree-B| - -q.......Close the NERDTree window................................|NERDTree-q| -A.......Zoom (maximize/minimize) the NERDTree window.............|NERDTree-A| -?.......Toggle the display of the quick help.....................|NERDTree-?| - ------------------------------------------------------------------------------- - *NERDTree-o* -Default key: o -Map option: NERDTreeMapActivateNode -Applies to: files and directories. - -If a file node is selected, it is opened in the previous window. - -If a directory is selected it is opened or closed depending on its current -state. - -If a bookmark that links to a directory is selected then that directory -becomes the new root. - -If a bookmark that links to a file is selected then that file is opened in the -previous window. - ------------------------------------------------------------------------------- - *NERDTree-go* -Default key: go -Map option: None -Applies to: files. - -If a file node is selected, it is opened in the previous window, but the -cursor does not move. - -The key combo for this mapping is always "g" + NERDTreeMapActivateNode (see -|NERDTree-o|). - ------------------------------------------------------------------------------- - *NERDTree-t* -Default key: t -Map option: NERDTreeMapOpenInTab -Applies to: files and directories. - -Opens the selected file in a new tab. If a directory is selected, a fresh -NERD Tree for that directory is opened in a new tab. - -If a bookmark which points to a directory is selected, open a NERD tree for -that directory in a new tab. If the bookmark points to a file, open that file -in a new tab. - ------------------------------------------------------------------------------- - *NERDTree-T* -Default key: T -Map option: NERDTreeMapOpenInTabSilent -Applies to: files and directories. - -The same as |NERDTree-t| except that the focus is kept in the current tab. - ------------------------------------------------------------------------------- - *NERDTree-i* -Default key: i -Map option: NERDTreeMapOpenSplit -Applies to: files. - -Opens the selected file in a new split window and puts the cursor in the new -window. - ------------------------------------------------------------------------------- - *NERDTree-gi* -Default key: gi -Map option: None -Applies to: files. - -The same as |NERDTree-i| except that the cursor is not moved. - -The key combo for this mapping is always "g" + NERDTreeMapOpenSplit (see -|NERDTree-i|). - ------------------------------------------------------------------------------- - *NERDTree-s* -Default key: s -Map option: NERDTreeMapOpenVSplit -Applies to: files. - -Opens the selected file in a new vertically split window and puts the cursor in -the new window. - ------------------------------------------------------------------------------- - *NERDTree-gs* -Default key: gs -Map option: None -Applies to: files. - -The same as |NERDTree-s| except that the cursor is not moved. - -The key combo for this mapping is always "g" + NERDTreeMapOpenVSplit (see -|NERDTree-s|). - ------------------------------------------------------------------------------- - *NERDTree-O* -Default key: O -Map option: NERDTreeMapOpenRecursively -Applies to: directories. - -Recursively opens the selelected directory. - -All files and directories are cached, but if a directory would not be -displayed due to file filters (see |'NERDTreeIgnore'| |NERDTree-f|) or the -hidden file filter (see |'NERDTreeShowHidden'|) then its contents are not -cached. This is handy, especially if you have .svn directories. - ------------------------------------------------------------------------------- - *NERDTree-x* -Default key: x -Map option: NERDTreeMapCloseDir -Applies to: files and directories. - -Closes the parent of the selected node. - ------------------------------------------------------------------------------- - *NERDTree-X* -Default key: X -Map option: NERDTreeMapCloseChildren -Applies to: directories. - -Recursively closes all children of the selected directory. - -Tip: To quickly "reset" the tree, use |NERDTree-P| with this mapping. - ------------------------------------------------------------------------------- - *NERDTree-e* -Default key: e -Map option: NERDTreeMapOpenExpl -Applies to: files and directories. - -|:edit|s the selected directory, or the selected file's directory. This could -result in a NERD tree or a netrw being opened, depending on -|'NERDTreeHijackNetrw'|. - ------------------------------------------------------------------------------- - *NERDTree-D* -Default key: D -Map option: NERDTreeMapDeleteBookmark -Applies to: lines in the bookmarks table - -Deletes the currently selected bookmark. - ------------------------------------------------------------------------------- - *NERDTree-P* -Default key: P -Map option: NERDTreeMapJumpRoot -Applies to: no restrictions. - -Jump to the tree root. - ------------------------------------------------------------------------------- - *NERDTree-p* -Default key: p -Map option: NERDTreeMapJumpParent -Applies to: files and directories. - -Jump to the parent node of the selected node. - ------------------------------------------------------------------------------- - *NERDTree-K* -Default key: K -Map option: NERDTreeMapJumpFirstChild -Applies to: files and directories. - -Jump to the first child of the current nodes parent. - -If the cursor is already on the first node then do the following: - * loop back thru the siblings of the current nodes parent until we find an - open dir with children - * go to the first child of that node - ------------------------------------------------------------------------------- - *NERDTree-J* -Default key: J -Map option: NERDTreeMapJumpLastChild -Applies to: files and directories. - -Jump to the last child of the current nodes parent. - -If the cursor is already on the last node then do the following: - * loop forward thru the siblings of the current nodes parent until we find - an open dir with children - * go to the last child of that node - ------------------------------------------------------------------------------- - *NERDTree-C-J* -Default key: -Map option: NERDTreeMapJumpNextSibling -Applies to: files and directories. - -Jump to the next sibling of the selected node. - ------------------------------------------------------------------------------- - *NERDTree-C-K* -Default key: -Map option: NERDTreeMapJumpPrevSibling -Applies to: files and directories. - -Jump to the previous sibling of the selected node. - ------------------------------------------------------------------------------- - *NERDTree-C* -Default key: C -Map option: NERDTreeMapChdir -Applies to: directories. - -Make the selected directory node the new tree root. If a file is selected, its -parent is used. - ------------------------------------------------------------------------------- - *NERDTree-u* -Default key: u -Map option: NERDTreeMapUpdir -Applies to: no restrictions. - -Move the tree root up a dir (like doing a "cd .."). - ------------------------------------------------------------------------------- - *NERDTree-U* -Default key: U -Map option: NERDTreeMapUpdirKeepOpen -Applies to: no restrictions. - -Like |NERDTree-u| except that the old tree root is kept open. - ------------------------------------------------------------------------------- - *NERDTree-r* -Default key: r -Map option: NERDTreeMapRefresh -Applies to: files and directories. - -If a dir is selected, recursively refresh that dir, i.e. scan the filesystem -for changes and represent them in the tree. - -If a file node is selected then the above is done on it's parent. - ------------------------------------------------------------------------------- - *NERDTree-R* -Default key: R -Map option: NERDTreeMapRefreshRoot -Applies to: no restrictions. - -Recursively refresh the tree root. - ------------------------------------------------------------------------------- - *NERDTree-m* -Default key: m -Map option: NERDTreeMapMenu -Applies to: files and directories. - -Display the NERD tree menu. See |NERDTreeMenu| for details. - ------------------------------------------------------------------------------- - *NERDTree-cd* -Default key: cd -Map option: NERDTreeMapChdir -Applies to: files and directories. - -Change vims current working directory to that of the selected node. - ------------------------------------------------------------------------------- - *NERDTree-I* -Default key: I -Map option: NERDTreeMapToggleHidden -Applies to: no restrictions. - -Toggles whether hidden files (i.e. "dot files") are displayed. - ------------------------------------------------------------------------------- - *NERDTree-f* -Default key: f -Map option: NERDTreeMapToggleFilters -Applies to: no restrictions. - -Toggles whether file filters are used. See |'NERDTreeIgnore'| for details. - ------------------------------------------------------------------------------- - *NERDTree-F* -Default key: F -Map option: NERDTreeMapToggleFiles -Applies to: no restrictions. - -Toggles whether file nodes are displayed. - ------------------------------------------------------------------------------- - *NERDTree-B* -Default key: B -Map option: NERDTreeMapToggleBookmarks -Applies to: no restrictions. - -Toggles whether the bookmarks table is displayed. - ------------------------------------------------------------------------------- - *NERDTree-q* -Default key: q -Map option: NERDTreeMapQuit -Applies to: no restrictions. - -Closes the NERDtree window. - ------------------------------------------------------------------------------- - *NERDTree-A* -Default key: A -Map option: NERDTreeMapToggleZoom -Applies to: no restrictions. - -Maximize (zoom) and minimize the NERDtree window. - ------------------------------------------------------------------------------- - *NERDTree-?* -Default key: ? -Map option: NERDTreeMapHelp -Applies to: no restrictions. - -Toggles whether the quickhelp is displayed. - ------------------------------------------------------------------------------- -2.3. The NERD tree menu *NERDTreeMenu* - -The NERD tree has a menu that can be programmed via the an API (see -|NERDTreeMenuAPI|). The idea is to simulate the "right click" menus that most -file explorers have. - -The script comes with two default menu plugins: exec_menuitem.vim and -fs_menu.vim. fs_menu.vim adds some basic filesystem operations to the menu for -creating/deleting/moving/copying files and dirs. exec_menuitem.vim provides a -menu item to execute executable files. - -Related tags: |NERDTree-m| |NERDTreeApi| - -============================================================================== -3. Customisation *NERDTreeOptions* - - ------------------------------------------------------------------------------- -3.1. Customisation summary *NERDTreeOptionSummary* - -The script provides the following options that can customise the behaviour the -NERD tree. These options should be set in your vimrc. - -|'loaded_nerd_tree'| Turns off the script. - -|'NERDChristmasTree'| Tells the NERD tree to make itself colourful - and pretty. - -|'NERDTreeAutoCenter'| Controls whether the NERD tree window centers - when the cursor moves within a specified - distance to the top/bottom of the window. -|'NERDTreeAutoCenterThreshold'| Controls the sensitivity of autocentering. - -|'NERDTreeCaseSensitiveSort'| Tells the NERD tree whether to be case - sensitive or not when sorting nodes. - -|'NERDTreeChDirMode'| Tells the NERD tree if/when it should change - vim's current working directory. - -|'NERDTreeHighlightCursorline'| Tell the NERD tree whether to highlight the - current cursor line. - -|'NERDTreeHijackNetrw'| Tell the NERD tree whether to replace the netrw - autocommands for exploring local directories. - -|'NERDTreeIgnore'| Tells the NERD tree which files to ignore. - -|'NERDTreeBookmarksFile'| Where the bookmarks are stored. - -|'NERDTreeMouseMode'| Tells the NERD tree how to handle mouse - clicks. - -|'NERDTreeQuitOnOpen'| Closes the tree window after opening a file. - -|'NERDTreeShowBookmarks'| Tells the NERD tree whether to display the - bookmarks table on startup. - -|'NERDTreeShowFiles'| Tells the NERD tree whether to display files - in the tree on startup. - -|'NERDTreeShowHidden'| Tells the NERD tree whether to display hidden - files on startup. - -|'NERDTreeShowLineNumbers'| Tells the NERD tree whether to display line - numbers in the tree window. - -|'NERDTreeSortOrder'| Tell the NERD tree how to sort the nodes in - the tree. - -|'NERDTreeStatusline'| Set a statusline for NERD tree windows. - -|'NERDTreeWinPos'| Tells the script where to put the NERD tree - window. - -|'NERDTreeWinSize'| Sets the window size when the NERD tree is - opened. - ------------------------------------------------------------------------------- -3.2. Customisation details *NERDTreeOptionDetails* - -To enable any of the below options you should put the given line in your -~/.vimrc - - *'loaded_nerd_tree'* -If this plugin is making you feel homicidal, it may be a good idea to turn it -off with this line in your vimrc: > - let loaded_nerd_tree=1 -< ------------------------------------------------------------------------------- - *'NERDChristmasTree'* -Values: 0 or 1. -Default: 1. - -If this option is set to 1 then some extra syntax highlighting elements are -added to the nerd tree to make it more colourful. - -Set it to 0 for a more vanilla looking tree. - ------------------------------------------------------------------------------- - *'NERDTreeAutoCenter'* -Values: 0 or 1. -Default: 1 - -If set to 1, the NERD tree window will center around the cursor if it moves to -within |'NERDTreeAutoCenterThreshold'| lines of the top/bottom of the window. - -This is ONLY done in response to tree navigation mappings, -i.e. |NERDTree-J| |NERDTree-K| |NERDTree-C-J| |NERDTree-C-K| |NERDTree-p| -|NERDTree-P| - -The centering is done with a |zz| operation. - ------------------------------------------------------------------------------- - *'NERDTreeAutoCenterThreshold'* -Values: Any natural number. -Default: 3 - -This option controls the "sensitivity" of the NERD tree auto centering. See -|'NERDTreeAutoCenter'| for details. - ------------------------------------------------------------------------------- - *'NERDTreeCaseSensitiveSort'* -Values: 0 or 1. -Default: 0. - -By default the NERD tree does not sort nodes case sensitively, i.e. nodes -could appear like this: > - bar.c - Baz.c - blarg.c - boner.c - Foo.c -< -But, if you set this option to 1 then the case of the nodes will be taken into -account. The above nodes would then be sorted like this: > - Baz.c - Foo.c - bar.c - blarg.c - boner.c -< ------------------------------------------------------------------------------- - *'NERDTreeChDirMode'* - -Values: 0, 1 or 2. -Default: 0. - -Use this option to tell the script when (if at all) to change the current -working directory (CWD) for vim. - -If it is set to 0 then the CWD is never changed by the NERD tree. - -If set to 1 then the CWD is changed when the NERD tree is first loaded to the -directory it is initialized in. For example, if you start the NERD tree with > - :NERDTree /home/marty/foobar -< -then the CWD will be changed to /home/marty/foobar and will not be changed -again unless you init another NERD tree with a similar command. - -If the option is set to 2 then it behaves the same as if set to 1 except that -the CWD is changed whenever the tree root is changed. For example, if the CWD -is /home/marty/foobar and you make the node for /home/marty/foobar/baz the new -root then the CWD will become /home/marty/foobar/baz. - ------------------------------------------------------------------------------- - *'NERDTreeHighlightCursorline'* -Values: 0 or 1. -Default: 1. - -If set to 1, the current cursor line in the NERD tree buffer will be -highlighted. This is done using the |'cursorline'| option. - ------------------------------------------------------------------------------- - *'NERDTreeHijackNetrw'* -Values: 0 or 1. -Default: 1. - -If set to 1, doing a > - :edit -< -will open up a "secondary" NERD tree instead of a netrw in the target window. - -Secondary NERD trees behaves slighly different from a regular trees in the -following respects: - 1. 'o' will open the selected file in the same window as the tree, - replacing it. - 2. you can have as many secondary tree as you want in the same tab. - ------------------------------------------------------------------------------- - *'NERDTreeIgnore'* -Values: a list of regular expressions. -Default: ['\~$']. - -This option is used to specify which files the NERD tree should ignore. It -must be a list of regular expressions. When the NERD tree is rendered, any -files/dirs that match any of the regex's in 'NERDTreeIgnore' wont be -displayed. - -For example if you put the following line in your vimrc: > - let NERDTreeIgnore=['\.vim$', '\~$'] -< -then all files ending in .vim or ~ will be ignored. - -Note: to tell the NERD tree not to ignore any files you must use the following -line: > - let NERDTreeIgnore=[] -< - -The file filters can be turned on and off dynamically with the |NERDTree-f| -mapping. - ------------------------------------------------------------------------------- - *'NERDTreeBookmarksFile'* -Values: a path -Default: $HOME/.NERDTreeBookmarks - -This is where bookmarks are saved. See |NERDTreeBookmarkCommands|. - ------------------------------------------------------------------------------- - *'NERDTreeMouseMode'* -Values: 1, 2 or 3. -Default: 1. - -If set to 1 then a double click on a node is required to open it. -If set to 2 then a single click will open directory nodes, while a double -click will still be required for file nodes. -If set to 3 then a single click will open any node. - -Note: a double click anywhere on a line that a tree node is on will -activate it, but all single-click activations must be done on name of the node -itself. For example, if you have the following node: > - | | |-application.rb -< -then (to single click activate it) you must click somewhere in -'application.rb'. - ------------------------------------------------------------------------------- - *'NERDTreeQuitOnOpen'* - -Values: 0 or 1. -Default: 0 - -If set to 1, the NERD tree window will close after opening a file with the -|NERDTree-o|, |NERDTree-i|, |NERDTree-t| and |NERDTree-T| mappings. - ------------------------------------------------------------------------------- - *'NERDTreeShowBookmarks'* -Values: 0 or 1. -Default: 0. - -If this option is set to 1 then the bookmarks table will be displayed. - -This option can be toggled dynamically, per tree, with the |NERDTree-B| -mapping. - ------------------------------------------------------------------------------- - *'NERDTreeShowFiles'* -Values: 0 or 1. -Default: 1. - -If this option is set to 1 then files are displayed in the NERD tree. If it is -set to 0 then only directories are displayed. - -This option can be toggled dynamically, per tree, with the |NERDTree-F| -mapping and is useful for drastically shrinking the tree when you are -navigating to a different part of the tree. - ------------------------------------------------------------------------------- - *'NERDTreeShowHidden'* -Values: 0 or 1. -Default: 0. - -This option tells vim whether to display hidden files by default. This option -can be dynamically toggled, per tree, with the |NERDTree-I| mapping. Use one -of the follow lines to set this option: > - let NERDTreeShowHidden=0 - let NERDTreeShowHidden=1 -< - ------------------------------------------------------------------------------- - *'NERDTreeShowLineNumbers'* -Values: 0 or 1. -Default: 0. - -This option tells vim whether to display line numbers for the NERD tree -window. Use one of the follow lines to set this option: > - let NERDTreeShowLineNumbers=0 - let NERDTreeShowLineNumbers=1 -< - ------------------------------------------------------------------------------- - *'NERDTreeSortOrder'* -Values: a list of regular expressions. -Default: ['\/$', '*', '\.swp$', '\.bak$', '\~$'] - -This option is set to a list of regular expressions which are used to -specify the order of nodes under their parent. - -For example, if the option is set to: > - ['\.vim$', '\.c$', '\.h$', '*', 'foobar'] -< -then all .vim files will be placed at the top, followed by all .c files then -all .h files. All files containing the string 'foobar' will be placed at the -end. The star is a special flag: it tells the script that every node that -doesnt match any of the other regexps should be placed here. - -If no star is present in 'NERDTreeSortOrder' then one is automatically -appended to the array. - -The regex '\/$' should be used to match directory nodes. - -After this sorting is done, the files in each group are sorted alphabetically. - -Other examples: > - (1) ['*', '\/$'] - (2) [] - (3) ['\/$', '\.rb$', '\.php$', '*', '\.swp$', '\.bak$', '\~$'] -< -1. Directories will appear last, everything else will appear above. -2. Everything will simply appear in alphabetical order. -3. Dirs will appear first, then ruby and php. Swap files, bak files and vim - backup files will appear last with everything else preceding them. - ------------------------------------------------------------------------------- - *'NERDTreeStatusline'* -Values: Any valid statusline setting. -Default: %{b:NERDTreeRoot.path.strForOS(0)} - -Tells the script what to use as the |'statusline'| setting for NERD tree -windows. - -Note that the statusline is set using |:let-&| not |:set| so escaping spaces -isn't necessary. - -Setting this option to -1 will will deactivate it so that your global -statusline setting is used instead. - ------------------------------------------------------------------------------- - *'NERDTreeWinPos'* -Values: "left" or "right" -Default: "left". - -This option is used to determine where NERD tree window is placed on the -screen. - -This option makes it possible to use two different explorer plugins -simultaneously. For example, you could have the taglist plugin on the left of -the window and the NERD tree on the right. - ------------------------------------------------------------------------------- - *'NERDTreeWinSize'* -Values: a positive integer. -Default: 31. - -This option is used to change the size of the NERD tree when it is loaded. - -============================================================================== -4. The NERD tree API *NERDTreeAPI* - -The NERD tree script allows you to add custom key mappings and menu items via -a set of API calls. Any scripts that use this API should be placed in -~/.vim/nerdtree_plugin/ (*nix) or ~/vimfiles/nerdtree_plugin (windows). - -The script exposes some prototype objects that can be used to manipulate the -tree and/or get information from it: > - g:NERDTreePath - g:NERDTreeDirNode - g:NERDTreeFileNode - g:NERDTreeBookmark -< -See the code/comments in NERD_tree.vim to find how to use these objects. The -following code conventions are used: - * class members start with a capital letter - * instance members start with a lower case letter - * private members start with an underscore - -See this blog post for more details: - http://got-ravings.blogspot.com/2008/09/vim-pr0n-prototype-based-objects.html - ------------------------------------------------------------------------------- -4.1. Key map API *NERDTreeKeymapAPI* - -NERDTreeAddKeyMap({options}) *NERDTreeAddKeyMap()* - Adds a new keymapping for all NERD tree buffers. - {options} must be a dictionary, and must contain the following keys: - "key" - the trigger key for the new mapping - "callback" - the function the new mapping will be bound to - "quickhelpText" - the text that will appear in the quickhelp (see - |NERDTree-?|) - - Example: > - call NERDTreeAddKeyMap({ - \ 'key': 'b', - \ 'callback': 'NERDTreeEchoCurrentNode', - \ 'quickhelpText': 'echo full path of current node' }) - - function! NERDTreeEchoCurrentNode() - let n = g:NERDTreeFileNode.GetSelected() - if n != {} - echomsg 'Current node: ' . n.path.str() - endif - endfunction -< - This code should sit in a file like ~/.vim/nerdtree_plugin/mymapping.vim. - It adds a (rather useless) mapping on 'b' which echos the full path to the - current node. - ------------------------------------------------------------------------------- -4.2. Menu API *NERDTreeMenuAPI* - -NERDTreeAddSubmenu({options}) *NERDTreeAddSubmenu()* - Creates and returns a new submenu. - - {options} must be a dictionary and must contain the following keys: - "text" - the text of the submenu that the user will see - "shortcut" - a shortcut key for the submenu (need not be unique) - - The following keys are optional: - "isActiveCallback" - a function that will be called to determine whether - this submenu item will be displayed or not. The callback function must return - 0 or 1. - "parent" - the parent submenu of the new submenu (returned from a previous - invocation of NERDTreeAddSubmenu()). If this key is left out then the new - submenu will sit under the top level menu. - - See below for an example. - -NERDTreeAddMenuItem({options}) *NERDTreeAddMenuItem()* - Adds a new menu item to the NERD tree menu (see |NERDTreeMenu|). - - {options} must be a dictionary and must contain the - following keys: - "text" - the text of the menu item which the user will see - "shortcut" - a shortcut key for the menu item (need not be unique) - "callback" - the function that will be called when the user activates the - menu item. - - The following keys are optional: - "isActiveCallback" - a function that will be called to determine whether - this menu item will be displayed or not. The callback function must return - 0 or 1. - "parent" - if the menu item belongs under a submenu then this key must be - specified. This value for this key will be the object that - was returned when the submenu was created with |NERDTreeAddSubmenu()|. - - See below for an example. - -NERDTreeAddMenuSeparator([{options}]) *NERDTreeAddMenuSeparator()* - Adds a menu separator (a row of dashes). - - {options} is an optional dictionary that may contain the following keys: - "isActiveCallback" - see description in |NERDTreeAddMenuItem()|. - -Below is an example of the menu API in action. > - call NERDTreeAddMenuSeparator() - - call NERDTreeAddMenuItem({ - \ 'text': 'a (t)op level menu item', - \ 'shortcut': 't', - \ 'callback': 'SomeFunction' }) - - let submenu = NERDTreeAddSubmenu({ - \ 'text': 'a (s)ub menu', - \ 'shortcut': 's' }) - - call NERDTreeAddMenuItem({ - \ 'text': '(n)ested item 1', - \ 'shortcut': 'n', - \ 'callback': 'SomeFunction', - \ 'parent': submenu }) - - call NERDTreeAddMenuItem({ - \ 'text': '(n)ested item 2', - \ 'shortcut': 'n', - \ 'callback': 'SomeFunction', - \ 'parent': submenu }) -< -This will create the following menu: > - -------------------- - a (t)op level menu item - a (s)ub menu -< -Where selecting "a (s)ub menu" will lead to a second menu: > - (n)ested item 1 - (n)ested item 2 -< -When any of the 3 concrete menu items are selected the function "SomeFunction" -will be called. - ------------------------------------------------------------------------------- -NERDTreeRender() *NERDTreeRender()* - Re-renders the NERD tree buffer. Useful if you change the state of the - tree and you want to it to be reflected in the UI. - -============================================================================== -5. About *NERDTreeAbout* - -The author of the NERD tree is a terrible terrible monster called Martyzilla -who gobbles up small children with milk and sugar for breakfast. - -He can be reached at martin.grenfell at gmail dot com. He would love to hear -from you, so feel free to send him suggestions and/or comments about this -plugin. Don't be shy --- the worst he can do is slaughter you and stuff you in -the fridge for later ;) - -The latest stable versions can be found at - http://www.vim.org/scripts/script.php?script_id=1658 - -The latest dev versions are on github - http://github.com/scrooloose/nerdtree - - -============================================================================== -6. Changelog *NERDTreeChangelog* - -4.1.0 - features: - - NERDTreeFind to reveal the node for the current buffer in the tree, - see |NERDTreeFind|. This effectively merges the FindInNERDTree plugin (by - Doug McInnes) into the script. - - make NERDTreeQuitOnOpen apply to the t/T keymaps too. Thanks to Stefan - Ritter and Rémi Prévost. - - truncate the root node if wider than the tree window. Thanks to Victor - Gonzalez. - - bugfixes: - - really fix window state restoring - - fix some win32 path escaping issues. Thanks to Stephan Baumeister, Ricky, - jfilip1024, and Chris Chambers - -4.0.0 - - add a new programmable menu system (see :help NERDTreeMenu). - - add new APIs to add menus/menu-items to the menu system as well as - custom key mappings to the NERD tree buffer (see :help NERDTreeAPI). - - removed the old API functions - - added a mapping to maximize/restore the size of nerd tree window, thanks - to Guillaume Duranceau for the patch. See :help NERDTree-A for details. - - - fix a bug where secondary nerd trees (netrw hijacked trees) and - NERDTreeQuitOnOpen didnt play nicely, thanks to Curtis Harvey. - - fix a bug where the script ignored directories whose name ended in a dot, - thanks to Aggelos Orfanakos for the patch. - - fix a bug when using the x mapping on the tree root, thanks to Bryan - Venteicher for the patch. - - fix a bug where the cursor position/window size of the nerd tree buffer - wasnt being stored on closing the window, thanks to Richard Hart. - - fix a bug where NERDTreeMirror would mirror the wrong tree - -3.1.1 - - fix a bug where a non-listed no-name buffer was getting created every - time the tree windows was created, thanks to Derek Wyatt and owen1 - - make behave the same as the 'o' mapping - - some helptag fixes in the doc, thanks strull - - fix a bug when using :set nohidden and opening a file where the previous - buf was modified. Thanks iElectric - - other minor fixes - -3.1.0 - New features: - - add mappings to open files in a vsplit, see :help NERDTree-s and :help - NERDTree-gs - - make the statusline for the nerd tree window default to something - hopefully more useful. See :help 'NERDTreeStatusline' - Bugfixes: - - make the hijack netrw functionality work when vim is started with "vim - " (thanks to Alf Mikula for the patch). - - fix a bug where the CWD wasnt being changed for some operations even when - NERDTreeChDirMode==2 (thanks to Lucas S. Buchala) - - add -bar to all the nerd tree :commands so they can chain with other - :commands (thanks to tpope) - - fix bugs when ignorecase was set (thanks to nach) - - fix a bug with the relative path code (thanks to nach) - - fix a bug where doing a :cd would cause :NERDTreeToggle to fail (thanks nach) - - -3.0.1 - Bugfixes: - - fix bugs with :NERDTreeToggle and :NERDTreeMirror when 'hidden - was not set - - fix a bug where :NERDTree would fail if was relative and - didnt start with a ./ or ../ Thanks to James Kanze. - - make the q mapping work with secondary (:e style) trees, - thanks to jamessan - - fix a bunch of small bugs with secondary trees - - More insane refactoring. - -3.0.0 - - hijack netrw so that doing an :edit will put a NERD tree in - the window rather than a netrw browser. See :help 'NERDTreeHijackNetrw' - - allow sharing of trees across tabs, see :help :NERDTreeMirror - - remove "top" and "bottom" as valid settings for NERDTreeWinPos - - change the '' mapping to 'i' - - change the 'H' mapping to 'I' - - lots of refactoring - -============================================================================== -7. Credits *NERDTreeCredits* - -Thanks to the following people for testing, bug reports, ideas etc. Without -you I probably would have got bored of the hacking the NERD tree and -just downloaded pr0n instead. - - Tim Carey-Smith (halorgium) - Vigil - Nick Brettell - Thomas Scott Urban - Terrance Cohen - Yegappan Lakshmanan - Jason Mills - Michael Geddes (frogonwheels) - Yu Jun - Michael Madsen - AOYAMA Shotaro - Zhang Weiwu - Niels Aan de Brugh - Olivier Yiptong - Zhang Shuhan - Cory Echols - Piotr Czachur - Yuan Jiang - Matan Nassau - Maxim Kim - Charlton Wang - Matt Wozniski (godlygeek) - knekk - Sean Chou - Ryan Penn - Simon Peter Nicholls - Michael Foobar - Tomasz Chomiuk - Denis Pokataev - Tim Pope (tpope) - James Kanze - James Vega (jamessan) - Frederic Chanal (nach) - Alf Mikula - Lucas S. Buchala - Curtis Harvey - Guillaume Duranceau - Richard Hart (hates) - Doug McInnes - Stefan Ritter - Rémi Prévost - Victor Gonzalez - Stephan Baumeister - Ricky - jfilip1024 - Chris Chambers - -============================================================================== -8. License *NERDTreeLicense* - -The NERD tree is released under the wtfpl. -See http://sam.zoy.org/wtfpl/COPYING. diff --git a/doc/mark.txt b/doc/mark.txt index 33656bd..86d6ba4 100644 --- a/doc/mark.txt +++ b/doc/mark.txt @@ -44,7 +44,7 @@ RELATED WORKS * ============================================================================== USAGE *mark-usage* -Highlighting: +HIGHLIGHTING *mark-highlighting* m Mark or unmark the word under the cursor, similar to the |star| command. @@ -61,7 +61,8 @@ Highlighting: 'smartcase' setting, only 'ignorecase'. :Mark Clear all marks. -Searching: + +SEARCHING *mark-searching* [count]* [count]# [count]* [count]# @@ -91,6 +92,9 @@ Searching: mark (like the built-in search), but to the previous mark. The entire mark text is treated as one entity. + You can use Vim's |jumplist| to go back to previous + mark matches and the position before a mark search. + ============================================================================== INSTALLATION *mark-installation* @@ -149,11 +153,24 @@ Taken from an alternative implementation at http://vim.wikia.com/wiki/Highlight_multiple_words: - Allow to specify the highlight group number via :Mark [n] {regexp} - Use keys 1-9 on the numeric keypad to toggle a highlight group number. -- Persist the patterns in a uppercase global variable across Vim sessions. +- Persist the patterns in a uppercase global variable across Vim sessions. + (Request from Mun Johl, 16-Apr-2010.) + Can be somewhat emulated by placing something like this in |vimrc|: > + runtime plugin/mark.vim + Mark foo + Mark bar +< or defining a custom command a la: > + command -bar MyMarks execute "Mark foo" | execute "Mark bar" ============================================================================== HISTORY *mark-history* +2.4.0 13-Jul-2010 +- ENH: The MarkSearch mappings ([*#/?]) add the original cursor + position to the jump list, like the built-in [/?*#nN] commands. This allows + to use the regular jump commands for mark matches, like with regular search + matches. + 2.3.3 19-Feb-2010 - BUG: Clearing of an accidental zero-width match (e.g. via :Mark \zs) results in endless loop. Thanks to Andy Wokula for the patch. diff --git a/doc/pi_getscript.txt b/doc/pi_getscript.txt deleted file mode 100644 index 2833980..0000000 --- a/doc/pi_getscript.txt +++ /dev/null @@ -1,414 +0,0 @@ -*pi_getscript.txt* For Vim version 7.0. Last change: 2008 Jan 07 -> - GETSCRIPT REFERENCE MANUAL by Charles E. Campbell, Jr. -< -Authors: Charles E. Campbell, Jr. - (remove NOSPAM from the email address) - *GetLatestVimScripts-copyright* -Copyright: (c) 2004-2006 by Charles E. Campbell, Jr. *glvs-copyright* - The VIM LICENSE applies to getscript.vim and - pi_getscript.txt (see |copyright|) except use - "getscript" instead of "Vim". No warranty, express or implied. - Use At-Your-Own-Risk. - -Getscript is a plugin that simplifies retrieval of the latest versions of the -scripts that you yourself use! Typing |:GLVS| will invoke getscript; it will -then use the (see |GetLatestVimScripts_dat|) file to -get the latest versions of scripts listed therein from http://vim.sf.net/. - -============================================================================== -1. Contents *glvs-contents* *glvs* *getscript* - *GetLatestVimScripts* - - 1. Contents........................................: |glvs-contents| - 2. GetLatestVimScripts -- Getting Started..........: |glvs-install| - 3. GetLatestVimScripts Usage.......................: |glvs-usage| - 4. GetLatestVimScripts Data File...................: |glvs-data| - 5. GetLatestVimScripts Friendly Plugins............: |glvs-plugins| - 6. GetLatestVimScripts AutoInstall.................: |glvs-autoinstall| - 7. GetLatestViMScripts Options.....................: |glvs-options| - 8. GetLatestVimScripts Algorithm...................: |glvs-alg| - 9. GetLatestVimScripts History.....................: |glvs-hist| - - -============================================================================== -2. GetLatestVimScripts -- Getting Started *getscript-start* - *getlatestvimscripts-install* - - VERSION FROM VIM DISTRIBUTION *glvs-dist-install* - -Vim 7.0 does not include the GetLatestVimScripts.dist file which -serves as an example and a template. So, you'll need to create -your own! See |GetLatestVimScripts_dat|. - - VERSION FROM VIM SF NET *glvs-install* - -NOTE: The last step, that of renaming/moving the GetLatestVimScripts.dist -file, is for those who have just downloaded GetLatestVimScripts.tar.bz2 for -the first time. - -The GetLatestVimScripts.dist file serves as an example and a template for your -own personal list. Feel free to remove all the scripts mentioned within it; -the "important" part of it is the first two lines. - -Your computer needs to have wget for GetLatestVimScripts to do its work. - - 1. if compressed: gunzip getscript.vba.gz - 2. Unix: - vim getscript.vba - :so % - :q - cd ~/.vim/GetLatest - mv GetLatestVimScripts.dist GetLatestVimScripts.dat - (edit GetLatestVimScripts.dat to install your own personal - list of desired plugins -- see |GetLatestVimScripts_dat|) - - 3. Windows: - vim getscript.vba - :so % - :q - cd **path-to-vimfiles**/GetLatest - mv GetLatestVimScripts.dist GetLatestVimScripts.dat - (edit GetLatestVimScripts.dat to install your own personal - list of desired plugins -- see |GetLatestVimScripts_dat|) - - -============================================================================== -3. GetLatestVimScripts Usage *glvs-usage* *:GLVS* - -Unless its been defined elsewhere, > - :GLVS -will invoke GetLatestVimScripts(). If some other plugin has defined that -command, then you may type -> - :GetLatestVimScripts -< -The script will attempt to update and, if permitted, will automatically -install scripts from http://vim.sourceforge.net/. To do so it will peruse a -file, -> - .vim/GetLatest/GetLatestVimScripts.dat (unix) -< -or > - ..wherever..\vimfiles\GetLatest\GetLatestVimScripts.dat (windows) -(see |glvs-data|), and examine plugins in your [.vim|vimfiles]/plugin -directory (see |glvs-plugins|). - -Scripts which have been downloaded will appear in the -~/.vim/GetLatest (unix) or ..wherever..\vimfiles\GetLatest (windows) -subdirectory. GetLatestVimScripts will attempt to automatically -install them if you have the following line in your <.vimrc>: > - - let g:GetLatestVimScripts_allowautoinstall=1 - -The file will be automatically be updated to -reflect the latest version of script(s) so downloaded. -(also see |glvs-options|) - - -============================================================================== -4. GetLatestVimScripts Data File *getscript-data* *glvs-data* - *:GetLatestVimScripts_dat* -The data file must have for its first two lines -the following text: -> - ScriptID SourceID Filename - -------------------------- -< -Following those two lines are three columns; the first two are numeric -followed by a text column. The GetLatest/GetLatestVimScripts.dist file -contains an example of such a data file. Anything following a #... is -ignored, so you may embed comments in the file. - -The first number on each line gives the script's ScriptID. When you're about -to use a web browser to look at scripts on http://vim.sf.net/, just before you -click on the script's link, you'll see a line resembling - - http://vim.sourceforge.net/scripts/script.php?script_id=40 - -The "40" happens to be a ScriptID that GetLatestVimScripts needs to -download the associated page. - -The second number on each line gives the script's SourceID. The SourceID -records the count of uploaded scripts as determined by vim.sf.net; hence it -serves to indicate "when" a script was uploaded. Setting the SourceID to 1 -insures that GetLatestVimScripts will assume that the script it has is -out-of-date. - -The SourceID is extracted by GetLatestVimScripts from the script's page on -vim.sf.net; whenever its greater than the one stored in the -GetLatestVimScripts.dat file, the script will be downloaded -(see |GetLatestVimScripts_dat|). - -If your script's author has included a special comment line in his/her plugin, -the plugin itself will be used by GetLatestVimScripts to build your - file, including any dependencies on other scripts it -may have. As an example, consider: > - - " GetLatestVimScripts: 884 1 :AutoInstall: AutoAlign.vim - -This comment line tells getscript.vim to check vimscript #884 and that the -script is automatically installable. Getscript will also use this line to -help build the GetLatestVimScripts.dat file, by including a line such as: > - - 884 1 AutoAlign.vim -< -in it an AutoAlign.vim line isn't already in GetLatestVimScripts.dat file. -See |glvs-plugins| for more. Thus, GetLatestVimScripts thus provides a -comprehensive ability to keep your plugins up-to-date! - - *GetLatestVimScripts_dat* -As an example of a file: -> - ScriptID SourceID Filename - -------------------------- - 294 1 Align.vim - 120 2 decho.vim - 40 3 DrawIt.tar.gz - 451 4 EasyAccents.vim - 195 5 engspchk.vim - 642 6 GetLatestVimScripts.vim - 489 7 Manpageview.vim -< -Note: the first two lines are required, but essentially act as comments. - - -============================================================================== -5. GetLatestVimScripts Friendly Plugins *getscript-plugins* *glvs-plugins* - -If a plugin author includes the following comment anywhere in their plugin, -GetLatestVimScripts will find it and use it to automatically build the user's -GetLatestVimScripts.dat files: -> - src_id - v - " GetLatestVimScripts: ### ### yourscriptname - ^ - scriptid -< -As an author, you should include such a line in to refer to your own script -plus any additional lines describing any plugin dependencies it may have. -Same format, of course! - -If your command is auto-installable (see |glvs-autoinstall|), and most scripts -are, then you may include :AutoInstall: at the start of "yourscriptname". - -GetLatestVimScripts commands for those scripts are then appended, if not -already present, to the user's GetLatest/GetLatestVimScripts.dat file. Its a -relatively painless way to automate the acquisition of any scripts your -plugins depend upon. - -Now, as an author, you probably don't want GetLatestVimScripts to download -your own scripts for you yourself, thereby overwriting your not-yet-released -hard work. GetLatestVimScripts provides a solution for this: put -> - 0 0 yourscriptname -< -into your file and GetLatestVimScripts will skip -examining the "yourscriptname" scripts for those GetLatestVimScripts comment -lines. As a result, those lines won't be inadvertently installed into your - file and subsequently used to download your own -scripts. This is especially important to do if you've included the -:AutoInstall: option. - -Be certain to use the same "yourscriptname" in the "0 0 yourscriptname" line -as you've used in your GetLatestVimScripts comment! - - -============================================================================== -6. GetLatestVimScripts AutoInstall *getscript-autoinstall* - *glvs-autoinstall* - -GetLatestVimScripts now supports "AutoInstall". Not all scripts are -supportive of auto-install, as they may have special things you need to do to -install them (please refer to the script's "install" directions). On the -other hand, most scripts will be auto-installable. - -To let GetLatestVimScripts do an autoinstall, the data file's comment field -should begin with (surrounding blanks are ignored): > - - :AutoInstall: -< -Both colons are needed, and it should begin the comment (yourscriptname) -field. - -One may prevent any autoinstalling by putting the following line in your -<.vimrc>: > - - let g:GetLatestVimScripts_allowautoinstall= 0 -< -With :AutoInstall: enabled, as it is by default, files which end with - - ---.tar.bz2 : decompressed & untarred in .vim/ directory - ---.vba.bz2 : decompressed in .vim/ directory, then vimball handles it - ---.vim.bz2 : decompressed & moved into .vim/plugin directory - ---.tar.gz : decompressed & untarred in .vim/ directory - ---.vba.gz : decompressed in .vim/ directory, then vimball handles it - ---.vim.gz : decompressed & moved into .vim/plugin directory - ---.vba : unzipped in .vim/ directory - ---.vim : moved to .vim/plugin directory - ---.zip : unzipped in .vim/ directory - -and which merely need to have their components placed by the untar/gunzip or -move-to-plugin-directory process should be auto-installable. Vimballs, of -course, should always be auto-installable. - -When is a script not auto-installable? Let me give an example: - - .vim/after/syntax/blockhl.vim - -The script provides block highlighting for C/C++ programs; it is -available at: - - http://vim.sourceforge.net/scripts/script.php?script_id=104 - -Currently, vim's after/syntax only supports by-filetype scripts (in -blockhl.vim's case, that's after/syntax/c.vim). Hence, auto-install would -possibly overwrite the current user's after/syntax/c.vim file. - -In my own case, I use (renamed to after/syntax/c.vim) to -allow a after/syntax/c/ directory: - - http://vim.sourceforge.net/scripts/script.php?script_id=1023 - -The script allows multiple syntax files to exist separately in the -after/syntax/c subdirectory. I can't bundle aftersyntax.vim in and build an -appropriate tarball for auto-install because of the potential for the -after/syntax/c.vim contained in it to overwrite a user's c.vim. - - -============================================================================== -7. GetLatestVimScripts Options *glvs-options* -> - g:GetLatestVimScripts_wget -< default= "wget" - This variable holds the name of the command for obtaining - scripts. -> - g:GetLatestVimScripts_options -< default= "-q -O" - This variable holds the options to be used with the - g:GetLatestVimScripts_wget command. -> - g:getLatestVimScripts_allowautoinstall -< default= 1 - This variable indicates whether GetLatestVimScripts is allowed - to attempt to automatically install scripts. Note that it - doesn't understand vimballs (yet). Furthermore, the plugin - author has to have explicitly indicated that his/her plugin - is automatically installable. - - -============================================================================== -8. GetLatestVimScripts Algorithm *glvs-algorithm* *glvs-alg* - -The Vim sourceforge page dynamically creates a page by keying off of the -so-called script-id. Within the webpage of - - http://vim.sourceforge.net/scripts/script.php?script_id=40 - -is a line specifying the latest source-id (src_id). The source identifier -numbers are always increasing, hence if the src_id is greater than the one -recorded for the script in GetLatestVimScripts then it's time to download a -newer copy of that script. - -GetLatestVimScripts will then download the script and update its internal -database of script ids, source ids, and scriptnames. - -The AutoInstall process will: - - Move the file from GetLatest/ to the following directory - Unix : $HOME/.vim - Windows: $HOME\vimfiles - if the downloaded file ends with ".bz2" - bunzip2 it - else if the downloaded file ends with ".gz" - gunzip it - if the resulting file ends with ".zip" - unzip it - else if the resulting file ends with ".tar" - tar -oxvf it - else if the resulting file ends with ".vim" - move it to the plugin subdirectory - - -============================================================================== -9. GetLatestVimScripts History *getscript-history* *glvs-hist* {{{1 - -v29 Jan 07, 2008 : * Bram M pointed out that cpo is a global option and that - getscriptPlugin.vim was setting it but not restoring it. -v28 Jan 02, 2008 : * improved shell quoting character handling, cygwin - interface, register-a bypass - Oct 29, 2007 * Bill McCarthy suggested a change to getscript that avoids - creating pop-up windows -v24 Apr 16, 2007 : * removed save&restore of the fo option during script - loading -v23 Nov 03, 2006 : * ignores comments (#...) - * handles vimballs -v22 Oct 13, 2006 : * supports automatic use of curl if wget is not - available -v21 May 01, 2006 : * now takes advantage of autoloading. -v20 Dec 23, 2005 : * Eric Haarbauer found&fixed a bug with unzip use; - unzip needs the -o flag to overwrite. -v19 Nov 28, 2005 : * v18's GetLatestVimScript line accessed the wrong - script! Fixed. -v18 Mar 21, 2005 : * bugfix to automatic database construction - * bugfix - nowrapscan caused an error - (tnx to David Green for the fix) - Apr 01, 2005 * if shell is bash, "mv" instead of "ren" used in - :AutoInstall:s, even though its o/s is windows - Apr 01, 2005 * when downloading errors occurred, GLVS was - terminating early. It now just goes on to trying - the next script (after trying three times to - download a script description page) - Apr 20, 2005 * bugfix - when a failure to download occurred, - GetLatestVimScripts would stop early and claim that - everything was current. Fixed. -v17 Aug 25, 2004 : * g:GetLatestVimScripts_allowautoinstall, which - defaults to 1, can be used to prevent all - :AutoInstall: -v16 Aug 25, 2004 : * made execution of bunzip2/gunzip/tar/zip silent - * fixed bug with :AutoInstall: use of helptags -v15 Aug 24, 2004 : * bugfix: the "0 0 comment" download prevention wasn't - always preventing downloads (just usually). Fixed. -v14 Aug 24, 2004 : * bugfix -- helptags was using dotvim, rather than - s:dotvim. Fixed. -v13 Aug 23, 2004 : * will skip downloading a file if its scriptid or srcid - is zero. Useful for script authors; that way their - own GetLatestVimScripts activity won't overwrite - their scripts. -v12 Aug 23, 2004 : * bugfix - a "return" got left in the distribution that - was intended only for testing. Removed, now works. - * :AutoInstall: implemented -v11 Aug 20, 2004 : * GetLatestVimScripts is now a plugin: - * :GetLatestVimScripts command - * (runtimepath)/GetLatest/GetLatestVimScripts.dat - now holds scripts that need updating -v10 Apr 19, 2004 : * moved history from script to doc -v9 Jan 23, 2004 : windows (win32/win16/win95) will use - double quotes ("") whereas other systems will use - single quotes ('') around the urls in calls via wget -v8 Dec 01, 2003 : makes three tries at downloading -v7 Sep 02, 2003 : added error messages if "Click on..." or "src_id=" - not found in downloaded webpage - Uses t_ti, t_te, and rs to make progress visible -v6 Aug 06, 2003 : final status messages now display summary of work - ( "Downloaded someqty scripts" or - "Everything was current") - Now GetLatestVimScripts is careful about downloading - GetLatestVimScripts.vim itself! - (goes to ) -v5 Aug 04, 2003 : missing an endif near bottom -v4 Jun 17, 2003 : redraw! just before each "considering" message -v3 May 27, 2003 : Protects downloaded files from errant shell - expansions with single quotes: '...' -v2 May 14, 2003 : extracts name of item to be obtained from the - script file. Uses it instead of comment field - for output filename; comment is used in the - "considering..." line and is now just a comment! - * Fixed a bug: a string-of-numbers is not the - same as a number, so I added zero to them - and they became numbers. Fixes comparison. - -============================================================================== -vim:tw=78:ts=8:ft=help:fdm=marker diff --git a/doc/tags b/doc/tags index 2d3704e..fa73aba 100644 --- a/doc/tags +++ b/doc/tags @@ -81,8 +81,6 @@ :FufTag fuf.txt /*:FufTag* :FufTagWithCursorWord fuf.txt /*:FufTagWithCursorWord* :FufTaggedFile fuf.txt /*:FufTaggedFile* -:GLVS pi_getscript.txt /*:GLVS* -:GetLatestVimScripts_dat pi_getscript.txt /*:GetLatestVimScripts_dat* :Mark mark.txt /*:Mark* :NERDTree NERD_tree.txt /*:NERDTree* :NERDTreeClose NERD_tree.txt /*:NERDTreeClose* @@ -110,31 +108,31 @@ :VWS vimwiki.txt /*:VWS* :Vimwiki2HTML vimwiki.txt /*:Vimwiki2HTML* :VimwikiAll2HTML vimwiki.txt /*:VimwikiAll2HTML* -:VimwikiDeleteWord vimwiki.txt /*:VimwikiDeleteWord* -:VimwikiFollowWord vimwiki.txt /*:VimwikiFollowWord* +:VimwikiDeleteLink vimwiki.txt /*:VimwikiDeleteLink* +:VimwikiDiaryNextDay vimwiki.txt /*:VimwikiDiaryNextDay* +:VimwikiDiaryPrevDay vimwiki.txt /*:VimwikiDiaryPrevDay* +:VimwikiFollowLink vimwiki.txt /*:VimwikiFollowLink* :VimwikiGenerateLinks vimwiki.txt /*:VimwikiGenerateLinks* -:VimwikiGoBackWord vimwiki.txt /*:VimwikiGoBackWord* -:VimwikiGoHome vimwiki.txt /*:VimwikiGoHome* +:VimwikiGoBackLink vimwiki.txt /*:VimwikiGoBackLink* +:VimwikiGoto vimwiki.txt /*:VimwikiGoto* +:VimwikiIndex vimwiki.txt /*:VimwikiIndex* :VimwikiMakeDiaryNote vimwiki.txt /*:VimwikiMakeDiaryNote* -:VimwikiNextWord vimwiki.txt /*:VimwikiNextWord* -:VimwikiPrevWord vimwiki.txt /*:VimwikiPrevWord* -:VimwikiRenameWord vimwiki.txt /*:VimwikiRenameWord* +:VimwikiNextLink vimwiki.txt /*:VimwikiNextLink* +:VimwikiPrevLink vimwiki.txt /*:VimwikiPrevLink* +:VimwikiRenameLink vimwiki.txt /*:VimwikiRenameLink* :VimwikiSearch vimwiki.txt /*:VimwikiSearch* -:VimwikiSplitWord vimwiki.txt /*:VimwikiSplitWord* -:VimwikiTabGoHome vimwiki.txt /*:VimwikiTabGoHome* +:VimwikiSplitLink vimwiki.txt /*:VimwikiSplitLink* +:VimwikiTabIndex vimwiki.txt /*:VimwikiTabIndex* :VimwikiTabMakeDiaryNote vimwiki.txt /*:VimwikiTabMakeDiaryNote* :VimwikiTable vimwiki.txt /*:VimwikiTable* :VimwikiTableMoveColumnLeft vimwiki.txt /*:VimwikiTableMoveColumnLeft* :VimwikiTableMoveColumnRight vimwiki.txt /*:VimwikiTableMoveColumnRight* :VimwikiToggleListItem vimwiki.txt /*:VimwikiToggleListItem* :VimwikiUISelect vimwiki.txt /*:VimwikiUISelect* -:VimwikiVSplitWord vimwiki.txt /*:VimwikiVSplitWord* +:VimwikiVSplitLink vimwiki.txt /*:VimwikiVSplitLink* ExtractSnips() snipMate.txt /*ExtractSnips()* ExtractSnipsFile() snipMate.txt /*ExtractSnipsFile()* Filename() snipMate.txt /*Filename()* -GetLatestVimScripts pi_getscript.txt /*GetLatestVimScripts* -GetLatestVimScripts-copyright pi_getscript.txt /*GetLatestVimScripts-copyright* -GetLatestVimScripts_dat pi_getscript.txt /*GetLatestVimScripts_dat* NERDTree NERD_tree.txt /*NERDTree* NERDTree-? NERD_tree.txt /*NERDTree-?* NERDTree-A NERD_tree.txt /*NERDTree-A* @@ -383,7 +381,9 @@ g:vimwiki_auto_checkbox vimwiki.txt /*g:vimwiki_auto_checkbox* g:vimwiki_badsyms vimwiki.txt /*g:vimwiki_badsyms* g:vimwiki_browsers vimwiki.txt /*g:vimwiki_browsers* g:vimwiki_camel_case vimwiki.txt /*g:vimwiki_camel_case* +g:vimwiki_conceallevel vimwiki.txt /*g:vimwiki_conceallevel* g:vimwiki_dir_link vimwiki.txt /*g:vimwiki_dir_link* +g:vimwiki_file_exts vimwiki.txt /*g:vimwiki_file_exts* g:vimwiki_fold_lists vimwiki.txt /*g:vimwiki_fold_lists* g:vimwiki_fold_trailing_empty_lines vimwiki.txt /*g:vimwiki_fold_trailing_empty_lines* g:vimwiki_folding vimwiki.txt /*g:vimwiki_folding* @@ -402,27 +402,8 @@ g:vimwiki_table_auto_fmt vimwiki.txt /*g:vimwiki_table_auto_fmt* g:vimwiki_upper vimwiki.txt /*g:vimwiki_upper* g:vimwiki_use_calendar vimwiki.txt /*g:vimwiki_use_calendar* g:vimwiki_use_mouse vimwiki.txt /*g:vimwiki_use_mouse* +g:vimwiki_valid_html_tags vimwiki.txt /*g:vimwiki_valid_html_tags* g:vimwiki_w32_dir_enc vimwiki.txt /*g:vimwiki_w32_dir_enc* -getlatestvimscripts-install pi_getscript.txt /*getlatestvimscripts-install* -getscript pi_getscript.txt /*getscript* -getscript-autoinstall pi_getscript.txt /*getscript-autoinstall* -getscript-data pi_getscript.txt /*getscript-data* -getscript-history pi_getscript.txt /*getscript-history* -getscript-plugins pi_getscript.txt /*getscript-plugins* -getscript-start pi_getscript.txt /*getscript-start* -glvs pi_getscript.txt /*glvs* -glvs-alg pi_getscript.txt /*glvs-alg* -glvs-algorithm pi_getscript.txt /*glvs-algorithm* -glvs-autoinstall pi_getscript.txt /*glvs-autoinstall* -glvs-contents pi_getscript.txt /*glvs-contents* -glvs-copyright pi_getscript.txt /*glvs-copyright* -glvs-data pi_getscript.txt /*glvs-data* -glvs-dist-install pi_getscript.txt /*glvs-dist-install* -glvs-hist pi_getscript.txt /*glvs-hist* -glvs-install pi_getscript.txt /*glvs-install* -glvs-options pi_getscript.txt /*glvs-options* -glvs-plugins pi_getscript.txt /*glvs-plugins* -glvs-usage pi_getscript.txt /*glvs-usage* i_CTRL-G_S surround.txt /*i_CTRL-G_S* i_CTRL-G_s surround.txt /*i_CTRL-G_s* i_CTRL-R_ snipMate.txt /*i_CTRL-R_* @@ -430,18 +411,19 @@ list-snippets snipMate.txt /*list-snippets* mark-configuration mark.txt /*mark-configuration* mark-dependencies mark.txt /*mark-dependencies* mark-description mark.txt /*mark-description* +mark-highlighting mark.txt /*mark-highlighting* mark-history mark.txt /*mark-history* mark-ideas mark.txt /*mark-ideas* mark-installation mark.txt /*mark-installation* mark-integration mark.txt /*mark-integration* mark-known-problems mark.txt /*mark-known-problems* mark-limitations mark.txt /*mark-limitations* +mark-searching mark.txt /*mark-searching* mark-todo mark.txt /*mark-todo* mark-usage mark.txt /*mark-usage* mark.txt mark.txt /*mark.txt* mark.vim mark.txt /*mark.vim* multi_snip snipMate.txt /*multi_snip* -pi_getscript.txt pi_getscript.txt /*pi_getscript.txt* project project.txt /*project* project-adding-mappings project.txt /*project-adding-mappings* project-example project.txt /*project-example* @@ -540,7 +522,6 @@ vimwiki-option-diary_index vimwiki.txt /*vimwiki-option-diary_index* vimwiki-option-diary_link_count vimwiki.txt /*vimwiki-option-diary_link_count* vimwiki-option-diary_rel_path vimwiki.txt /*vimwiki-option-diary_rel_path* vimwiki-option-ext vimwiki.txt /*vimwiki-option-ext* -vimwiki-option-gohome vimwiki.txt /*vimwiki-option-gohome* vimwiki-option-html_footer vimwiki.txt /*vimwiki-option-html_footer* vimwiki-option-html_header vimwiki.txt /*vimwiki-option-html_header* vimwiki-option-index vimwiki.txt /*vimwiki-option-index* @@ -567,6 +548,7 @@ vimwiki-table-of-contents vimwiki.txt /*vimwiki-table-of-contents* vimwiki-tables vimwiki.txt /*vimwiki-tables* vimwiki-temporary-wiki vimwiki.txt /*vimwiki-temporary-wiki* vimwiki-text-objects vimwiki.txt /*vimwiki-text-objects* +vimwiki-title vimwiki.txt /*vimwiki-title* vimwiki-toc vimwiki.txt /*vimwiki-toc* vimwiki-todo-lists vimwiki.txt /*vimwiki-todo-lists* vimwiki.txt vimwiki.txt /*vimwiki.txt* @@ -575,7 +557,9 @@ vimwiki_ vimwiki.txt /*vimwiki_* vimwiki_ vimwiki.txt /*vimwiki_* vimwiki_ vimwiki.txt /*vimwiki_* vimwiki_ vimwiki.txt /*vimwiki_* +vimwiki_ vimwiki.txt /*vimwiki_* vimwiki_ vimwiki.txt /*vimwiki_* +vimwiki_ vimwiki.txt /*vimwiki_* vimwiki_ vimwiki.txt /*vimwiki_* vimwiki_wd vimwiki.txt /*vimwiki_wd* vimwiki_wr vimwiki.txt /*vimwiki_wr* diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index 6050c58..8cae209 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -9,7 +9,7 @@ |___| |___| |_| |_||__| |__||___| |___| |_||___| ~ - Version: 1.0 + Version: 1.1 ============================================================================== CONTENTS *vimwiki-contents* @@ -97,7 +97,7 @@ There are global and local mappings in vimwiki. ------------------------------------------------------------------------------ 3.1. Global mappings *vimwiki-global-mappings* -[count]ww or VimwikiGoHome +[count]ww or VimwikiIndex Open index file of the [count]'s wiki. ww opens first wiki from |g:vimwiki_list|. @@ -106,12 +106,12 @@ There are global and local mappings in vimwiki. 3ww opens third wiki from |g:vimwiki_list|. etc. To remap: > - :map w VimwikiGoHome + :map w VimwikiIndex < -See also|:VimwikiGoHome| +See also |:VimwikiIndex| -[count]wt or VimwikiTabGoHome +[count]wt or VimwikiTabIndex Open index file of the [count]'s wiki in a new tab. wt tabopens first wiki from |g:vimwiki_list|. @@ -120,9 +120,9 @@ See also|:VimwikiGoHome| 3wt tabopens third wiki from |g:vimwiki_list|. etc. To remap: > - :map t VimwikiTabGoHome + :map t VimwikiTabIndex < -See also|:VimwikiTabGoHome| +See also |:VimwikiTabIndex| ws or VimwikiUISelect @@ -174,56 +174,56 @@ See also|:VimwikiTabMakeDiaryNote| NORMAL MODE *vimwiki-local-mappings* *vimwiki_* - Follow/Create WikiWord. - Maps to|:VimwikiFollowWord|. + Follow/Create wiki link. + Maps to |:VimwikiFollowLink|. To remap: > - :map wf VimwikiFollowWord + :map wf VimwikiFollowLink < *vimwiki_* - Split and follow/create WikiWord - Maps to|:VimwikiSplitWord|. + Split and follow/create wiki link. + Maps to |:VimwikiSplitLink|. To remap: > - :map we VimwikiSplitWord + :map we VimwikiSplitLink < *vimwiki_* - Vertical split and follow/create WikiWord - Maps to|:VimwikiVSplitWord|. + Vertical split and follow/create wiki link. + Maps to |:VimwikiVSplitLink|. To remap: > - :map wq VimwikiVSplitWord + :map wq VimwikiVSplitLink < *vimwiki_* - Go back to previous WikiWord - Maps to|:VimwikiGoBackWord|. + Go back to previous wiki link + Maps to |:VimwikiGoBackLink|. To remap: > - :map wb VimwikiGoBackWord + :map wb VimwikiGoBackLink < *vimwiki_* - Find next WikiWord - Maps to|:VimwikiNextWord|. + Find next wiki link. + Maps to |:VimwikiNextLink|. To remap: > - :map wn VimwikiNextWord + :map wn VimwikiNextLink < *vimwiki_* - Find previous WikiWord - Maps to|:VimwikiPrevWord|. + Find previous wiki link. + Maps to |:VimwikiPrevLink|. To remap: > - :map wp VimwikiPrevWord + :map wp VimwikiPrevLink < *vimwiki_wd* -wd Delete WikiWord you are in. - Maps to|:VimwikiDeleteWord|. +wd Delete wiki link you are in. + Maps to |:VimwikiDeleteLink|. To remap: > - :map dd VimwikiDeleteWord + :map dd VimwikiDeleteLink < *vimwiki_wr* -wr Rename WikiWord you are in. - Maps to|:VimwikiRenameWord|. +wr Rename wiki link you are in. + Maps to |:VimwikiRenameLink|. To remap: > - :map rr VimwikiRenameWord + :map rr VimwikiRenameLink < *vimwiki_* Toggle list item on/off (checked/unchecked) - Maps to|:VimwikiToggleListItem|. + Maps to |:VimwikiToggleListItem|. To remap: > :map tt VimwikiToggleListItem < See |vimwiki-todo-lists|. @@ -250,16 +250,23 @@ gww reformat it. Move current table column to the right. See |:VimwikiTableMoveColumnRight| + *vimwiki_* + Open previous day diary link if available. + See |:VimwikiDiaryPrevDay| + + *vimwiki_* + Open next day diary link if available. + See |:VimwikiDiaryNextDay| Works only if |g:vimwiki_use_mouse| is set to 1. -<2-LeftMouse> Follow/Create WikiWord +<2-LeftMouse> Follow/Create wiki link. - Split and follow/create WikiWord + Split and follow/create wiki link. - Vertical split and follow/create WikiWord + Vertical split and follow/create wiki link. - Go back to previous WikiWord + Go back to previous wiki link. Note: <2-LeftMouse> is just left double click. @@ -298,10 +305,10 @@ ic Inner column in a table. ------------------------------------------------------------------------------ 4.1. Global Commands *vimwiki-global-commands* -*:VimwikiGoHome* +*:VimwikiIndex* Open index file of the current wiki. -*:VimwikiTabGoHome* +*:VimwikiTabIndex* Open index file of the current wiki in a new tab. *:VimwikiUISelect* @@ -316,36 +323,40 @@ ic Inner column in a table. ------------------------------------------------------------------------------ 4.2. Local commands *vimwiki-local-commands* -*:VimwikiFollowWord* - Follow/create WikiWord. +*:VimwikiFollowLink* + Follow/create wiki link.. -*:VimwikiGoBackWord* - Go back to previous WikiWord you come from. +*:VimwikiGoBackLink* + Go back to previous wiki link. you come from. -*:VimwikiSplitWord* - Split and follow/create WikiWord. +*:VimwikiSplitLink* + Split and follow/create wiki link.. -*:VimwikiVSplitWord* - Vertical split and follow/create WikiWord. +*:VimwikiVSplitLink* + Vertical split and follow/create wiki link.. -*:VimwikiNextWord* - Find next WikiWord. +*:VimwikiNextLink* + Find next wiki link.. -*:VimwikiPrevWord* - Find previous WikiWord. +*:VimwikiPrevLink* + Find previous wiki link.. + +*:VimwikiGoto* + Goto link provided by an argument. For example: > + :VimwikiGoto HelloWorld +< opens opens/creates HelloWorld wiki page. + +*:VimwikiDeleteLink* + Delete wiki link. you are in. -*:VimwikiDeleteWord* - Delete WikiWord you are in. - - -*:VimwikiRenameWord* - Rename WikiWord you are in. +*:VimwikiRenameLink* + Rename wiki link. you are in. *:Vimwiki2HTML* @@ -405,6 +416,13 @@ ic Inner column in a table. *:VimwikiGenerateLinks* Insert all available links into current buffer. +*:VimwikiDiaryNextDay* + Open next day diary link if available. + Mapped to . + +*:VimwikiDiaryPrevDay* + Open previous day diary link if available. + Mapped to . ============================================================================== @@ -768,6 +786,18 @@ or > %toc Whatever +------------------------------------------------------------------------------ +%title Title of the page *vimwiki-title* + +When you htmlize your wiki page you have default title which is the filename +of the page. +Place > + +%title My books + +into your wiki page if you want another title. + + ------------------------------------------------------------------------------ %nohtml *vimwiki-nohtml* @@ -1063,7 +1093,7 @@ This header.tpl could look like: >
where - %title% is replaced by a wiki page name + %title% is replaced by a wiki page name or by a |vimwiki-title| %root_path% is replaced by a count of ../ for pages buried in subdirs: if you have wikilink [[dir1/dir2/dir3/my page in a subdir]] then %root_path% is replaced by '../../../'. @@ -1100,19 +1130,6 @@ or even > \ 'css_name': 'css/main.css'}] < -*vimwiki-option-gohome* ------------------------------------------------------------------------------- -Key Default value Values~ -gohome split split, vsplit, tabe - -Description~ -This option controls the way |:VimwikiGoHome| command works. -For instance you have 'No write since last change' buffer. After ww -(or :VimwikiGoHome) vimwiki index file will be splitted with it. Or vertically -splitted. Or opened in a new tab. -Ex: > - let g:vimwiki_list = [{'path': '~/my_site/', 'gohome': 'vsplit'}] -< *vimwiki-option-maxhi* ------------------------------------------------------------------------------ @@ -1120,11 +1137,11 @@ Key Default value Values~ maxhi 1 0, 1 Description~ -Non-existent WikiWord highlighting could be quite slow and if you don't want +Non-existent wiki links highlighting could be quite slow and if you don't want it set maxhi to 0: > let g:vimwiki_list = [{'path': '~/my_site/', 'maxhi': 0}] -This disables filesystem checks for WikiWords. +This disables filesystem checks for wiki links. *vimwiki-option-nested_syntaxes* @@ -1478,6 +1495,9 @@ Value Description~ Default: 0 +Note: Vim73 has new function |strdisplaywidth|, so for Vim73 users this option +is obsolete. + ------------------------------------------------------------------------------ *g:vimwiki_dir_link* @@ -1558,6 +1578,42 @@ headers would look like: > Default: '' (empty) +------------------------------------------------------------------------------ +*g:vimwiki_file_exts* + +Comma separated list of file extensions. + +Consider you have the following link: [[my_script.php][my script]]. +If there is 'php' extension in g:vimwiki_file_exts this link would be htmlized +to my script. +Otherwise it would be my script (note .html) + + +Default: 'pdf,txt,doc,rtf,xls,php,zip,rar,7z,html,gz' + + +------------------------------------------------------------------------------ +*g:vimwiki_valid_html_tags* + +Comma separated list of html tags that can be used in vimwiki. + +Default: 'b,i,s,u,sub,sup,kbd,br,hr' + + +------------------------------------------------------------------------------ +*g:vimwiki_conceallevel* + +In vim73 |conceallevel| is local to window, thus if you open viwmiki buffer in +a new tab or window, it would be set to default value. + +Vimwiki sets |conceallevel| to g:vimwiki_conceallevel everytime vimwiki buffer +is entered. + +Default: 3 + + + + ============================================================================== 12. Help *vimwiki-help* @@ -1592,6 +1648,45 @@ Maxim Kim. ============================================================================== 14. Changelog *vimwiki-changelog* +1.1~ + * NEW: Issue 57: Make it possible to have pre block inside list item. + * NEW: Issue 82: Add quick goto command. See |:VimwikiGoto|. + * NEW: Issue 83: Quick switch in diary. See |:VimwikiDiaryNextDay| and + |:VimwikiDiaryPrevDay| commands. + * FIX: Issue 84: Vimwiki rename removed the WikiWord display name. + * FIX: Issue 85: Errors if you have '~' subdirectory in a wiki directory. + * FIX: Issue 86: Existed links '[[WikiLink1|Alias1]] | [[WikiLink2]]' are + highlighted as a single link. + * FIX: Issue 88: Underline text. See |g:vimwiki_valid_html_tags|. + * FIX: Issue 92: Wikies in a subdir could be renamed to an empty file. + * FIX: Issue 93: Use alias name in html title. See |vimwiki-title|. + * FIX: Issue 94: Relative links to PHP files are broken. See + |g:vimwiki_file_exts| for details. + * FIX: Issue 96: Closing bracket at the end of weblink shouldn't be a part + of that link. + * FIX: Issue 97: Error opening weblink in a browser if it has # inside. + * FIX: Issue 99: Vim is not responing while opening arbitrary wiki file. + * FIX: Issue 100: Additional content on diary index page could be + corrupted. + * NEW: Issue 101: Customized HTML tags. See |g:vimwiki_valid_html_tags| + * NEW: Issue 102: Conceal feature usage. See |g:vimwiki_conceallevel|. + * FIX: Issue 103: Always highlight links to non-wiki files as existed. + * FIX: Issue 104: vimwiki#nested_syntax needs 'keepend' to avoid contained + language syntax eat needed '}}}'. + * FIX: Issue 105: on a todo list item with [ ] doesn't create new + todo list item. + * FIX: Issue 106: With MediaWiki syntax on a child todo list + item produce errors. + * FIX: Issue 107: With MediaWiki syntax on a list item creates + todo list item without space between * and [ ]. + * FIX: Issue 110: Syntax highlighting doesn't work for indented codeblock. + * FIX: Issue 115: Nested Perl syntax highlighting differs from regular + one. + * MISC: Many vimwiki commands were renamed from Vimwiki.*Word to + Vimwiki.*Link. VimwikiGoHome is renamed to VimwikiIndex, + VimwikiTabGoHome to VimwikiTabIndex. + * MISC: vimwiki-option-gohome is removed. + 1.0~ * NEW: Issue 41: Table cell and column text objects. See |vimwiki-text-objects|. diff --git a/ftplugin/python/pyflakes.vim b/ftplugin/python/pyflakes.vim index 8aa508b..d6699bc 100644 --- a/ftplugin/python/pyflakes.vim +++ b/ftplugin/python/pyflakes.vim @@ -159,6 +159,42 @@ if !exists("*s:WideMsg") endfun endif +if !exists("*s:GetQuickFixStackCount") + function s:GetQuickFixStackCount() + let l:stack_count = 0 + try + silent colder 9 + catch /E380:/ + endtry + + try + for i in range(9) + silent cnewer + let l:stack_count = l:stack_count + 1 + endfor + catch /E381:/ + return l:stack_count + endtry + endfunction +endif + +if !exists("*s:ActivatePyflakesQuickFixWindow") + function s:ActivatePyflakesQuickFixWindow() + try + silent colder 9 " go to the bottom of quickfix stack + catch /E380:/ + endtry + + if s:pyflakes_qf > 0 + try + exe "silent cnewer " . s:pyflakes_qf + catch /E381:/ + echoerr "Could not activate Pyflakes Quickfix Window." + endtry + endif + endfunction +endif + if !exists("*s:RunPyflakes") function s:RunPyflakes() highlight link PyFlakes SpellBad @@ -174,12 +210,23 @@ if !exists("*s:RunPyflakes") let b:matched = [] let b:matchedlines = {} + + let b:qf_list = [] + let b:qf_window_count = -1 + python << EOF for w in check(vim.current.buffer): vim.command('let s:matchDict = {}') vim.command("let s:matchDict['lineNum'] = " + str(w.lineno)) vim.command("let s:matchDict['message'] = '%s'" % vim_quote(w.message % w.message_args)) vim.command("let b:matchedlines[" + str(w.lineno) + "] = s:matchDict") + + vim.command("let l:qf_item = {}") + vim.command("let l:qf_item.bufnr = bufnr('%')") + vim.command("let l:qf_item.filename = expand('%')") + vim.command("let l:qf_item.lnum = %s" % str(w.lineno)) + vim.command("let l:qf_item.text = '%s'" % vim_quote(w.message % w.message_args)) + vim.command("let l:qf_item.type = 'E'") if w.col is None or isinstance(w, SyntaxError): # without column information, just highlight the whole line @@ -189,8 +236,21 @@ for w in check(vim.current.buffer): # with a column number, highlight the first keyword there vim.command(r"let s:mID = matchadd('PyFlakes', '^\%" + str(w.lineno) + r"l\_.\{-}\zs\k\+\k\@!\%>" + str(w.col) + r"c')") + vim.command("let l:qf_item.vcol = 1") + vim.command("let l:qf_item.col = %s" % str(w.col + 1)) + vim.command("call add(b:matched, s:matchDict)") + vim.command("call add(b:qf_list, l:qf_item)") EOF + if exists("s:pyflakes_qf") + " if pyflakes quickfix window is already created, reuse it + call s:ActivatePyflakesQuickFixWindow() + call setqflist(b:qf_list, 'r') + else + " one pyflakes quickfix window for all buffer + call setqflist(b:qf_list, '') + let s:pyflakes_qf = s:GetQuickFixStackCount() + endif let b:cleared = 0 endfunction end diff --git a/ftplugin/rst/commons.vim b/ftplugin/rst/commons.vim index 6efdd62..0658411 100644 --- a/ftplugin/rst/commons.vim +++ b/ftplugin/rst/commons.vim @@ -1,16 +1,16 @@ " Some common settings for all reSt files -set textwidth=80 -set makeprg=rst2html.py\ %\ %.html -set spell -set smartindent -set autoindent -set formatoptions+=w +setlocal textwidth=80 +setlocal makeprg=rst2html.py\ %\ %.html +setlocal spell +setlocal smartindent +setlocal autoindent +setlocal formatoptions=tcq "set VIms default -map :call Rst2Blogger() +map :call Rst2Blogger() " Simple function, that translates reSt text into html with specified format, " suitable to copy and paste into blogger post. -fun! Rst2Blogger() +fun Rst2Blogger() python << EOF from docutils import core from docutils.writers.html4css1 import Writer, HTMLTranslator @@ -45,7 +45,7 @@ _w = Writer() _w.translator_class = NoHeaderHTMLTranslator def blogify(string): - return core.publish_string(string,writer=_w) + return core.publish_string(string, writer=_w) bufcontent = "\n".join(vim.current.buffer) name = vim.current.buffer.name @@ -54,16 +54,18 @@ if name.lower().endswith(".rst"): vim.command('new') vim.current.buffer[:] = blogify(bufcontent).split("\n") - vim.command('saveas %s' % name) + vim.command(r'silent %s///g') + vim.command(r'silent %s/<\/tt>/<\/code>/g') + vim.command('w %s' % name) vim.command('bd') else: - print "This is not reSt file. File should have '.rst' extension." + print "Ihis is not reSt file. File should have '.rst' extension." EOF endfun " This is similar to that above, but creates full html document -fun! Restify() +fun Restify() python << EOF from docutils import core from docutils.writers.html4css1 import Writer, HTMLTranslator @@ -82,10 +84,12 @@ if name.lower().endswith(".rst"): vim.command('new') vim.current.buffer[:] = reSTify(bufcontent).split("\n") - vim.command('saveas %s' % name) + vim.command(r'silent %s///g') + vim.command(r'silent %s/<\/tt>/<\/code>/g') + vim.command('w %s' % name) vim.command('bd') else: - print 'To nie jest plik reSt!' + print "It's not reSt file!" EOF endfun diff --git a/ftplugin/vimwiki.vim b/ftplugin/vimwiki.vim index 807d1f5..be97b29 100644 --- a/ftplugin/vimwiki.vim +++ b/ftplugin/vimwiki.vim @@ -21,6 +21,11 @@ let b:undo_ftplugin = "setlocal ". setlocal autowriteall setlocal commentstring= + +if g:vimwiki_conceallevel && exists("+conceallevel") + let &conceallevel = g:vimwiki_conceallevel +endif + " MISC }}} " GOTO FILE: gf {{{ @@ -38,32 +43,22 @@ else endif setlocal formatoptions=tnro -inoremap vimwiki_lst#insertCR() -nnoremap o :call vimwiki_lst#insertOo('o')a -nnoremap O :call vimwiki_lst#insertOo('O')a - if !empty(&langmap) " Valid only if langmap is a comma separated pairs of chars let l_o = matchstr(&langmap, '\C,\zs.\zeo,') if l_o - exe 'nnoremap '.l_o.' :call vimwiki_lst#insertOo("o")a' + exe 'nnoremap '.l_o.' :call vimwiki_lst#kbd_oO("o")a' endif let l_O = matchstr(&langmap, '\C,\zs.\zeO,') if l_O - exe 'nnoremap '.l_O.' :call vimwiki_lst#insertOo("O")a' + exe 'nnoremap '.l_O.' :call vimwiki_lst#kbd_oO("O")a' endif endif " COMMENTS }}} " FOLDING for headers and list items using expr fold method. {{{ -if g:vimwiki_folding == 1 - setlocal fdm=expr - setlocal foldexpr=VimwikiFoldLevel(v:lnum) - setlocal foldtext=VimwikiFoldText() -endif - function! VimwikiFoldLevel(lnum) "{{{ let line = getline(a:lnum) @@ -208,14 +203,14 @@ command! -buffer Vimwiki2HTML command! -buffer VimwikiAll2HTML \ call vimwiki_html#WikiAll2HTML(expand(VimwikiGet('path_html'))) -command! -buffer VimwikiNextWord call vimwiki#WikiNextWord() -command! -buffer VimwikiPrevWord call vimwiki#WikiPrevWord() -command! -buffer VimwikiDeleteWord call vimwiki#WikiDeleteWord() -command! -buffer VimwikiRenameWord call vimwiki#WikiRenameWord() -command! -buffer VimwikiFollowWord call vimwiki#WikiFollowWord('nosplit') -command! -buffer VimwikiGoBackWord call vimwiki#WikiGoBackWord() -command! -buffer VimwikiSplitWord call vimwiki#WikiFollowWord('split') -command! -buffer VimwikiVSplitWord call vimwiki#WikiFollowWord('vsplit') +command! -buffer VimwikiNextLink call vimwiki#find_next_link() +command! -buffer VimwikiPrevLink call vimwiki#find_prev_link() +command! -buffer VimwikiDeleteLink call vimwiki#delete_link() +command! -buffer VimwikiRenameLink call vimwiki#rename_link() +command! -buffer VimwikiFollowLink call vimwiki#follow_link('nosplit') +command! -buffer VimwikiGoBackLink call vimwiki#go_back_link() +command! -buffer VimwikiSplitLink call vimwiki#follow_link('split') +command! -buffer VimwikiVSplitLink call vimwiki#follow_link('vsplit') command! -buffer -range VimwikiToggleListItem call vimwiki_lst#ToggleListItem(, ) @@ -227,6 +222,8 @@ exe 'command! -buffer -nargs=* VimwikiSearch vimgrep '. exe 'command! -buffer -nargs=* VWS vimgrep '. \ escape(VimwikiGet('path').'**/*'.VimwikiGet('ext'), ' ') +command! -buffer -nargs=1 VimwikiGoto call vimwiki#goto("") + " table commands command! -buffer -nargs=* VimwikiTable call vimwiki_tbl#create() command! -buffer VimwikiTableAlignQ call vimwiki_tbl#align_or_cmd('gqq') @@ -234,65 +231,69 @@ 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() +" diary commands +command! -buffer VimwikiDiaryNextDay call vimwiki_diary#goto_next_day() +command! -buffer VimwikiDiaryPrevDay call vimwiki_diary#goto_prev_day() + " COMMANDS }}} " KEYBINDINGS {{{ if g:vimwiki_use_mouse nmap nmap - noremap <2-LeftMouse> :VimwikiFollowWord - noremap :VimwikiSplitWord - noremap :VimwikiVSplitWord - noremap :VimwikiGoBackWord + noremap <2-LeftMouse> :VimwikiFollowLink + noremap :VimwikiSplitLink + noremap :VimwikiVSplitLink + noremap :VimwikiGoBackLink endif -if !hasmapto('VimwikiFollowWord') - nmap VimwikiFollowWord +if !hasmapto('VimwikiFollowLink') + nmap VimwikiFollowLink endif noremap