-
Notifications
You must be signed in to change notification settings - Fork 4
/
.vimrc.local
150 lines (126 loc) · 3.92 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
" map <silent> <C-s> :Vexplore<CR>
" let g:netrw_browse_split = 4
" let g:netrw_altv = 1
" let g:netrw_banner = 0 " Don't show the netrw_banner
" let g:netrw_liststyle = 3 " tree listing style
autocmd User Rails Rnavcommand sass app/stylesheets -suffix=.sass -default=partials/_page
autocmd User Rails Rnavcommand coffee app/coffee -suffix=.coffee
autocmd User Rails Rnavcommand cell app/cells
autocmd User Rails Rnavcommand cellview app/cells -glob=**/* -suffix=.html.haml
let g:airline_powerline_fonts = 1
let g:ctrlp_show_hidden = 1
let g:ctrlp_custom_ignore = {
\ 'dir': '\.git$\|\.svn$\|node_modules$\|public\/assets$',
\ 'file': '\.exe$\|\.so$\|\.dat$\|\.DS_Store$\|\.gz$'
\ }
let g:go_fmt_command = "goimports"
" markdown
let vim_markdown_preview_github = 1
let vim_markdown_preview_hotkey = '<C-m>'
" search
if executable('ag')
" Use ag for :Ack
let g:ackprg = 'ag --vimgrep'
" Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
let g:ctrlp_user_command = 'ag %s -l --hidden --nocolor -g ""'
endif
set autoindent
set backupdir=~/.vimbackupdir,~/tmp,~/,.
set directory=~/.vimbackupdir,~/tmp,~/,.
set expandtab
set laststatus=2
set listchars=tab:⇀\ ,trail:␠
set list
set hlsearch
set ignorecase
set matchpairs+=<:>
set modeline
set modelines=5
set ruler
set shiftwidth=2
set showmatch
set tabstop=2
set tildeop
set wildmode=longest,list,full
set wildmenu
set dictionary-=/usr/share/dict/words dictionary+=/usr/share/dict/words
syntax on
color vividchalk
au! BufRead,BufNewFile *.rb
au! BufRead,BufNewFile *.xml
au BufNewFile,BufRead *.scss set filetype=scss
" Run rake from Rails files
autocmd User Rails nnoremap <buffer> <D-r> :<C-U>Rake<CR>
autocmd User Rails nnoremap <buffer> <D-R> :<C-U>.Rake<CR>
" find the current file
map <silent> <C-s> :NERDTree<CR><C-w>l:NERDTreeFind<CR>
" clear search
nmap <silent> ,/ :nohlsearch<CR>
" readline completion
map <silent> <C-P> <Up>
map <silent> <C-N> <Down>
" navigate windows
map <silent <C->h> :wincmd h<CR>
map <silent> <C-Left> :wincmd h<CR>
map <silent> <C-k> :wincmd k<CR>
map <silent> <C-Up> :wincmd k<CR>
map <silent> <C-j> :wincmd j<CR>
map <silent> <C-Down> :wincmd j<CR>
map <silent> <C-l> :wincmd l<CR>
map <silent> <C-Right> :wincmd l<CR>
" bubble text
map <silent> <C-H> x<Left>P
map <silent> <C-L> xp
map <silent> <C-J> ddp
map <silent> <C-K> ddkP
" open tabs with command-<tab number>
map <silent> <D-1> :tabn 1<CR>
map <silent> <D-2> :tabn 2<CR>
map <silent> <D-3> :tabn 3<CR>
map <silent> <D-4> :tabn 4<CR>
map <silent> <D-5> :tabn 5<CR>
map <silent> <D-6> :tabn 6<CR>
map <silent> <D-7> :tabn 7<CR>
map <silent> <D-8> :tabn 8<CR>
map <silent> <D-9> :tabn 9<CR>
" Reindent xml pastes
vmap <silent> <leader>x :!tidy -qi -raw -xml<CR>:se filetype=xml<CR>
" abbreviations
iabbrev bpry require 'pry'; binding.pry
iabbrev rpry require 'pry-remote'; binding.remote_pry
set visualbell
set nu
set nowrap
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Git (from joe)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:extradite_width = 60
" Hide messy Ggrep output and copen automatically
function! NonintrusiveAck(term)
execute "copen"
" Map 't' to open selected item in new tab
execute "nnoremap <silent> <buffer> t <C-W><CR><C-W>T"
execute "silent! Ack " . a:term
endfunction
nnoremap <silent> <C-\> :call NonintrusiveAck(expand("<cword>"))<CR>
"Trim trailing whitespace
command Trim %s/\s\+$//e
"Convert 1.8 hashes to 1.9 syntax
command HConvert %s/:\([^=,'"]*\) =>/\1:/g
" Autoclear trailing white-space and save cursor position
fun! <SID>StripTrailingWhitespaces()
let l = line(".")
let c = col(".")
%s/\s\+$//e
call cursor(l, c)
endfun
autocmd BufWritePre <buffer> :call <SID>StripTrailingWhitespaces()
" NO ARROW KEYS
" noremap <Up> ""
" noremap! <Up> <Esc>
" noremap <Down> ""
" noremap! <Down> <Esc>
" noremap <Left> ""
" noremap! <Left> <Esc>
" noremap <Right> ""
" noremap! <Right> <Esc>