" pathogen.vim runtime path manipulation
silent! call pathogen#infect()
-" search {{{
+" search {{{1
set incsearch
set ignorecase
set smartcase
set hlsearch
nmap <Leader>q :nohl<CR>
-" }}}
-" NERDTree {{{
+" NERDTree {{{1
" open/close NERDTree with \e
nmap <Leader>e :NERDTreeToggle<CR>
" <space> to open files/dirs
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 <Leader>b :set expandtab tabstop=4 shiftwidth=4 softtabstop=4<CR>
:nmap <Leader>B :set expandtab tabstop=8 shiftwidth=8 softtabstop=4<CR>
:nmap <Leader>M :set noexpandtab tabstop=8 softtabstop=4 shiftwidth=4<CR>
:nmap <Leader>m :set expandtab tabstop=2 shiftwidth=2 softtabstop=2<CR>
-" }}}
-" 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
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
" Press `` to toggle insert and replace mode (no <Insert> key on Mac keyboard)
imap `` <Insert>
-" }}}
-" paste toggle {{{
+" paste toggle {{{1
nmap <F11> :set paste! paste?<CR>
imap <F11> <C-o>:set paste!<CR>
vmap <F11> <Esc>:set paste!<CR>gv
set pastetoggle=<F11>
-" }}}
-" mouse {{{
+" mouse {{{1
" In many terminal emulators the mouse works just fine, thus enable it.
if has('mouse')
"xterm mouse with middleclick paste
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.
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.
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
" 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.
"
onoremap <silent> ]l :call NextIndent(0, 1, 0, 1)<CR>
onoremap <silent> [L :call NextIndent(1, 0, 1, 1)<CR>
onoremap <silent> ]L :call NextIndent(1, 1, 1, 1)<CR>
-" end of jump indent }}}
+" end of jump indent