Added toggling foldmarker

This commit is contained in:
Hunter Haugen 2011-03-13 16:30:51 -07:00
parent 8fe0d01df9
commit 8cd3eb9312

22
.vimrc
View file

@ -144,9 +144,17 @@ inoremap # X<BS>#
" Enable folds " Enable folds
if has("folding") if has("folding")
fun! ToggleFoldmethod()
if &foldmethod == "marker"
set foldmethod=syntax
else
set foldmethod=marker
endif
endfun
command! Tfdm call ToggleFoldmethod()
set foldenable set foldenable
set foldmethod=marker set foldmethod=marker
"set foldlevelstart=99 set foldlevelstart=99
endif endif
" Syntax when printing " Syntax when printing
@ -312,6 +320,7 @@ func PreviewWord()
silent! wincmd P " jump to preview window silent! wincmd P " jump to preview window
if &previewwindow " if we really get there... if &previewwindow " if we really get there...
exe "wincmd J"
if has("folding") if has("folding")
silent! .foldopen " don't want a closed fold silent! .foldopen " don't want a closed fold
endif endif
@ -319,12 +328,13 @@ func PreviewWord()
let w = substitute(w, '\\', '\\\\', "") let w = substitute(w, '\\', '\\\\', "")
call search('\<\V' . w . '\>') " position cursor on match call search('\<\V' . w . '\>') " position cursor on match
" Add a match highlight to the word at this position " Add a match highlight to the word at this position
hi previewWord term=bold ctermbg=green guibg=green hi previewWord term=bold cterm=underline gui=underline
exe 'match previewWord "\%' . line(".") . 'l\%' . col(".") . 'c\k*"' exe 'match previewWord "\%' . line(".") . 'l\%' . col(".") . 'c\k*"'
wincmd p " back to old window wincmd p " back to old window
endif endif
endif endif
endfun endfun
"----------------------------------------------------------------------- "-----------------------------------------------------------------------
" completion " completion
"----------------------------------------------------------------------- "-----------------------------------------------------------------------
@ -348,13 +358,14 @@ if has("eval")
" If we're in a wide window, enable line numbers. " If we're in a wide window, enable line numbers.
fun! <SID>WindowWidth() fun! <SID>WindowWidth()
if winwidth(0) > 90 if winwidth(0) > 90
setlocal foldcolumn=2 setlocal foldcolumn=1
setlocal number setlocal number
else else
setlocal nonumber setlocal nonumber
setlocal foldcolumn=0 setlocal foldcolumn=0
endif endif
endfun endfun
autocmd VimEnter * :call <SID>WindowWidth()
endif endif
" content creation " content creation
@ -635,8 +646,9 @@ inoremap <C-z>q <C-o>gq}<C-o>k<C-o>$
"nmap <F5> <C-w>c "nmap <F5> <C-w>c
"nmap <F6> :exec "make check TESTS_ENVIRONMENT=true LOG_COMPILER=true XFAIL_TESTS="<CR> "nmap <F6> :exec "make check TESTS_ENVIRONMENT=true LOG_COMPILER=true XFAIL_TESTS="<CR>
"nmap <Leader><F6> :exec "make -C " . expand("%:p:h") . " check TESTS_ENVIRONMENT=true LOG_COMPILER=true XFAIL_TESTS="<CR> "nmap <Leader><F6> :exec "make -C " . expand("%:p:h") . " check TESTS_ENVIRONMENT=true LOG_COMPILER=true XFAIL_TESTS="<CR>
nmap <F7> :make all-then-check<CR> "nmap <F7> :make all-then-check<CR>
nmap <Leader><F7> :exec "make -C " . expand("%:p:h") . " check"<CR> map <F7> :Tfdm<CR>
"nmap <Leader><F7> :exec "make -C " . expand("%:p:h") . " check"<CR>
nmap <F8> :make<CR> nmap <F8> :make<CR>
nmap <Leader><F8> :exec "make -C " . expand("%:p:h")<CR> nmap <Leader><F8> :exec "make -C " . expand("%:p:h")<CR>
"nmap <F9> :exec "make -C " . expand("%:p:h") . " check SUBDIRS= check_PROGRAMS=" . GetCurrentTest() "nmap <F9> :exec "make -C " . expand("%:p:h") . " check SUBDIRS= check_PROGRAMS=" . GetCurrentTest()