-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
122 lines (107 loc) · 3.68 KB
/
.vimrc
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
" Highlightning cross settings
:hi CursorLine cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white
:hi CursorColumn cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white
:nnoremap <Leader>c :set cursorline! cursorcolumn!<CR>
:set cursorline! cursorcolumn!
" Search settings
:set hlsearch!
:set number
:set list " show special characters
:set listchars=tab:→\ ,trail:·,nbsp:·
" Colorscheme settings
syntax enable
set background=dark
let g:solarized_termcolors=256
colorscheme solarized
:set guifont=Monospace\ 9
let g:solarized_bold=1
let g:solarized_contrast="high"
let g:solarized_visibility="high"
set textwidth=0 wrapmargin=0
set sessionoptions-=options
set makeprg=/home/wonowak/c1/BTS_BM/build/crosswaf_clang\ configure\ build\ --domain=synchronization
function! MakeSession()
let b:sessiondir = $HOME . "/.vim/sessions" . getcwd()
if (filewritable(b:sessiondir) != 2)
exe 'silent !mkdir -p ' b:sessiondir
redraw!
endif
let b:filename = b:sessiondir . '/session.vim'
exe "mksession! " . b:filename
endfunction
function! LoadSession()
let b:sessiondir = $HOME . "/.vim/sessions" . getcwd()
let b:sessionfile = b:sessiondir . "/session.vim"
if (filereadable(b:sessionfile))
exe 'source ' b:sessionfile
else
echo "No session loaded."
endif
endfunction
" au VimEnter * nested :call LoadSession()
" au VimLeave * :call MakeSession()
" Button mapping
" Windows settings
:nnoremap <F2> <C-w>w
:nnoremap <F3> <C-w>v
:nnoremap <F4> <C-w>q
" Directories
map <F5> :NERDTreeToggle<CR>
:nnoremap <F6> :Search <C-R><C-W><CR>
:nnoremap <s-F6> :Search y/<C-R>"<C-W><CR>
:nnoremap <c-F6> :SearchReset<CR>
:nnoremap <F7> :StripWhitespace<CR>
:nnoremap <F9> :call MakeSession()<CR>
:nnoremap <F11> :call LoadSession()<CR>
:nnoremap <c-G> :Grep<CR>
:nnoremap <c-m> :make<CR>
" Exit mapping
:nnoremap <F12> :qa<CR>
" Autocomplete
:nnoremap <C-Space> <C-n>
" save file
:nnoremap <C-s> :w<CR>
:vmap <C-c> "+y
:vmap <C-v> "+p
" configure tags - add additional tags here or comment out not-used ones
#set tags+=~/.vim/tags/cpp
set tags+=~/.vim/tags/gl
set tags+=~/.vim/tags/sdl
set tags+=~/.vim/tags/qt4
#set tags+=~/.vim/tags/boost/algorithm
#set tags+=~/.vim/tags/boost/math
#set tags+=~/.vim/tags/boost/smart_ptr
#set tags+=~/.vim/tags/boost/assign
#set tags+=~/.vim/tags/boost/atomic
#set tags+=~/.vim/tags/boost/variant
#set tags+=~/.vim/tags/boost/bimap
#set tags+=~/.vim/tags/boost/intrusive
#set tags+=~/.vim/tags/boost/bind
#set tags+=~/.vim/tags/boost/flyweight
#set tags+=~/.vim/tags/boost/iostreams
#set tags+=~/.vim/tags/boost/ptr_container
#set tags+=~/.vim/tags/boost/thread
#set tags+=~/.vim/tags/boost/iterator
#set tags+=~/.vim/tags/boost/function
#set tags+=~/.vim/tags/boost/lambda
#set tags+=~/.vim/tags/boost/random
#set tags+=~/.vim/tags/boost/functional
#set tags+=~/.vim/tags/boost/optional
#set tags+=~/.vim/tags/boost/function_types
#set tags+=~/.vim/tags/boost/local_function
#set tags+=~/.vim/tags/boost/tuple
#set tags+=~/.vim/tags/boost/regex
" build tags of your own project with Ctrl-F11
map <C-F10> :!ctags -R --sort=yes --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
" OmniCppComplete
let OmniCpp_NamespaceSearch = 1
let OmniCpp_GlobalScopeSearch = 1
let OmniCpp_ShowAccess = 1
let OmniCpp_ShowPrototypeInAbbr = 1 " show function parameters
let OmniCpp_MayCompleteDot = 1 " autocomplete after .
let OmniCpp_MayCompleteArrow = 1 " autocomplete after ->
let OmniCpp_MayCompleteScope = 1 " autocomplete after ::
let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD", "boost"]
" automatically open and close the popup menu / preview window
au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
set completeopt=menuone,menu,longest,preview