-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobal.vim
More file actions
executable file
·183 lines (139 loc) · 3.7 KB
/
global.vim
File metadata and controls
executable file
·183 lines (139 loc) · 3.7 KB
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
set nocompatible
syntax on
filetype plugin indent on
let g:isDarwin = 0
if has("unix")
let s:uname = system("uname")
if s:uname == "Darwin\n"
let g:isDarwin = 1
endif
endif
let g:vim_dir = expand('<sfile>:p:h')
set ttyfast
set noeol
set binary
set hidden
set noautowriteall
set autoread
set modeline
set modelines=5
set backspace=indent,eol,start
set smarttab
set shiftround
set tabstop=4
set shiftwidth=4
set noexpandtab
set textwidth=0
set nowrap
set listchars=tab:▷⋅,trail:·,eol:$
set list
set showmatch " Show matching brackets.
set numberwidth=3 " number of columns for line numbers
if v:version >= 703
set relativenumber
set number
function! NumberToggle()
if(&relativenumber == 1)
set norelativenumber
set number
else
set relativenumber
set number
endif
endfunc
nnoremap <C-n> :call NumberToggle()<cr>
else
set number
endif
set scrolloff=3
set sidescroll=1
set sidescrolloff=15
set ruler " line and column number of the cursor position
set showcmd " Show (partial) command in status line.
set laststatus=2 " always show the status line
set visualbell " use visual bell instead of beeping
set noerrorbells
set incsearch " Incremental search
set hlsearch " Highlight search match
set ignorecase " Do case insensitive matching
set smartcase " do not ignore if search pattern has CAPS
set history=1000
set undolevels=1000
if v:version >= 703
set undofile
endif
if has("nvim")
set backupdir=~/.nvim-backup//,.
if v:version >= 703
set undodir=~/.nvim-backup//,.
endif
set directory=~/.nvim-backup//,~/tmp//,.
else
set backupdir=~/.backup//,.
if v:version >= 703
set undodir=~/.backup//,.
endif
set directory=~/.backup//,~/tmp//,.
endif
set foldcolumn=0 " columns for folding
set foldmethod=indent
set foldlevel=9
set nofoldenable "dont fold by default "
set completeopt=menu,preview
set wildmenu
set wildmode=longest:list,full
set wildignore=.svn,CVS,.git,.hg,*.o,*.a,*.class,*.mo,*.la,*.so,*.obj,*.swp,*.jpg,*.png,*.xpm,*.gif
set wildignorecase
set shell=/bin/bash
let bash_is_sh=1
" Prevent Vim from clobbering the scrollback buffer. See
" http://www.shallowsky.com/linux/noaltscreen.html
set t_ti= t_te=
set sessionoptions-=options " do not store global and local values in a session
set sessionoptions-=folds " do not store folds
" turn off blinking cursor in normal mode
set gcr=n:blinkon0
" Returns statusline text for paste mode
function! StatusLinePaste()
if &paste
return ' [paste]'
endif
return ''
endfunction
" Returns statusline text for clipboard=unnamed
function! StatusLineUnnamed()
if &clipboard == 'unnamed'
return ' [clipboard]'
endif
return ''
endfunction
" Shows position of current buffer in arg list
function! BuildStatusLineArglistIndicator()
return '%{argc()>1?(" [".repeat("-",argidx()).(expand("%")==argv(argidx())?"+":"~").repeat("-",argc()-argidx()-1)."]"):""}'
endfunction
function! BuildStatusLine()
let l:s = ''
let l:s .= '%(%l/%L %c%V %P%)'
let l:s .= BuildStatusLineArglistIndicator()
let l:s .= '%{StatusLinePaste()}%{StatusLineUnnamed()} %#warningmsg#%*%=%-h %m%r %t%* '
return l:s
endfunction
set statusline=%!BuildStatusLine()
" GUI settings
set guioptions-=T " disable toolbar
if has("mouse")
set mouse-=a
endif
set mousehide
augroup vimrcEx
" clear all autocmds in the group
autocmd!
" jump to last position in file when opening
autocmd BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
augroup END
" extended '%' mapping for if/then/else/end etc
runtime macros/matchit.vim
" set up some more useful digraphs
if has("digraphs")
digraph ., 8230 " ellipsis (…)
endif