summaryrefslogtreecommitdiffstats
path: root/shell/_vimrc
blob: 5e83a3999b3d1232740723988181c7678fb725d6 (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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
" 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'

let mapleader="," " set leader early as otherwise it wouldn't work

" ----- NeoBundle -----
let reinstall=0
if !filereadable(expand('~/.vim/bundle/neobundle.vim/README.md'))
	" if vundle isn't currently installed
	silent !git clone https://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim
	let reinstall=1
endif

if has('vim_starting')
	if &compatible
		set nocompatible " Be iMproved
	endif

	set runtimepath+=/home/xramses/.vim/bundle/neobundle.vim/
endif

call neobundle#begin(expand('/home/xramses/.vim/bundle'))

" Let NeoBundle manage NeoBundle
NeoBundleFetch 'Shougo/neobundle.vim'

" Add or remove your Bundles here:
NeoBundle 'Shougo/vimproc.vim', {
\ 'build' : {
\     'windows' : 'tools\\update-dll-mingw',
\     'cygwin' : 'make -f make_cygwin.mak',
\     'mac' : 'make -f make_mac.mak',
\     'linux' : 'make',
\     'unix' : 'gmake',
\    },
\ }
NeoBundle 'Lokaltog/vim-distinguished'
NeoBundle 'xolox/vim-reload'
NeoBundle 'xolox/vim-misc'
NeoBundle 'Shougo/unite.vim'
NeoBundle 'bling/vim-airline'
NeoBundle 'scrooloose/syntastic'
NeoBundle 'scrooloose/nerdcommenter'
NeoBundle 'tpope/vim-surround'
"NeoBundle 'msanders/snipmate.vim'
NeoBundle 'davidhalter/jedi-vim'
NeoBundle 'wting/rust.vim'
"NeoBundle 'godlygeek/tabular'
"NeoBundle 'plasticboy/vim-markdown'

call neobundle#end()

filetype plugin indent on

" If there are uninstalled bundles found on startup,
" this will conveniently prompt you to install them.
NeoBundleCheck

" ----- 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>

if !has('clipboard')
	echo "Clipboard not supported!"
endif