Added folding of cpp files
This commit is contained in:
parent
713e0e4068
commit
2b716f0353
|
@ -1 +1 @@
|
|||
Subproject commit 273c030ede00f3d6c54207346dabf7e35904cf57
|
||||
Subproject commit 289094bce953f98c5c871ff28492b0034ade55b5
|
|
@ -1 +1 @@
|
|||
Subproject commit c8bfeceb1fc92ad58f2ae6967cbfcd6fbcb0d6e7
|
||||
Subproject commit 3d1af98f5194ef30af94feaa5252c1e3e5e6967e
|
|
@ -1 +1 @@
|
|||
Subproject commit e0e5e4170cce6fedf543e1f7d079a4189b3a5bdf
|
||||
Subproject commit d39c7dbc83c07f36cf7a3287a30a51b3dfc4a0f4
|
1
nvim/.nvim/plugged/todo.txt-vim
Submodule
1
nvim/.nvim/plugged/todo.txt-vim
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit c13a277e2a14b9826682ad2bac89de59b98b3c8b
|
|
@ -1 +1 @@
|
|||
Subproject commit 7f327c60ea3cb17432e85267e1150f28c0eae4f9
|
||||
Subproject commit 21c7f2052057304f9002b42b53391e2c89197a10
|
1
nvim/.nvim/plugged/vim-togglelist
Submodule
1
nvim/.nvim/plugged/vim-togglelist
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit cafedc49860950200f28f2e1d95ab6a87b79d113
|
1
nvim/.nvim/plugged/vim-unimpaired
Submodule
1
nvim/.nvim/plugged/vim-unimpaired
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 1ec6af944e3bac5f8ccf0bfa18692a83828bde04
|
36
nvim/.nvimrc
36
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 = "<C-X><C-O>"
|
|||
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 <silent> <tab> :bn<cr>
|
||||
map <silent> <S-tab> :bp<cr>
|
||||
|
||||
map <S-J> <pagedown>
|
||||
map <S-K> <pageup>
|
||||
map <S-J> 10j
|
||||
map <S-K> 10k
|
||||
|
||||
" map <silent> <F9> :make<cr>:cw<cr>
|
||||
map <F9> :Make<cr>
|
||||
map <F10> :Make debug<cr>
|
||||
map <F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
|
||||
|
||||
map <F4> :cw<cr>
|
||||
map <C-N> :cn<cr>
|
||||
map <silent> <F4> :call ToggleQuickfixList()<cr>
|
||||
map <silent> <F5> :e ./todo/todo.txt<cr>
|
||||
map <silent> <F6> :e ./todo/done.txt<cr>
|
||||
map <silent> <F7> :grep -F TODO -R ./src/**/*.cpp ./include/**/*.h<cr> :cw<cr>
|
||||
map <silent> <F8> :grep -F NOTE -R ./src/**/*.cpp ./include/**/*.h<cr> :cw<cr>
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user