-
Notifications
You must be signed in to change notification settings - Fork 1
/
.vimrc
executable file
·67 lines (57 loc) · 1.92 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
set ruler
set nu
set bs=2
"set tabstop=4"
set tags=tags;~/
colorscheme peachpuff
augroup filetype
au! BufRead,BufNewFile *.bash* set filetype=sh
au! BufRead,BufNewFile *.ax,*astrisrc set filetype=tcl
au! BufRead,BufNewFile *.pde set filetype=c
au! BufRead,BufNewFile *.thtml set filetype=php
au! BufRead,BufNewFile *.jobdesc set filetype=php
au! BufRead,BufNewFile *.tex set filetype=tex
au! BufRead,BufNewFile *.verilog,*.v set foldmethod=indent filetype=verilog
au! BufRead,BufNewFile *.c,*.h,*.cpp set foldmethod=syntax
au! BufRead,BufNewFile *.py set foldmethod=indent
au! BufRead,BufNewFile *.uia,*.uia2 set foldmethod=indent filetype=javascript
au! BufRead,BufNewFile *.json set foldmethod=indent filetype=javascript
augroup END
syntax on
syn sync fromstart
filetype plugin on
filetype indent on
function ToggleHLSearch()
if &hls
set nohls
else
set hls
endif
endfunction
function! Stab(value)
let &shiftwidth = a:value
let &softtabstop = a:value
let &tabstop = a:value
endfunc
call Stab(4)
function SetICSCode()
set expandtab
set smarttab
endfunction
call SetICSCode()
nmap <silent> <C-h> <Esc>:call ToggleHLSearch()<CR>.
let Tlist_Ctags_Cmd = "/opt/local/bin/ctags"
let Tlist_WinWidth = 50
map <Leader>1 :TlistToggle<cr>
map <Leader>2 :!/opt/local/bin/ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
map <Leader>0 :w\|verbose !ngspice -b %<CR>
map <Leader>9 :cn<cr>
map <Leader>8 :cp<cr>
"CTRL-N for nerdtree
map <C-n> :NERDTreeToggle<CR>
" close vim if nerdtree is only window
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
" auto-open nerdtree
"autocmd vimenter * NERDTree
" open a NERDTree automatically when vim starts up if no files were specified
autocmd vimenter * if !argc() | NERDTree | endif