-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
94 lines (87 loc) · 2.63 KB
/
vimrc
File metadata and controls
94 lines (87 loc) · 2.63 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
execute pathogen#infect()
syntax on
set nu
set expandtab
set shiftwidth=2
set softtabstop=2
filetype plugin indent on
au BufNewFile,BufRead *.json set ft=json
au BufNewFile,BufRead *.md set ft=markdown
set wildmode=longest,list,full
set wildmenu
match ErrorMsg '\%>110v.\+'
set ruler
color desert
set pastetoggle=<F2>
vmap v <Plug>(expand_region_expand)
vmap <C-v> <Plug>(expand_region_shrink)
map q: :q
vnoremap <silent> s //e<C-r>=&selection=='exclusive'?'+1':''<CR><CR>
\:<C-u>call histdel('search',-1)<Bar>let @/=histget('search',-1)<CR>gv
omap s :normal vs<CR>
" Cycle between line numbers, relative numbers, no numbers
if exists('+relativenumber')
"CTRL-N is traditionally mapped to move the cursor down;
"I never use it that way, and there are already four other
"ways to do that
nnoremap <expr> <C-N> CycleLNum()
xnoremap <expr> <C-N> CycleLNum()
onoremap <expr> <C-N> CycleLNum()
" function to cycle between normal, relative, and no line numbering
function! CycleLNum()
if &l:rnu
setlocal nonu nornu
elseif &l:nu
setlocal nu rnu
else
setlocal nu
endif
" sometimes (like in op-pending mode) the redraw doesn't happen
" automatically
redraw
" do nothing, even in op-pending mode
return ""
endfunc
endif
" Explains what has happened when Vim notices that the file you are editing
" was changed by another program
if has('eval') && has('autocmd')
augroup FCSHandler
au FileChangedShell * call FCSHandler(expand("<afile>:p"))
augroup END
function! FCSHandler(name)
let msg = 'File "'.a:name.'"'
let v:fcs_choice = ''
if v:fcs_reason == 'deleted'
let msg .= " no longer available - 'modified' set"
call setbufvar(expand(a:name), '&modified', '1')
elseif v:fcs_reason == 'time'
let msg .= ' timestamp changed'
elseif v:fcs_reason == 'mode'
let msg .= ' permissions changed'
elseif v:fcs_reason == 'changed'
let msg .= ' contents changed'
let v:fcs_choice = 'ask'
elseif v:fcs_reason == 'conflict'
let msg .= ' CONFLICT --'
let msg .= ' is modified, but'
let msg .= ' was changed outside Vim'
let v:fcs_choice = 'ask'
echohl Error
else " unknown values (future Vim versions?)
let msg .= ' FileChangedShell reason='
let msg .= v:fcs_reason
let v:fcs_choice = 'ask'
endif
redraw!
echomsg msg
echohl None
endfunction
endif
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g_syntastic_check_on_wq = 0