-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
74 lines (64 loc) · 2.09 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
if has("cscope")
set csprg=/usr/bin/cscope
set csto=0
set cst
set nocsverb
" add any database in current directory
if filereadable("cscope.out")
cs add cscope.out
" else add database pointed to by environment
elseif $CSCOPE_DB != ""
cs add $CSCOPE_DB
endif
endif
nmap <C-\>s :cs find s =expand("")
nmap <C-\>g :cs find g =expand("")
nmap <C-\>c :cs find c =expand("")
nmap <C-\>t :cs find t =expand("")
nmap <C-\>e :cs find e =expand("")
nmap <C-\>f :cs find f =expand("")
nmap <C-\>i :cs find i ^=expand("")$
nmap <C-\>d :cs find d =expand("")
" My commands
" SUBLIME COLOR "
syntax enable
set background=dark
colorscheme monokai
" CAPITAL LETTERS ALLOWED "
command WQ wq
command Wq wq
command W w
command Q q
" TAB STOP "
set nohlsearch
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
" NO WRAP "
set nowrap
" CLIPBOARD "
" CAPSLOCK "
au VimEnter * !xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape'
au VimLeave * !xmodmap -e 'clear Lock' -e 'keycode 0x42 = Caps_Lock'
" TAB COMPLETE "
function! Smart_TabComplete()
let line = getline('.') " current line
let substr = strpart(line, -1, col('.')+1) " from the start of the current
" line to one character right
" of the cursor
let substr = matchstr(substr, "[^ \t]*$") " word till cursor
if (strlen(substr)==0) " nothing to match on empty string
return "\<tab>"
endif
let has_period = match(substr, '\.') != -1 " position of period, if any
let has_slash = match(substr, '\/') != -1 " position of slash, if any
if (!has_period && !has_slash)
return "\<C-X>\<C-P>" " existing text matching
elseif ( has_slash )
return "\<C-X>\<C-F>" " file matching
else
return "\<C-X>\<C-O>" " plugin matching
endif
endfunction" TAB COMPLETE"
inoremap <tab> <c-r>=Smart_TabComplete()<CR>