-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
159 lines (139 loc) · 4.57 KB
/
.vimrc
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
set nocompatible
set t_Co=16
"
" -----------------------------------------
" Pathogen init
" -----------------------------------------
runtime bundle/vim-pathogen/autoload/pathogen.vim
execute pathogen#infect()
" -----------------------------------------
" General vim configuration
" -----------------------------------------
syntax on
filetype on
filetype plugin on
filetype plugin indent on
set number
set wildmenu
"colorscheme vitamins
set background=dark
colorscheme solarized
" Search config
set incsearch
set hlsearch
" 4 spaces for indent and display tabs and trailing spaces
set expandtab
set tabstop=4
set shiftwidth=4
set softtabstop=4
set list lcs=tab:>-,trail:.
" Fold config
" Don't change folds while inserting text, until leaving insert mode
" Protect against this when switching between windows
" autocmd InsertEnter * if !exists('w:last_fdm') | let w:last_fdm=&foldmethod | setlocal foldmethod=manual | endif
" autocmd InsertLeave,WinLeave * if exists('w:last_fdm') | let &l:foldmethod=w:last_fdm | unlet w:last_fdm | endif
set foldlevelstart=99
set foldlevel=99
" -----------------------------------------
" Bindings
" -----------------------------------------
nnoremap <F2> :set nonumber!<CR>:set foldcolumn=0<CR>
map <F3> :set filetype=python<CR>
" Toggle autoindent on paste with F4
nnoremap \tp :set invpaste paste?<CR>
nmap <F4> \tp
imap <F4> <C-O>\tp
set pastetoggle=<F4>
map <F6> :set foldlevel=99<CR>
map <F7> :set foldlevel=1<CR>
map <F8> :split ~/.vim/TODO<CR>
map <F9> :w \| SyntasticCheck<CR>
map <F12> :cn<CR>
" Change window with control + direction
map <c-Down> <c-w>j
map <c-Up> <c-w>k
map <c-Right> <c-w>l
map <c-Left> <c-w>h
" -----------------------------------------
" -----------------------------------------
" Language specific stuff
" -----------------------------------------
" -----------------------------------------
"
" Docstrings
" -----------------------------------------
" docblock comments are continued when a newline is inserted
set comments=sr:/*,mb:*,ex:*/
"
"
" -----------------------------------------
" PHP
" -----------------------------------------
let php_oldStyle = 1
" check syntax with Ctrl + L
autocmd FileType php noremap <C-L> :!/usr/bin/env php -l %<CR>
autocmd FileType phtml noremap <
" -----------------------------------------
" HTML
" -----------------------------------------
autocmd FileType html setlocal shiftwidth=2 tabstop=2
autocmd FileType htmldjango setlocal shiftwidth=2 tabstop=2
" ----------------------------------------
" Additional commands
" ----------------------------------------
" Nice grep with .git & tags exclusion
command -nargs=1 Grep grep -RnIo --exclude-dir=.git --exclude=tags <args> .
" Nice grep with .git & tags exclusion, only for Python files
command -nargs=1 PyGrep grep -RnIo --include='*.py' --exclude-dir=.git --exclude=tags <args> .
" Plugins settings
" ----------------------------------------
" ----------------------------------------
"
" Powerline
" ----------------------------------------
set nocompatible "disable vi compatibility
set laststatus=2 " always show statusline
set encoding=utf-8 " show unicode glyphs
"
" Airline
" ----------------------------------------
let g:airline_theme='solarized'
let g:airline_left_sep = '▶'
let g:airline_right_sep = '◀'
let g:airline_linecolumn_prefix = ' '
let g:airline_branch_prefix = '⎇ '
let g:airline_paste_symbol = 'ρ'
" Faster rendering when leaving escape mode
set ttimeoutlen=50
" Disable default mode indicator
set noshowmode
" Git integration
let g:airline_enable_branch=1
" syntastic integration
let g:airline_enable_syntastic=1
" Syntax checking plugins & config
" ----------------------------------------
"let g:pyflakes_use_quickfix = 0 Pyflakes disabled in favor of syntastic
let g:syntastic_javascript_checkers=['jshint']
let g:syntastic_python_checkers=['pylint']
" Disable some pylint checks
" Configure pylint check
" See
" https://github.com/kmmbvnr/django-jenkins/blob/master/django_jenkins/tasks/pylint.rc
" for details.
let g:syntastic_python_pylint_args="-f parseable -r n --rcfile=~/.pylint.rc"
let g:syntastic_mode_map={'mode': 'passive'}
" slime config
let g:slime_target = "tmux"
let b:slime_config = {"socket_name": "default", "target_pane": ":.+1"}
let g:slime_paste_file="~/.tmux_slime_paste_file"
let g:slime_python_ipython=1
" Unite.vim config
nnoremap <C-p> :Unite -start-insert file_rec/async<cr>
let g:unite_source_grep_default_opts = ' -Hn'
nnoremap <space>/ :Unite grep:.<cr>
let g:unite_source_history_yank_enable = 1
nnoremap <space>y :Unite history/yank<cr>
" Pydoc config
let g:pydoc_open_cmd = 'tabnew'
let g:pydoc_highlight = 0