-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
214 lines (179 loc) · 4.74 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
" ===============================================================
" @file: .vimrc
" ---------------------------------------------------------------
" @author: Zielun (http://michalzielinski.pl/)
" @details: https://github.com/Zielun/vimfiles
"
" contents:
" ---------------------
" 0. GENERAL
" 1. PLUGINS
" 2. MAPPINGS
" ================================
" 0. GENERAL
" ================================
set nocompatible
set encoding=utf-8
set fileencoding=utf-8
set visualbell
set noerrorbells
set nobackup
set noswapfile
set nowb
set autowrite "write file when switching between files
set tm=500
set backspace=2 "fix backspace
set clipboard+=unnamed
set number
set showmode
set noruler
set showmatch "showing pairs of matching bracket
set mousehide "hide cursor when typing
set wildmenu
set wildmode=list:longest
set cmdheight=2
set t_Co=256
" search
set hlsearch " highlight switch
set incsearch " show search results while typing
set ignorecase " ignore case when search
set smartcase " if capital letter turn to case-sensitive
" Text, indents
set expandtab "tabs -> spaces
set tabstop=4
set shiftwidth=4
set smarttab
set linebreak
set textwidth=500
set autoindent
set smartindent
set wrap
set showbreak=...
"
" folding
set foldmethod=indent
set foldnestmax=10
set nofoldenable "open all folds
set foldlevel=1
" set foldcolumn=3
" enable pathogen
call pathogen#infect()
call pathogen#helptags()
filetype on
filetype plugin on
filetype indent on
syntax enable
set background=dark
colorscheme ir_black
let mapleader = ","
"====================================
" 1. PLUGINS
"====================================
" let Taglist_Ctags_Cmd = "/usr/local/bin/ctags"
" NERDTree
" -----------------------------------
nmap <F2> :NERDTreeToggle<CR>
let g:NERDTreeWinSize = 35
let NERDTreeShowHidden = 1
let NERDTreeMinimalUI = 1
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
" autocmd BufWinEnter * NERDTreeFind
" MRU
nmap <F1> :MRU<CR>
let MRU_Max_Entries = 150
let MRU_Window_Height = 10
let MRU_Max_Menu_Entries = 20
let MRU_Use_Current_Window = 1
" Command-T
" -----------------------------------
" let CommandTMaxFiles = 120000
" let CommandTMaxDepth = 50
" let g:CommandTCancelMap = "<C-x>"
" CptrlP
" -----------------------------------
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
" TComment
" -----------------------------------
map <leader>c <c-_><c-_>
map <leader>C <c-_>b
" YankRing
" -----------------------------------
nnoremap <leader>p :YRShow<CR>
" Snipmate
" -----------------------------------
" au BufRead,BufNewFile *.js set ft=javascript
" au BufRead,BufNewFile *.html set ft=html
" Javascript HTML indention
" -----------------------------------
let g:html_indent_inctags = "html,body,head,tbody"
let g:html_indent_script1 = "inc"
let g:html_indent_style1 = "inc"
" Syntastic
" -----------------------------------
let g:syntastic_javascript_checkers = ["jshint"]
let g:syntastic_html_tidy_ignore_errors = ["trimming empty <span>"]
" let g:syntastic_error_symbol='!!',
" let g:syntastic_warning_symbol='~',
" Freemarker highlighting
au BufRead,BufNewFile *.ftl set filetype=ftl
au! Syntax ftl source ~/.vim/colors/ftl.vim
nnoremap ,m :w <BAR> !lessc % > %:t:r.css<CR><space>
" YouCompleteMe
" -----------------------------------
let g:ycm_add_preview_to_completeopt=0
let g:ycm_confirm_extra_conf=0
let g:ycm_min_num_of_chars_for_completion = 2
let g:ycm_collect_identifiers_from_tags_files = 1
set completeopt-=preview
" Vim Airline
" ----------------------------------
set laststatus=2
let g:bufferline_echo = 0
set noshowmode
let g:airline_mode_map = {
\ '__' : '-',
\ 'n' : 'N',
\ 'i' : 'I',
\ 'R' : 'R',
\ 'c' : 'C',
\ 'v' : 'V',
\ 'V' : 'V',
\ '' : 'V',
\ 's' : 'S',
\ 'S' : 'S',
\ '' : 'S',
\ }
" let g:airline_left_sep = '▶'
" let g:airline_right_sep = '◀'
" Bufferline
" ----------------------------
let g:bufferline_echo = 0
autocmd VimEnter *
\ let &statusline='%{bufferline#refresh_status()}'
\ .bufferline#get_status_string()
" ==========================================
" 2. MAPPINGS
" ==========================================
"disable arrow keys
" noremap <Up> ""
" noremap! <Up> <Esc>
" noremap <Down> ""
" noremap! <Down> <Esc>
" noremap <Left> ""
" noremap! <Left> <Esc>
" noremap <Right> ""
" noremap! <Right> <Esc>
" use left-right arrow keys for buffers
noremap <leader>bn :badd
noremap <right> :bn<CR>
noremap <left> :bp<CR>
" Quick jumping to split windows
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
" Clear search highlights
map <leader>/ :nohlsearch<CR>
" Save file that requires root and was opened without sudo
cmap w!! w !sudo tee % >/dev/null