-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
104 lines (90 loc) · 2.25 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
runtime bundle/vim-pathogen/autoload/pathogen.vim
execute pathogen#infect()
filetype off
:syntax on
filetype plugin indent on
:colorscheme koehler
:set si
:set hls
:set relativenumber
:set number
:set so=3
:set encoding=utf-8
:set listchars=tab:→\ ,trail:·
:set list
" :help usr_25 - adds _j justify function
:packadd! justify
" see http://vim.wikia.com/wiki/Restore_cursor_to_file_position_in_previous_editing_session
:set viminfo='100,<50,s10,h,\"100,:20,%
function! ResCur()
if line("'\"") <= line("$")
normal! g`"
return 1
endif
endfunction
if has("folding")
function! UnfoldCur()
if !&foldenable
return
endif
let cl = line(".")
if cl <= 1
return
endif
let cf = foldlevel(cl)
let uf = foldlevel(cl - 1)
let min = (cf > uf ? uf : cf)
if min
execute "normal!" min."zo"
return 1
endif
endfunction
endif
augroup resCur
autocmd!
if has("folding")
autocmd BufWinEnter * if ResCur() | call UnfoldCur() | endif
else
autocmd BufWinEnter * call ResCur()
endif
augroup END
:hi VertSplit ctermbg=green ctermfg=0
:hi StatusLine ctermbg=4 ctermfg=green
:hi StatusLineNC ctermbg=green ctermfg=4 cterm=NONE
:nnoremap <C-n> :NERDTreeToggle<CR>
:nnoremap <C-u> :noh<CR>
function! HighlightTags()
if filereadable("tags")
let l:hltime = getftime("tags.vim")
let l:tagtime = getftime("tags")
if l:hltime < l:tagtime
sp tags
execute "%s/^\\([^ :]*:\\)\\=\\([^ ]*\\).*/syntax keyword Tag \\2/"
execute "wq! tags.vim"
endif
so tags.vim
endif
endfunction
command! Thl :call HighlightTags()
function! Synctex()
" remove silent for debugging
execute "silent !zathura --synctex-forward " . line('.') . ":" . col('.') . ":" . bufname('%') . " " . g:syncpdf
endfunction
map <C-enter> :call Synctex()<cr>
augroup filetypedetect
au! BufNewFile,BufRead *.inc setf php | set tabstop=2
au! BufNewFile,BufRead * if &ft == 'php'||&ft == 'html' | set tabstop=2 | set sw=2 | endif
au! BufNewFile,BufRead * if &ft == 'css' | set tabstop=3 | set sw=3 | endif
augroup END
autocmd InsertEnter * :set number
autocmd InsertLeave * :set relativenumber
if filereadable("./tags.vim")
so tags.vim
endif
if filereadable(expand("~/.vim/locals.vim"))
source ~/.vim/locals.vim
endif
if filereadable(".settings.vim")
source .settings.vim
endif
" vim:ts=3:sw=3:noet