summaryrefslogtreecommitdiffstats
path: root/shell/_vimrc
blob: f91c575976d0441a9314bc545cbea48252e80fcc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
" github.com/samnang/dotfiles/blob/master/vimrc
" http://nvie.com/posts/how-i-boosted-my-vim/
" http://learnvimscriptthehardway.stevelosh.com/chapters/52.html
" May install in the future:
" Git wrapper, similar to magit: 'https://github.com/tpope/vim-fugitive'
" https://github.com/tony/vim-config
" Plugins for review:
"   'msanders/snipmate.vim'
"   'godlygeek/tabular'
"   'plasticboy/vim-markdown'

runtime bundle/vim-pathogen/autoload/pathogen.vim
execute pathogen#infect()
set nocompatible " Be iMproved
let mapleader="," " set leader early as otherwise it wouldn't work
filetype plugin indent on

" ----- general settings -----
set encoding=utf-8
set ff=unix
set number
set clipboard=unnamedplus
set showmatch " show matching brackets

set incsearch " Find as you type search
set hlsearch " Highlight search terms
set ignorecase " Case-insensitive searching.
set smartcase " But case-sensitive if expression contains a capital letter.

set history=1000 " remember more commands and search history
set undolevels=1000 " use many levels of undo

set nobackup
set noswapfile

set tabstop=4
set shiftwidth=4
set textwidth=80
set cc=81

set list
set listchars=tab:>-,trail:~

map <silent> <leader>1 :diffget 2<CR> :diffupdate<CR>
map <silent> <leader>2 :diffget 3<CR> :diffupdate<CR>
map <silent> <leader>3 :diffget 4<CR> :diffupdate<CR>

autocmd InsertEnter * :let @/=""
autocmd InsertLeave * :let @/=""

"set expandtab

map Q @
map <S-m> :tabprevious<CR>
map m :tabnext<CR>

syntax enable
set background=dark
colorscheme distinguished

" remove trailing whitespaces on save
autocmd BufWritePre * :%s/\s\+$//e

" Markdown
autocmd BufRead,BufNew *.md set filetype=markdown

" airline
set laststatus=2
let g:airline_theme = 'powerlineish'
"let g:airline#extensions#tabline#enabled = 1 " make tabs look crazy
" only enable trailing whitespace checking
let g:airline#extensions#whitespace#checks = [ 'trailing' ]
let g:airline#extensions#syntastic#enabled = 0

" Unite
nnoremap <C-p> :Unite file_rec/async<cr>

" Start interactive EasyAlign in visual mode (e.g. vip<Enter>)
vmap <Enter> <Plug>(EasyAlign)

" Start interactive EasyAlign for a motion/text object (e.g. gaip)
nmap ga <Plug>(EasyAlign)