forked from borisd/vimrc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
200 lines (150 loc) · 5.13 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
set nocompatible
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchBufs = 1
runtime! autoload/pathogen.vim
if exists('g:loaded_pathogen')
call pathogen#runtime_prepend_subdirectories(expand('~/.vim/bundles'))
end
syntax on
filetype plugin indent on
filetype plugin on
"set completeopt=menuone,preview,longest
set completeopt=menuone,preview
"inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
" Omni completion settings
set ofu=syntaxcomplete#Complete
let g:rubycomplete_buffer_loading = 0
let g:rubycomplete_classes_in_global = 1
" completing Rails hangs a lot
"let g:rubycomplete_rails = 1
" syntastic
let g:syntastic_enable_signs=1
let bash_is_sh=1
set cinoptions=:0,(s,u0,U1,g0,t0
set modelines=5
set tags=tags;/
set laststatus=2
" default:
" set statusline=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P
"set statusline=%<%f\ %h%m%r%#warningmsg#%{SyntasticStatuslineFlag()}%*%=%-14.(%l,%c%V%)\ %P
" highlihgt the file name
hi User1 term=bold,reverse cterm=bold ctermfg=4 ctermbg=2 gui=bold guifg=Blue guibg=#44aa00
" set statusline=%<%1*%f%*\ %h%m%r%#warningmsg#%{SyntasticStatuslineFlag()}%*%=%-14.(%l,%c%V%)\ %P
"set cuc
"set cul
set number
"fixdel
" prevent vim from adding that stupid empty line at the end of every file
set noeol
set binary
"Ignore these files when completing names and in Explorer
set wildignore=.svn,CVS,.git,.hg,*.o,*.a,*.class,*.mo,*.la,*.so,*.obj,*.swp,*.jpg,*.png,*.xpm,*.gif
hi SpellErrors guibg=red guifg=black ctermbg=red ctermfg=black
set backupdir=~/.backup,.
set directory=~/.backup,~/tmp,.
" enable showmmarks
let g:showmarks_enable = 1
hi! link ShowMarksHLl LineNr
hi! link ShowMarksHLu LineNr
hi! link ShowMarksHLo LineNr
hi! link ShowMarksHLm LineNr
" Make
:command -nargs=* Make make <args> | cwindow 3
let mapleader = ","
" Don't use Ex mode, use Q for formatting
map Q gq
" highlight trailing whitespace
set listchars=tab:▷⋅,trail:·,eol:$
nmap <silent> <leader>s :set nolist!<CR>
" extended '%' mapping for if/then/else/end etc
runtime macros/matchit.vim
" Make shift-insert work like in Xterm
map <S-Insert> <MiddleMouse>
map! <S-Insert> <MiddleMouse>
" Ctrl-N to disable search match highlight
nmap <silent> <C-N> :silent noh<CR>
" Ctrol-E to switch between 2 last buffers
nmap <C-6> :b#<CR>
" Ctrl-P to Display the file browser tree
nmap <C-P> :NERDTreeToggle<CR>
" ,p to show current file in the tree
nmap <leader>p :NERDTreeFind<CR>
" ,/ to invert comment on the current line/selection
nmap <leader>/ :call NERDComment(0, "invert")<cr>
vmap <leader>/ :call NERDComment(0, "invert")<cr>
" ,t to show tags window
let Tlist_Show_Menu=1
nmap <leader>t :TlistToggle<CR>
" ,e to fast finding files. just type beginning of a name and hit TAB
nmap <leader>e :e **/
" ,f to fast finding files using fuzzy finder.
nmap <leader>f :FufFile **/<CR>
" ,b to display current buffers list
let g:miniBufExplVSplit = 25
let g:miniBufExplorerMoreThanOne = 100
let g:miniBufExplUseSingleClick = 1
let g:miniBufExplSplitToEdge = 0
nmap <C-b> :MiniBufExplorer<cr>
let g:Conque_Read_Timeout = 50 " timeout for waiting for command output.
let g:Conque_TERM = 'xterm'
" ,sh to open vimshell window
nmap <Leader>sh :ConqueSplit bash<cr>
" ,r to open vimshell window
nmap <Leader>r :ConqueSplit
" map ,y to show the yankring
nmap <leader>y :YRShow<cr>
if has("mouse")
set mouse=a
endif
let g:yankring_replace_n_pkey = '<leader>['
let g:yankring_replace_n_nkey = '<leader>]'
set shell=/bin/bash
set tabstop=2
set shiftwidth=2
set expandtab
nnoremap / /\v
vnoremap / /\v
set textwidth=0 " Do not wrap words (insert)
set nowrap " Do not wrap words (view)
set showcmd " Show (partial) command in status line.
set showmatch " Show matching brackets.
set ignorecase " Do case insensitive matching
set smartcase " do not ignore if search pattern has CAPS
set incsearch " Incremental search
set autowriteall " Automatically save before commands like :next and :make
set hlsearch " Highlight search match
set hidden " enable multiple modified buffers
set nobackup " do not write backup files
set foldcolumn=2 " columns for folding
set foldmethod=indent
set foldlevel=300
set history=1000
set wildmenu
set ruler
" set visualbell
set gdefault " Search&Replace includes /g by default
au FocusLost * :wa " Auto save when losing focus
nnoremap <leader>W :%s/\s\+$//<cr>:let @/=''<CR>
nnoremap <leader>ft Vatzf " Fold block
nnoremap <leader>w <C-w>v<C-w>l " Open vertical split
nnoremap <C-h> <C-w>h " Navigate splits
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
nnoremap <silent> <F3> :YRShow<cr> " For the yanking plugin
inoremap <silent> <F3> <ESC>:YRShow<cr>
nmap <leader>e :CommandT<CR>
nmap <leader>E :CommandTFlush<CR>
" insert blank lines staying in normal mode
nmap <leader>o :put=''<CR>
nmap <leader>O :put!=''
" set relativenumber
set colorcolumn=85
set undofile " Create an unfo files to undos work across closes
" tabs to spaces
set bs=2
set sw=2
set background=dark
colorscheme darkdevel
" fix backspace not deleting lines
set backspace=indent,eol,start