-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc.after
101 lines (80 loc) · 2.34 KB
/
.vimrc.after
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
set ttymouse=xterm2
set mouse=a
set t_Co=256
set background=dark
colorscheme solarized
execute "set colorcolumn=".join(range(81,335),',')
:hi ColorColumn ctermbg=black
set completeopt=longest,menuone
let g:clang_library_path="/usr/lib"
let g:clang_use_library = 1
let g:clang_auto_select = 1
let g:clang_complete_copen = 1
let g:clang_snippets=1
let g:syntastic_cpp_compiler_options='-std=c++11'
let c_no_curly_error=1
function! ClangGetPrototype()
let curr_line = getline('.')
let r1 = substitute(curr_line, '<#', '', 'g')
call setline('.', r1)
let curr_line = getline('.')
let r1 = substitute(curr_line, '#>', '', 'g')
call setline('.', r1)
endfunction
command CLu call g:ClangUpdateQuickFix()
command Ast call s:Autoformat()
command CLp call ClangGetPrototype()
au BufNewFile,BufRead *.cuh set ft=cuda
set guioptions-=m
set guioptions-=T
set guioptions-=r
if version >= 700
function! HOpen(dir,what_to_open)
let [type,name] = a:what_to_open
if a:dir=='left' || a:dir=='right'
vsplit
elseif a:dir=='up' || a:dir=='down'
split
end
if a:dir=='down' || a:dir=='right'
exec "normal! \<c-w>\<c-w>"
end
if type=='buffer'
exec 'buffer '.name
else
exec 'edit '.name
end
endfunction
function! HYankWindow()
let g:window = winnr()
let g:buffer = bufnr('%')
let g:bufhidden = &bufhidden
endfunction
function! HDeleteWindow()
call HYankWindow()
set bufhidden=hide
close
endfunction
function! HPasteWindow(direction)
let old_buffer = bufnr('%')
call HOpen(a:direction,['buffer',g:buffer])
let g:buffer = old_buffer
let &bufhidden = g:bufhidden
endfunction
noremap <c-w>d :call HDeleteWindow()<cr>
noremap <c-w>y :call HYankWindow()<cr>
noremap <c-w>p<up> :call HPasteWindow('up')<cr>
noremap <c-w>p<down> :call HPasteWindow('down')<cr>
noremap <c-w>p<left> :call HPasteWindow('left')<cr>
noremap <c-w>p<right> :call HPasteWindow('right')<cr>
noremap <c-w>pk :call HPasteWindow('up')<cr>
noremap <c-w>pj :call HPasteWindow('down')<cr>
noremap <c-w>ph :call HPasteWindow('left')<cr>
noremap <c-w>pl :call HPasteWindow('right')<cr>
noremap <c-w>pp :call HPasteWindow('here')<cr>
noremap <c-w>P :call HPasteWindow('here')<cr>
endif
let g:syntastic_c_check_header = 1
let g:syntastic_cpp_check_header = 1
silent! nmap <F3> :NERDTreeFind<CR>
set clipboard=exclude:.*