forked from galulex/vim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vimrc
More file actions
187 lines (167 loc) · 5.39 KB
/
.vimrc
File metadata and controls
187 lines (167 loc) · 5.39 KB
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
call plug#begin('~/.vim/plugged')
" Plugins
Plug 'kchmck/vim-coffee-script'
Plug 'slim-template/vim-slim'
Plug 'pangloss/vim-javascript'
Plug 'briancollins/vim-jst'
Plug 'avakhov/vim-yaml'
Plug 'greyblake/vim-preview'
Plug 'bling/vim-airline'
Plug 'Raimondi/delimitMate'
Plug 'hail2u/vim-css3-syntax'
Plug 'JulesWang/css.vim'
Plug 'cakebaker/scss-syntax.vim'
Plug 'ryanoasis/vim-webdevicons'
Plug 'othree/html5-syntax.vim'
Plug 'othree/html5.vim'
Plug 'ap/vim-css-color'
Plug 'itchyny/calendar.vim'
Plug 'ntpeters/vim-airline-colornum'
" Plug 'Shougo/unite.vim'
" Plug 'airblade/vim-gitgutter'
Plug 'KabbAmine/vCoolor.vim'
Plug 'scrooloose/syntastic'
"
Plug 'MarcWeber/vim-addon-mw-utils'
Plug 'tomtom/tlib_vim'
Plug 'activebridge/rails-snippets'
Plug 'honza/vim-snippets'
Plug 'p0deje/vim-ruby-interpolation'
Plug 'terryma/vim-multiple-cursors'
" Plug 'ervandew/supertab'
" Plug 'svermeulen/vim-easyclip'
Plug 'tpope/vim-rails'
Plug 'tpope/vim-endwise'
Plug 'tpope/vim-ragtag'
Plug 'tpope/vim-haml'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-fugitive'
Plug 'vtreeexplorer'
Plug 'grep.vim'
Plug 'EasyGrep'
Plug 'LargeFile'
Plug 'L9'
Plug 'FuzzyFinder'
Plug 'Toggle'
Plug 'surround.vim'
Plug 'yaml.vim'
Plug 'rainbow-end'
Plug 'vim-qf'
call plug#end()
" Vim
colo railscasts " Theme
set expandtab ts=2 sw=2 ai " Two spaces insted tab
set showtabline=2 " Always shows tabs on top
set backspace=indent,eol,start " Intuitive backspacing.
set incsearch " Highlight matches as you type.
set hlsearch " Highlight matches.
set scrolloff=10 " Show 3 lines of context around the cursor.
set visualbell " No beeping.
set nobackup " Don't make a backup before overwriting a file.
set nowritebackup " And again.
set noswapfile " Disable swp files
set shortmess=filmnrxtTI " Disble intro message
set nohidden " Remove the buffer after tab close
set novisualbell
set list
set listchars=trail:• " Show spaces in end of line
set autoread " Update open files when changed externally
set relativenumber " Set relative line numbers
" set iskeyword-=_ " Underscore brakes the word
set laststatus=2
set re=1
set ttyfast
set lazyredraw
set nocursorcolumn
set nocursorline
syntax sync minlines=256
set synmaxcol=160
" set clipboard=unnamed
" set noballooneval
filetype plugin on " Turn on file type detection.
filetype indent on " Turn on file indent detection.
set tags=tmp/
autocmd BufWritePre *.* :%s/\s\+$//e
" autocmd BufWritePre {*.rb,*.js,*.coffee,*.scss,*.haml,*.slim,*.erb,*.css,*.html,*.yml} :%s/\s\+$//e
map <C-s> :w<cr>
map <S-r> :%s/:\(\w\+\)\(\s*=>\s*\)/\1: /g<cr>
imap <C-s> <ESC>:w<cr>
map <C-a> <esc>ggVG<end>
vnoremap < <gv
vnoremap > >gv
cmap w!! %!sudo tee > /dev/null %
" autocmd! bufwritepost .vimrc nested source %
inoremap <c-x><c-]> <c-]>
let g:webdevicons_enable_nerdtree = 0
let g:webdevicons_enable_airline_statusline = 1
let g:webdevicons_enable_airline_tabline = 1
" Bubble single&multiple lines
vnoremap <C-Up> <esc>`<gv:m '<-2<cr>gv
vnoremap <C-Down> <esc>`>gv:m '>+1<cr>gv
nnoremap <C-Up> mz:m-2<cr>`z
nnoremap <C-Down> mz:m+<cr>`z
" Tabs
nnoremap <C-S-tab> :tabprevious<CR>
nnoremap <C-tab> :tabnext<CR>
nnoremap <C-t> :tabnew<CR>
nnoremap <C-e> :q!<CR>
inoremap <C-S-tab> <Esc>:tabprevious<CR>i
inoremap <C-tab> <Esc>:tabnext<CR>i
inoremap <C-t> <Esc>:tabnew<CR>
inoremap <C-e> <Esc>:q!<CR>i
"VSTreeExplorer
let treeExplVertical=1
let treeExplDirSort=1
let treeExplWinSize=40
command E VSTreeExplore
" Rgrep
map <C-f> :Rgrep<cr>
let Grep_Default_Filelist = '*.*'
let Grep_Skip_Files = '*.log *.sql *.png *.jpg *.jpeg *.gif'
let Grep_Skip_Dirs = '.git tmp system coverage log solr public _site'
" Syntastic
let g:syntastic_enable_signs=1
let g:syntastic_error_symbol='✗'
let g:syntastic_warning_symbol='⚠'
let g:syntastic_enable_highlighting=0
let g:syntastic_ruby_checkers = ['mri', 'rubocop']
let g:calendar_google_calendar = 1
let g:calendar_google_task = 1
" FuzzyFinder
let g:fuf_file_exclude = '\v\~$|\.(bak|swp|png|jpg|jpeg|log|sql|bmp|gif|svg|pdf)$|(^|[/\\])(.hg|.git|.bzr|_site|tmp|public|coverage)'
let g:fuf_coveragefile_exclude = '\v\~$|\.(bak|swp|png|jpg|jpeg|log|sql|bmp|gif|svg|pdf)$|(^|[/\\])(.hg|.git|.bzr|_site|tmp|public|coverage)'
" let g:fuf_coveragefile_globPatterns = ['**/*.rb', '**/*.rake', '**/*.js', '**/*.coffee', '**/*.css', '**/*.scss', '**/*.sass', '**/*.less', '**/*.html', '**/*.haml', '**/*.slim', '**/*.erb']
let g:fuf_enumeratingLimit = 30
map <A-S-o> :FufCoverageFile<CR>
nnoremap <silent> <S-tab> :FufBuffer<CR>
map <F5> :FufRenewCache<cr>
" Commentary
map <C-c> <esc>gcc<end>
map <C-x> <esc>gcu<end>
vmap <C-c> gc
" Rails
map gV :Eview<CR>
map gC :Econtroller<CR>
map gM :Emodel<CR>
map gH :Ehelper<CR>
map gJ :Ejavascript<CR>
map gS :Estylesheet<CR>
" to start vim maximized
function Maximize_Window()
silent !wmctrl -r :ACTIVE: -b add,maximized_vert,maximized_horz
endfunction
au GUIEnter * call Maximize_Window()
if exists("+undofile")
set udf
set undodir=~/.vim/undo
endif
" vp doesn't replace paste buffer
function! RestoreRegister()
let @" = s:restore_reg
return ''
endfunction
function! s:Repl()
let s:restore_reg = @"
return "p@=RestoreRegister()\<cr>"
endfunction
vmap <silent> <expr> p <sid>Repl()