-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
129 lines (111 loc) · 2.96 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
if has("gui_running")
" GUI is running or is about to start.
" Maximize gvim window.
set lines=75 columns=100
set guifont=Bitstream\ Vera\ Sans\ Mono\ 9
else
" This is console Vim
colorscheme ir_black
" set nuw=6
endif
"set wrap
"set wrapmargin=1
" From HERE to OTHER (below) see http://www.guckes.net/vim/setup.html
set nocp
set ai
" Add cursor "ruler"
set ru
set vb
set wmnu
set noeb
" Always show status line
set ls=2
" shorten messages
set shm=at
" allow scrolling to end of line and then start of next line
set ww=<,>,h,l
" Setup viminfo to allow sessions:
set vi=%,'50
set vi+=\"100,:100
set vi+=n~/.viminfo
" OTHER:
if version >= 600
filetype plugin indent on
endif
syntax on
set et
set sw=4
set tabstop=4
set smarttab
"set noautoindent
"set number
"au FileType python source ~/.vim/python.vim
set mouse=a
"filetype plugin on
"filetype indent on
"let g:gtex_flavor='latex'
"set guicursor=o:hor5
"au BufNewFile,BufRead *.cu setf cu
"au fileType cu source cpp.vim
" OpenCL
"au BufNewFile,BufRead *.cl set filetype=cpp
"au BufNewFile,BufRead *.cl set filetype=opencl
"autocmd FileType cl source ~/.vim/syntax/opencl.vim
au BufNewFile,BufRead *.tex set number
"---------------------
"" Settings for Fortran
"---------------------
""
:let fortran_have_tabs=1
:let fortran_more_precise=1
:let fortran_do_enddo=1
" to instruct the syntax script to define fold regions for program units,
" that is main programs starting with a program statement, subroutines,
" function subprograms, block data subprograms, interface blocks, and modules.
" :let fortran_fold=1
" fold regions will also be defined for do loops, if blocks, and select
" case constructs.
" :let fortran_fold_conditionals=1
" :let fortran_fold_multilinecomments=1
:let fortran_dialect='f95'
:let fortran_free_source=1
" Autoload session information when vim is quit with qa
"
" " Creates a session
function! MakeSession()
let b:sessiondir = $HOME . "/.vim/sessions" . getcwd()
if (filewritable(b:sessiondir) != 2)
exe 'silent !mkdir -p ' b:sessiondir
redraw!
endif
let b:sessionfile = b:sessiondir . '/session.vim'
exe "mksession! " . b:sessionfile
endfunction
" Updates a session, BUT ONLY IF IT ALREADY EXISTS
function! UpdateSession()
let b:sessiondir = $HOME . "/.vim/sessions" . getcwd()
let b:sessionfile = b:sessiondir . "/session.vim"
if (filereadable(b:sessionfile))
exe "mksession! " . b:sessionfile
echo "updating session"
endif
endfunction
" Loads a session if it exists
function! LoadSession()
if argc() == 0
let b:sessiondir = $HOME . "/.vim/sessions" . getcwd()
let b:sessionfile = b:sessiondir . "/session.vim"
if (filereadable(b:sessionfile))
exe 'source ' b:sessionfile
else
echo "No session loaded."
endif
else
let b:sessionfile = ""
let b:sessiondir = ""
endif
endfunction
au VimEnter * :call LoadSession()
au VimLeave * :call UpdateSession()
map <leader>m :call MakeSession()<CR>
source ~/.vim/custom_mswin.vim