-
Notifications
You must be signed in to change notification settings - Fork 1
/
vimrc
132 lines (102 loc) · 3.29 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
121
122
123
124
125
126
127
128
129
130
131
colorscheme evening
syntax manual
set nocompatible
set autoindent
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab
set showmatch
set ruler
oset virtualedit=all
set hlsearch
" set font for gvim (need to have it ofc...)
"
" for linux atm, gui mode
if has('gui_running')
if has("unix")
set guifont=Liberation\ Mono\ 12
endif
if has("gui_win32")
endif
if has("mac")
endif
endif
set guifont=Liberation\ Mono\ 12
" set columns=80
" set columns=80
" colorize >81 column in 7.3
"set colorcolumn=80
" text width to column
" set textwidth=80
" to allow window size to allow 80 chars of actual text, no vert splits
" let &co=80 + &foldcolumn + (&number || &relativenumber ? &numberwidth : 0)
" x,y position display on status bar
set ruler
" set backup, swaps
set backup
set writebackup
set swapfile
syntax on
" no way to vizualize edge of >80 column, but this colors it (for 7.2)
" autocmd BufWinEnter * call matchadd('ErrorMsg', '\%>'.&l:textwidth.'v.\+', -1)
filetype on
filetype plugin on
"autocmd FileType c,cc,cpp,h,hpp,sl,vfl,vex :set cindent
"autocmd FileType osl,rsl,sl,h,vfl,vex :set smartindent
"autocmd FileType rib :set cindent
au BufReadPost *.rib set syntax=rib
au BufReadPost *.osl set syntax=osl
au BufReadPost *.mel set syntax=mel
" omnicomplete matching
" set completeopt ="menu,menuone,longest"
" limit popup menu height
set pumheight =15
" magenta dropdown is unreadable, change colors
" highlight clear
highlight Pmenu ctermfg=0 ctermbg=2
highlight PmenuSel ctermfg=0 ctermbg=7
highlight PmenuSbar ctermfg=7 ctermbg=0
highlight PmenuThumb ctermfg=0 ctermbg=0
" Setup the tab key to do autocompletion
"function! CompleteTab()
" let prec = strpart( getline('.'), 0, col('.')-1 )
" if prec =~ '^\s*$' || prec =~ '\s$'
" return "\"
" else
" return "\\"
" endif
"endfunction
"inoremap =CompleteTab()
" omnicomplete complete key is Ctrl+N, change to Ctrl+Space
" inoremap <Nul> <C-x><C-o>
"omnicpp options
" complete with .
" let OmniCpp_MayCompleteDot =0 " disable in rsl2 vim, dot product...
" let OmniCpp_MayCompleteArrow =1
" let OmniCpp_MayCompleteScope =1 " ::
" let OmniCpp_SelectFirstItem =2 " select first item but don't insert
" let OmniCpp_NamespaceSearch =2 " search namespaces
" let OmniCpp_ShowPrototypeInAbbr =1 " show prototype function in popup window
let OmniCpp_NamespaceSearch = 1
let OmniCpp_GlobalScopeSearch = 1
let OmniCpp_ShowAccess = 1
let OmniCpp_ShowPrototypeInAbbr = 1
let OmniCpp_MayCompleteDot = 0
let OmniCpp_MayCompleteArrow = 1
let OmniCpp_MayCompleteScope = 1
let OmniCpp_DefaultNamespaces = [ "wstd" , "_GLIBCXX_STD" ]
" automagically open and close the popup/preview menu
au CursorMovedI,InsertLeave * if pumvisible() == 0 | silent! pclose|endif
set completeopt=menuone,menu,longest,preview
" use default tags
set tags+=$HOME/.vim/tags/tags
" map ctrl+F12 to generate ctags for current folder
map <C-F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR><CR>
" add current directory generated tags to available tags
set tags+=./tags
" map tab completion to func+tab, and leave tab for indentation
let g:SuperTabMappingTabLiteral = '<Tab>'
let g:SuperTabMappingForward = '<C-Tab>'
let g:SuperTabMappingBackward = '<C-Tab>'
let g:SuperTabDefaultCompletionType = 'context'