From: Samir Benmendil Date: Wed, 16 Oct 2013 06:37:56 +0000 (+0200) Subject: use level folds X-Git-Url: https://git.rmz.io/dotfiles.git/commitdiff_plain/ced2503ba7d51b1e898512c9bfa37d6d1cbb2ba5 use level folds looks a bit cleaner to me --- diff --git a/vimrc b/vimrc index 5ed5e5b..55906d8 100644 --- a/vimrc +++ b/vimrc @@ -14,15 +14,14 @@ set nocompatible " pathogen.vim runtime path manipulation silent! call pathogen#infect() -" search {{{ +" search {{{1 set incsearch set ignorecase set smartcase set hlsearch nmap q :nohl -" }}} -" NERDTree {{{ +" NERDTree {{{1 " open/close NERDTree with \e nmap e :NERDTreeToggle " to open files/dirs @@ -31,37 +30,32 @@ let NERDTreeMapActivateNode='' autocmd vimenter * if !argc() | NERDTree | endif " close vim if only NERDTree is open autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif -" }}} -" airline {{{ +" airline {{{1 let g:airline#extensions#tabline#enabled = 1 -" }}} -" tabbing {{{ +" tabbing {{{1 :nmap b :set expandtab tabstop=4 shiftwidth=4 softtabstop=4 :nmap B :set expandtab tabstop=8 shiftwidth=8 softtabstop=4 :nmap M :set noexpandtab tabstop=8 softtabstop=4 shiftwidth=4 :nmap m :set expandtab tabstop=2 shiftwidth=2 softtabstop=2 -" }}} -" backup {{{ +" backup {{{1 if has("vms") set nobackup " do not keep a backup file, use versions instead else set backup " keep a backup file set backupdir=$HOME/.vim/backupdir endif -" }}} -" appearance {{{ +" appearance {{{1 set background=dark " Dark background, d'uh! set number " show some linenumbers set showmatch " Show matching brackets. set showbreak=▒▒ " show these chars for wrapped lines set list listchars=tab:»·,trail:· " show these chars for tabs and trailing spaces -" }}} -" misc options {{{ +" misc options {{{1 set history=500 " keep 500 lines of command line history set ruler " show the cursor position all the time set confirm " Ask what to do when closing unsaved documents @@ -73,15 +67,13 @@ set scrolloff=5 " keep at least n lines above/below set backspace=indent,eol,start " allow backspacing over everything in insert mode set viminfo='100,<50,s10,h,n~/.vim/viminfo " viminfo defaults but save file in .vim -" }}} -" tabs {{{ +" tabs {{{1 set softtabstop=4 set shiftwidth=4 set expandtab -" }}} -" misc bindings {{{ +" misc bindings {{{1 " Don't use Ex mode, use Q for formatting map Q gq @@ -91,16 +83,14 @@ inoremap u " Press `` to toggle insert and replace mode (no key on Mac keyboard) imap `` -" }}} -" paste toggle {{{ +" paste toggle {{{1 nmap :set paste! paste? imap :set paste! vmap :set paste!gv set pastetoggle= -" }}} -" mouse {{{ +" mouse {{{1 " In many terminal emulators the mouse works just fine, thus enable it. if has('mouse') "xterm mouse with middleclick paste @@ -111,17 +101,15 @@ if has('mouse') set ttymouse=xterm "set ttymouse=xterm2 endif -" }}} -" syntax {{{ +" syntax {{{1 " Switch syntax highlighting on, when the terminal has colors " Also switch on highlighting the last used search pattern. if &t_Co > 2 || has("gui_running") syntax on endif -" }}} -" autocmd {{{ +" autocmd {{{1 " Only do this part when compiled with support for autocommands. if has("autocmd") " Enable file type detection. @@ -152,9 +140,9 @@ if has("autocmd") augroup END else set autoindent " always set autoindenting on -endif " has("autocmd") }}} +endif " has("autocmd") -" DiffOrig {{{ +" DiffOrig {{{1 " Convenient command to see the difference between the current buffer and the " file it was loaded from, thus the changes you made. " Only define it when not defined already. @@ -162,9 +150,8 @@ if !exists(":DiffOrig") command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis \ | wincmd p | diffthis endif -" }}} -" fold {{{ +" fold {{{1 set foldmethod=marker set foldlevelstart=99 " space will toggle current fold in normal mode, if not in a fold, normal @@ -174,9 +161,8 @@ vnoremap zf " save and restore folds autocmd BufWinLeave *.* mkview autocmd BufWinEnter *.* silent loadview -" }}} -function! NextIndent(exclusive, fwd, lowerlevel, skipblanks) " {{{ +function! NextIndent(exclusive, fwd, lowerlevel, skipblanks) " {{{1 " Jump to the next or previous line that has the same level or a lower " level of indentation than the current line. " @@ -222,4 +208,4 @@ onoremap [l :call NextIndent(0, 0, 0, 1) onoremap ]l :call NextIndent(0, 1, 0, 1) onoremap [L :call NextIndent(1, 0, 1, 1) onoremap ]L :call NextIndent(1, 1, 1, 1) -" end of jump indent }}} +" end of jump indent