From 226a91e5a617f2a77177f347bef76f75eb7ac47f Mon Sep 17 00:00:00 2001 From: Sonny Date: Wed, 17 May 2017 11:18:57 +0200 Subject: [PATCH] Folding --- vim/.vimrc | 52 +++++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/vim/.vimrc b/vim/.vimrc index c676b5b..795bdd2 100755 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -5,6 +5,7 @@ Plug 'https://github.com/vim-airline/vim-airline' Plug 'https://github.com/vim-airline/vim-airline-themes' Plug 'https://github.com/powerline/fonts' Plug 'https://github.com/tpope/vim-fugitive' +Plug 'https://github.com/Yggdroot/indentLine' "Indent automiatically depending on filetype filetype plugin on @@ -17,11 +18,12 @@ syntax enable " Create the `tags` file (may need to install ctags first) command! MakeTags !ctags -R . -" Tab indentation -set shiftwidth=4 tabstop=4 softtabstop=4 expandtab +" 4 spaces instead of tabs indentation +set shiftwidth=4 tabstop=4 softtabstop=4 expandtab -"End IDE specific options -"<--------------------------------------------------------------------------> +" Fold methods based on indents +" zo to open folds, zc to close +set foldmethod=indent " FINDING FILES @@ -80,16 +82,16 @@ set laststatus=2 "Space in toolbar is "%=\ "set statusline= -"set statusline+=%1*\ %n\ "Buffernr -"set statusline+=%1*\ %F\ %m%r%w "File + modified/readonly -"set statusline+=%1*\ %= "Space between filename -"set statusline+=%1*\ %{hostname()}\ "Hostname -"set statusline+=%1*\ %{strlen(&ft)?&ft:'none'}\ "Filetype -"set statusline+=%1*\ %{''.(&fenc!=''?&fenc:&enc).''} "Encoding -"set statusline+=%1*\ %{(&bomb?\",BOM\":\"\")}\ "Encoding2 -"set statusline+=%1*\ %{&ff}\ "FileFormat (dos/unix..) -"set statusline+=%1*\ %l/%L\ \ "Rownumber/total (%) -"set statusline+=%1*\ %P\ "Readonly? Top/bot +"set statusline+=%1*\ %n\ "Buffernr +"set statusline+=%1*\ %F\ %m%r%w "File + modified/readonly +"set statusline+=%1*\ %= "Space between filename +"set statusline+=%1*\ %{hostname()}\ "Hostname +"set statusline+=%1*\ %{strlen(&ft)?&ft:'none'}\ "Filetype +"set statusline+=%1*\ %{''.(&fenc!=''?&fenc:&enc).''} "Encoding +"set statusline+=%1*\ %{(&bomb?\",BOM\":\"\")}\ "Encoding2 +"set statusline+=%1*\ %{&ff}\ "FileFormat (dos/unix..) +"set statusline+=%1*\ %l/%L\ \ "Rownumber/total (%) +"set statusline+=%1*\ %P\ "Readonly? Top/bot "Statusbar colors "hi User1 ctermbg=237 @@ -101,21 +103,21 @@ vnoremap c "+c "Built-in completion function! Smart_TabComplete() - let line = getline('.') " current line - let substr = strpart(line, -1, col('.')+1) " from the start of the current - " of the cursor - let substr = matchstr(substr, "[^ \t]*$") " word till cursor - if (strlen(substr)==0) " nothing to match on empty string - return "\" + let line = getline('.') " current line + let substr = strpart(line, -1, col('.')+1) " from the start of the current + " of the cursor + let substr = matchstr(substr, "[^ \t]*$") " word till cursor + if (strlen(substr)==0) " nothing to match on empty string + return "\" endif - let has_period = match(substr, '\.') != -1 " position of period, if any - let has_slash = match(substr, '\/') != -1 " position of slash, if any + let has_period = match(substr, '\.') != -1 " position of period, if any + let has_slash = match(substr, '\/') != -1 " position of slash, if any if (!has_period && !has_slash) - return "\\" " existing text matching + return "\\" " existing text matching elseif ( has_slash ) - return "\\" " file matching + return "\\" " file matching else - return "\\" " plugin matching + return "\\" " plugin matching endif endfunction inoremap =Smart_TabComplete()