set nocompatible
filetype plugin indent on
-syntax enable
+syntax on
" Use :help 'option' to see the documentation for the given option.
-set shell=/bin/bash
-if has("win32")
- set shell=cmd
- set shellcmdflag=/c
-endif
-set path=.,,**
-set sessionoptions-=options
-
-" keyboard
-set backspace=indent,eol,start
-let mapleader = ","
-set ttimeoutlen=10
-set winaltkeys=no
-set mouse=a
-set mousemodel=extend
-set noerrorbells
-set visualbell
-
-" colors and fonts
-set t_Co=256
-set background=dark
-highlight LineNr ctermfg=grey
-let &t_ti.="\e[1 q"
-let &t_SI.="\e[5 q"
-let &t_EI.="\e[1 q"
-let &t_te.="\e[0 q"
-
-" files
-set fileformats=unix,dos,mac
-set fileignorecase
-setglobal tags-=./tags tags-=./tags; tags^=./tags;
-
-" copy and paste
-set virtualedit=block
-set clipboard=unnamed
-
-" format
-set formatoptions+=j
-set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+
-" buffers
-silent !mkdir -p ~/.vim/undo
-set undofile
-set undodir=~/.vim/undo
-set viminfo+=n~/.vim/viminfo
-set nohidden
-set nobackup
-set noswapfile
-set autoread
-set autowrite
-set autowriteall
-
-" indent
+" indenting
set autoindent
+set copyindent
set smarttab
+set nolinebreak
+set breakindent
set breakindent showbreak=\ +
-set linebreak
set shiftround
+set formatoptions+=j
+set wrap
-" search
+" searching
set incsearch
set hlsearch
set ignorecase
set smartcase
set showmatch
+set wrapscan
set complete-=i
+set virtualedit=block
+set clipboard=unnamed
-" scroll
+" display
set scrolloff=1
set sidescrolloff=5
set display+=lastline
set lazyredraw
set number
set relativenumber
+set titlestring=vim:\ %f
-" fold
+" folding
set foldmethod=syntax
+set foldopen+=jump,search
set foldlevel=1
set foldclose=all
-set foldopen+=jump,search
-" command line
-set wildmenu
-set wildmode=longest:full,full
-set wildignore+=tags,*.pyc,*.jpg,*.png,*.gif
+" keyboard and mouse
+set backspace=indent,eol,start
+set ttimeoutlen=10
+set winaltkeys=no
+set mouse=a
+set mousemodel=popup
+set noerrorbells
+set visualbell
+let mapleader = ","
+set pastetoggle=<leader>p
+
+" command/status line
+set showmode
set showcmd
set ruler
set laststatus=2
set cmdheight=2
-set shortmess=aoOtI
+set shortmess=aoOTI
+set wildmenu
+set wildmode=longest:full,full
+set wildignore+=tags,*.pyc,*.jpg,*.png,*.gif,*.zip
+set wildoptions=tagfile
+
+" buffers
+set hidden
+set autoread
+set noautowrite
+set noautowriteall
+
+" temporary files
+silent !mkdir -p ~/.vim/undo
+set nobackup
+set noswapfile
+set undofile
+set undodir=~/.vim/undo
+set viminfo+=n~/.vim/viminfo
+set sessionoptions-=options
set history=1000
+setglobal tags-=./tags tags-=./tags; tags^=./tags;
+
+" system
+set path=.,,**
+set shell=/bin/bash
+if has("win32")
+ set shell=cmd
+ set shellcmdflag=/c
+endif
+set fileformats=unix,dos,mac
+set fileignorecase
+
+" colors and fonts
+set t_Co=256
+set background=dark
+highlight LineNr ctermfg=grey
+set list
+if has('multi_byte') && &encoding ==# 'utf-8'
+ let &listchars = 'tab:▸ ,extends:❯,precedes:❮,nbsp:±'
+else
+ let &listchars = 'tab:> ,extends:>,precedes:<,nbsp:.'
+endif
+set cursorline
+let &t_ti.="\e[1 q"
+let &t_SI.="\e[5 q"
+let &t_EI.="\e[1 q"
+let &t_te.="\e[0 q"
" grep
set grepprg=ag\ --vimgrep\ --skip-vcs-ignores\ --path-to-ignore\ ~/.ignore\ --cpp\ --cc
let g:editorconfig_verbose = 1
let g:editorconfig_core_mode = "python_builtin"
+
" CtrlP
packadd ctrlp.vim
let g:ctrlp_map = '<Leader>p'
packadd matchit
" Normal mode Mappings
+nnoremap ; :
+nnoremap : ;
nnoremap <c-h> <c-w><c-h>
nnoremap <c-j> <c-w><c-j>
nnoremap <c-k> <c-w><c-k>
cnoreabbrev w!! w !sudo tee "%"
" Autocommands
-augroup filetype
- au!
- au bufnewfile,buffilepre,bufread *.md set filetype=markdown
- au bufnewfile,buffilepre,bufread *.gradle set filetype=groovy
- au bufnewfile,buffilepre,bufread *.json set filetype=json
- au bufnewfile,buffilepre,bufread *.yml set filetype=yaml
-augroup END
-
-augroup saveall
- au!
- au focuslost * wall
-augroup END
-
-augroup numbertoggle
- au!
- au bufenter,focusgained,insertleave * set relativenumber
- au bufleave,focuslost,insertenter * set norelativenumber
-augroup END
-
-augroup vimrc
- au!
- au bufwritepost ~/.vim/gvimrc source %
- au bufwritepost ~/.vim/vimrc source %
- au bufwritepost ~/.vim/vimrc.local source %
-augroup END
+if has('autocmd')
+ augroup filetype
+ au!
+ au bufnewfile,buffilepre,bufread *.md set filetype=markdown
+ au bufnewfile,buffilepre,bufread *.gradle set filetype=groovy
+ au bufnewfile,buffilepre,bufread *.json set filetype=json
+ au bufnewfile,buffilepre,bufread *.yml set filetype=yaml
+ augroup END
+
+ augroup saveall
+ au!
+ au focuslost * wall
+ augroup END
+
+ augroup numbertoggle
+ au!
+ au bufenter,focusgained,insertleave * set relativenumber
+ au bufleave,focuslost,insertenter * set norelativenumber
+ augroup END
+
+ augroup vimrc
+ au!
+ au bufwritepost ~/.vim/gvimrc source %
+ au bufwritepost ~/.vim/vimrc source %
+ au bufwritepost ~/.vim/vimrc.local source %
+ augroup END
+endif
" local settings
if filereadable(expand('~/.vim/vimrc.local'))