From 2b716f03530b448e017351170d972548bf9d9bf6 Mon Sep 17 00:00:00 2001 From: Dreaded_X Date: Thu, 27 Aug 2015 22:40:46 +0200 Subject: [PATCH] Added folding of cpp files --- nvim/.nvim/plugged/gruvbox | 2 +- nvim/.nvim/plugged/supertab | 2 +- nvim/.nvim/plugged/tcomment_vim | 2 +- nvim/.nvim/plugged/todo.txt-vim | 1 + nvim/.nvim/plugged/vim-snippets | 2 +- nvim/.nvim/plugged/vim-togglelist | 1 + nvim/.nvim/plugged/vim-unimpaired | 1 + nvim/.nvimrc | 36 +++++++++++++++++++++++++------ 8 files changed, 36 insertions(+), 11 deletions(-) create mode 160000 nvim/.nvim/plugged/todo.txt-vim create mode 160000 nvim/.nvim/plugged/vim-togglelist create mode 160000 nvim/.nvim/plugged/vim-unimpaired diff --git a/nvim/.nvim/plugged/gruvbox b/nvim/.nvim/plugged/gruvbox index 273c030..289094b 160000 --- a/nvim/.nvim/plugged/gruvbox +++ b/nvim/.nvim/plugged/gruvbox @@ -1 +1 @@ -Subproject commit 273c030ede00f3d6c54207346dabf7e35904cf57 +Subproject commit 289094bce953f98c5c871ff28492b0034ade55b5 diff --git a/nvim/.nvim/plugged/supertab b/nvim/.nvim/plugged/supertab index c8bfece..3d1af98 160000 --- a/nvim/.nvim/plugged/supertab +++ b/nvim/.nvim/plugged/supertab @@ -1 +1 @@ -Subproject commit c8bfeceb1fc92ad58f2ae6967cbfcd6fbcb0d6e7 +Subproject commit 3d1af98f5194ef30af94feaa5252c1e3e5e6967e diff --git a/nvim/.nvim/plugged/tcomment_vim b/nvim/.nvim/plugged/tcomment_vim index e0e5e41..d39c7db 160000 --- a/nvim/.nvim/plugged/tcomment_vim +++ b/nvim/.nvim/plugged/tcomment_vim @@ -1 +1 @@ -Subproject commit e0e5e4170cce6fedf543e1f7d079a4189b3a5bdf +Subproject commit d39c7dbc83c07f36cf7a3287a30a51b3dfc4a0f4 diff --git a/nvim/.nvim/plugged/todo.txt-vim b/nvim/.nvim/plugged/todo.txt-vim new file mode 160000 index 0000000..c13a277 --- /dev/null +++ b/nvim/.nvim/plugged/todo.txt-vim @@ -0,0 +1 @@ +Subproject commit c13a277e2a14b9826682ad2bac89de59b98b3c8b diff --git a/nvim/.nvim/plugged/vim-snippets b/nvim/.nvim/plugged/vim-snippets index 7f327c6..21c7f20 160000 --- a/nvim/.nvim/plugged/vim-snippets +++ b/nvim/.nvim/plugged/vim-snippets @@ -1 +1 @@ -Subproject commit 7f327c60ea3cb17432e85267e1150f28c0eae4f9 +Subproject commit 21c7f2052057304f9002b42b53391e2c89197a10 diff --git a/nvim/.nvim/plugged/vim-togglelist b/nvim/.nvim/plugged/vim-togglelist new file mode 160000 index 0000000..cafedc4 --- /dev/null +++ b/nvim/.nvim/plugged/vim-togglelist @@ -0,0 +1 @@ +Subproject commit cafedc49860950200f28f2e1d95ab6a87b79d113 diff --git a/nvim/.nvim/plugged/vim-unimpaired b/nvim/.nvim/plugged/vim-unimpaired new file mode 160000 index 0000000..1ec6af9 --- /dev/null +++ b/nvim/.nvim/plugged/vim-unimpaired @@ -0,0 +1 @@ +Subproject commit 1ec6af944e3bac5f8ccf0bfa18692a83828bde04 diff --git a/nvim/.nvimrc b/nvim/.nvimrc index 0ccca2e..05c83fc 100644 --- a/nvim/.nvimrc +++ b/nvim/.nvimrc @@ -21,13 +21,15 @@ Plug 'garbas/vim-snipmate' Plug 'honza/vim-snippets' Plug 'beyondmarc/glsl.vim' Plug 'tpope/vim-dispatch' -" Plug 'Valloric/YouCompleteMe' +Plug 'freitass/todo.txt-vim' +Plug 'tpope/vim-unimpaired' +Plug 'milkypostman/vim-togglelist' call plug#end() let g:neomake_airline=1 " let g:ctrlp_match_func = { 'match': 'pymatcher#PyMatch' } -let g:ctrlp_custom_ignore = '\v[\/](build|bin|obj)$' +let g:ctrlp_custom_ignore = '\v[\/](bin|obj)$' let delimitMate_expand_cr = 1 @@ -71,7 +73,6 @@ let g:SuperTabDefaultCompletionType = "" syntax on filetype plugin indent on -set nocp set smartindent set number set relativenumber @@ -81,16 +82,37 @@ set shiftwidth=4 set noexpandtab set completeopt-=preview +set cinkeys=0{,0},0),:,!^F,o,O,e + map :bn map :bp -map -map +map 10j +map 10k " map :make:cw map :Make map :Make debug map :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q . -map :cw -map :cn +map :call ToggleQuickfixList() +map :e ./todo/todo.txt +map :e ./todo/done.txt +map :grep -F TODO -R ./src/**/*.cpp ./include/**/*.h :cw +map :grep -F NOTE -R ./src/**/*.cpp ./include/**/*.h :cw + +function! NeatFoldText() + let line = ' ' . substitute(getline(v:foldstart), '^\s*"\?\s*\|\s*"\?\s*{{' . '{\d*\s*', '', 'g') . ' ' + let lines_count = v:foldend - v:foldstart + 1 + let lines_count_text = '| ' . printf("%10s", lines_count . ' lines') . ' |' + let foldchar = matchstr(&fillchars, 'fold:\zs.') + let foldtextstart = strpart('+' . repeat(foldchar, v:foldlevel*2) . line, 0, (winwidth(0)*2)/3) + let foldtextend = lines_count_text . repeat(foldchar, 8) + let foldtextlength = strlen(substitute(foldtextstart . foldtextend, '.', 'x', 'g')) + &foldcolumn + return foldtextstart . repeat(foldchar, winwidth(0)-foldtextlength) . foldtextend +endfunction + +set foldtext=NeatFoldText() +set foldcolumn=1 +au BufRead *.cpp setlocal foldmethod=syntax +au BufRead *.cpp setlocal foldnestmax=1