-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmyfunc.vim
85 lines (66 loc) · 1.53 KB
/
myfunc.vim
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
function! UpdateTags()
exec ":silent !ctags -R --languages=C,C++ --c++-kinds=+px --c-kinds=+px --fields=+iaS --extra=+q ."
exec ":silent cs kill -1"
if filereadable("./cscope.out")
exec "silent !rm ./cscope.out"
endif
exec ":silent !cscope -b -R -s $PWD"
if filereadable("./cscope.out")
exec ":silent cs add cscope.out"
endif
if filereadable("./cscope-base.out")
exec ":silent cs add cscope-base.out"
endif
exec ":redraw!"
endfunction
function! UpdateGoTags()
exec ":!find . -name '*.go' -exec gotags {} \+ > tags"
endfunction
function! UpdateWebTags()
execute ":!ctags -R --languages=JavaScript,HTML ./"
endfunction
function! FormatMy()
set tabstop=8 shiftwidth=8 noexpandtab
endfunction
function! FormatPython()
set tabstop=4 shiftwidth=4 expandtab
endfunction
function! FormatMobisol()
set tabstop=4 shiftwidth=4 expandtab
endfunction
function! FormatSb()
set tabstop=2 shiftwidth=2 expandtab
endfunction
function! SpellOnEn()
set spell
set spelllang=en
endfunction
function! SpellOnDe()
set spell
set spelllang=de
endfunction
function! SpellOff()
set nospell
set spelllang=
endfunction
function! CleanEol()
%s/\( \|\t\)\+$//
endfunction
function! TagsAvr()
set tags=tags,tags-avr
endfunction
function! TagsArm()
set tags=tags,tags-arm
endfunction
function! TagsHost()
set tags=tags,tags-host
endfunction
function! HandleURI()
let s:uri = matchstr(getline("."), '[a-z]*:\/\/[^ ">,;:]*')
echo s:uri
if s:uri != ""
exec "!xdg-open \'" . s:uri . "\'"
else
echo "No URI found in line."
endif
endfunction