-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vimrc
More file actions
45 lines (41 loc) · 1.8 KB
/
.vimrc
File metadata and controls
45 lines (41 loc) · 1.8 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
set hlsearch
set ruler
syntax on
set re=0
set noswapfile
set list
set listchars=extends:>,precedes:<
set errorformat=%f:%o:%l:%c:%e:%k:%m
set autoread
nnoremap j gj
nnoremap k gk
nnoremap <Down> gj
nnoremap <Up> gk
nnoremap <Tab> :cclose<Bar>cn<Return>
nnoremap <S-Tab> :cclose<Bar>cp<Return>
" https://stackoverflow.com/q/11198382#comment122398806_63162084
nnoremap <expr> <Space> empty(filter(getwininfo(), 'v:val.quickfix')) ? empty(getqflist()) ? '' : ':%bd<Bar>:copen<Bar>bd#<Return>' : ':cc<Bar>cclose<Return>'
nnoremap <Esc> :w<Bar>cexpr system('type -p quickfix >/dev/null && quickfix && type -p format >/dev/null && format >/dev/null')<Return><Return>:checktime<Return>
autocmd Filetype python setlocal tabstop=4 shiftwidth=4 expandtab autoindent
autocmd Filetype elm setlocal tabstop=4 shiftwidth=4 expandtab autoindent
autocmd Filetype qf nnoremap <buffer> h zh
autocmd Filetype qf nnoremap <buffer> j <C-e>
autocmd Filetype qf nnoremap <buffer> k <C-y>
autocmd Filetype qf nnoremap <buffer> l zl
autocmd Filetype qf nnoremap <buffer> <Left> zh
autocmd Filetype qf nnoremap <buffer> <Down> <C-e>
autocmd Filetype qf nnoremap <buffer> <Up> <C-y>
autocmd Filetype qf nnoremap <buffer> <Right> zl
autocmd BufWinEnter quickfix setlocal nowrap
" VimTip: http://vim.wikia.com/wiki/Search_for_visually_selected_text
" Search for selected text, forwards or backwards.
vnoremap <silent> * :<C-U>
\let old_reg=getreg('"')<Bar>let old_regtype=getregtype('"')<CR>
\gvy/<C-R><C-R>=substitute(
\escape(@", '/\.*$^~['), '\_s\+', '\\_s\\+', 'g')<CR><CR>
\gV:call setreg('"', old_reg, old_regtype)<CR>
vnoremap <silent> # :<C-U>
\let old_reg=getreg('"')<Bar>let old_regtype=getregtype('"')<CR>
\gvy?<C-R><C-R>=substitute(
\escape(@", '?\.*$^~['), '\_s\+', '\\_s\\+', 'g')<CR><CR>
\gV:call setreg('"', old_reg, old_regtype)<CR>