-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc.local
211 lines (165 loc) · 4.86 KB
/
vimrc.local
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
set guifont=Monaco\ for\ Powerline:h15
set linespace=6
let g:vimconsole#auto_redraw = 1
scriptencoding utf-8
set encoding=utf-8
set iskeyword+=-,_
syntax on
let g:material_terminal_italics = 1
let g:material_theme_style = 'default'
colorscheme material
" set background=light
" colorscheme snappy-light
" babel / jsx / json
let g:jsx_ext_required = 0 " Allow JSX in normal JS files
let g:syntastic_javascript_checkers = ['eslint']
au BufRead,BufNewFile *.json set filetype=json
let g:syntastic_json_checkers=['jsonlint']
let g:vim_json_syntax_conceal = 0
nnoremap <A-Down> :m .+1<CR>==
nnoremap <A-Up> :m .-2<CR>==
" Line numbers
set number
" autocmd InsertEnter * :set relativenumber! number
" autocmd InsertLeave * :set number! relativenumber
highlight ExtraWhitespace ctermbg=009
autocmd BufWritePre * StripWhitespace
" hi MatchParen ctermfg=009 ctermbg=NONE cterm=underline guifg=#f35656 guibg=NONE gui=underline
" enable mouse
set mouse=a
" fix for vim-rails chruby bug
set shell=bash
" CoVim
let CoVim_default_name = "itg"
let CoVim_default_port = "29100"
" neocomplete
let g:neocomplete#enable_at_startup = 1
" vimshell
let g:vimshell_user_prompt = 'fnamemodify(getcwd(), ":~")'
let g:vimshell_prompt = '$ '
" vim directories: backupdir, swap files
set backup
set backupdir=~/.vim/.backup//
set dir=~/.vim/.swp//
set modelines=0
set nocompatible
" airline
let g:airline_theme='tomorrow'
let g:airline_powerline_fonts=1
let g:airline#extensions#tmuxline#enabled=0
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#left_sep = ''
let g:airline#extensions#tabline#left_alt_sep = '|'
" tmuxline
let g:tmuxline_powerline_separators=1
" tabs
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
nnoremap tj :tabnext<CR>
nnoremap tk :tabprev<CR>
nnoremap tl :tabnext<CR>
nnoremap th :tabprev<CR>
nnoremap <C-t> :tabe<Space>
nmap <leader>h :%!html2haml --html-attributes --erb 2> /dev/null<CR>:set ft=haml<CR>
vmap <leader>h :!html2haml --html-attributes --erb 2> /dev/null<CR>:set ft=haml<CR>
" word separators
" set iskeyword-=_,-
" EasyAlign
" Start interactive EasyAlign in visual mode (e.g. vip<Enter>)
map <Enter> <Plug>(EasyAlign)
" Start interactive EasyAlign for a motion/text object (e.g. <Leader>aip)
nmap <Leader>e <Plug>(EasyAlign)
" multikey mapping speed
set timeout timeoutlen=250 ttimeoutlen=75
" Delete character should not squash paste buffer
nnoremap <silent> x "_x
vnoremap <silent> x "_x
" " xp should still function as transpose
nnoremap <silent> xp xph
vnoremap <silent> xp xph
" swap buffers
nnoremap <silent> <C-o><C-o> :bn<CR>
nnoremap <silent> <C-i><C-i> :bp<CR>
nnoremap <leader>q :Bdelete<CR>
" cursor -- this is really laggy in macvim
set cursorline
set cursorcolumn
set scrolloff=3
set autoindent
set showmode
set showcmd
set hidden
set wildmode=longest,list,full
set wildmenu
set visualbell
set ttyfast
set ruler
set backspace=indent,eol,start
set laststatus=2
" search
set ignorecase
set smartcase
set gdefault
set incsearch
set showmatch
set hlsearch
nnoremap / /\v
vnoremap / /\v
nnoremap <leader><space> :noh<cr>
nnoremap <leader>r :%s/
" ====================================================================
" ctrlp configuration
" ====================================================================
" Use The Silver Searcher https://github.com/ggreer/the_silver_searcher
if executable('ag')
" Use Ag over Grep
set grepprg=ag\ --nogroup\ --nocolor
" Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
let g:ctrlp_user_command = 'ag %s -l --nocolor --hidden -g ""'
" ag is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0
endif
" Ag for silversearcher searching (like Ack)
nnoremap <leader>a :Ag<Space>
set nowrap
set textwidth=79
set formatoptions=qrn1
" set list
" set listchars=tab:▸\
" movement keys
" nnoremap <up> <nop>
" nnoremap <down> <nop>
" nnoremap <left> <nop>
" nnoremap <right> <nop>
" inoremap <up> <nop>
" inoremap <down> <nop>
" inoremap <left> <nop>
" inoremap <right> <nop>
" command line
nnoremap ; :
set wildignore+=*.o,*.obj,*.png,*.jpg,*.gif,**/.DS_Store,*.csv,.sass-cache/**
" easier window resizing
nnoremap ,. <C-w><
nnoremap ,p <C-w>>
" find the current file
map <silent> <C-s> :NERDTree<CR><C-w>l:NERDTreeFind<CR>
" let g:NERDTreeDirArrows = 0
"window enter / leave hooks
au WinEnter * :set cursorline
au WinLeave * :set nocursorline
au WinEnter * :set cursorcolumn
au WinLeave * :set nocursorcolumn
au WinEnter * :set colorcolumn=79
au WinLeave * :set colorcolumn=0
"buffer enter / leave hooks
"au BufWinEnter * silent! loadview
"au BufWinLeave * silent! mkview
"jshint config
" let g:syntastic_javascript_jshint_args = $HOME . '/.jshintrc'
" let g:syntastic_javascript_checkers = ['jshint']
" JAVASCRIPT TO JSON
:map <F3> :s/\(^\s\+\)\(\w\+\)\:/\1"\2":/
" use == to Line up multiline javascript arguments
set cino+=(0<Enter>)