-
Notifications
You must be signed in to change notification settings - Fork 0
/
global.vim
158 lines (108 loc) · 4.89 KB
/
global.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
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
" General Settings:
scriptencoding utf-8 " UTF8 All day, every day
set directory=/tmp/ " Set temporary directory (don't litter local dir with swp/tmp files)
" Set it to internal VIM Help
set keywordprg=:help
if v:version >= 703
" Set undofile.
set undofile
let &undodir=&directory
endif
" Enable filetype-specific indenting, syntax, and plugins
filetype plugin indent on
set nocompatible
" syntax enable
syntax on
set vb t_vb= " Disable visual bell
set autoread " Set to auto read when a file is changed from the outside
set nobackup " Do not create backup files when saving over existing files
set nowritebackup " A little paranoid, but disable the writebackup function as well
set noswapfile " No swap files when editing please
set completeopt=menuone,preview
" Ignore case on insert completion
set infercase
set matchpairs+=<:> " Also match angle brackets
" Mouse:
set nomousefocus " Don't focus the window when the mouse pointer is moved.
set mousehide " Hide mouse pointer on insert mode.
" Text:
set whichwrap=h,l,~,[,] " Wrap with more keys
set nowrap " Disable line wrapping
" use indents of 2 spaces, and have them copied down lines:
set expandtab
set tabstop=2
set softtabstop=2
set shiftwidth=2
" Round indent by a multiple of shiftwidth in indent mode
set shiftround
set number " Enable line numbers
set numberwidth=3 " Set line number column width
set showcmd " Display incomplete commands.
set showmode " Display the mode you're in.
set backspace=indent,eol,start " Intuitive backspacing.
set hidden " Handle multiple buffers better.
set ignorecase " Case-insensitive searching.
set smartcase " But case-sensitive if expression contains a capital letter.
set ruler " Show cursor position.
set scrolloff=3 " Show 3 lines of context around the cursor.
set title " Set the terminal's title
set visualbell " No beeping.
" UNCOMMENT TO USE
"set tabstop=2 " Global tab width.
"set shiftwidth=2 " And again, related.
"set expandtab " Use spaces instead of tabs
" WindowAndBufferManagement:
set splitbelow " Open new horizontal split windows below current
set splitright " Open new vertical split windows to the right
"set switchbuf=useopen,usetab,split " Don't change my current buffer on quickfix
" WildMenuModeConfig:
" set nowildmenu " Disable the wild menu
set wildmenu " Enhanced command line completion.
set wildmode=list:longest,full " Better completion
set wildignore=.svn,CVS,.git " Ignore VCS files
set wildignore+=*.o,*.a,*.so " Ignore compiled binaries
set wildignore+=*.jpg,*.png,*.gif " Ignore images
set wildignore+=*.pdf " Ignore PDF files
set wildignore+=*.pyc,*.pyo " Ignore compiled Python files
set wildignore+=*.fam " Ignore compiled Falcon files
" StatusBar:
" Always show status bar
set laststatus=2
set statusline=\ "
set statusline+=%f\ " file name
set statusline+=[
set statusline+=%{strlen(&ft)?&ft:'none'} " filetype
set statusline+=]
set statusline+=%{rvm#statusline()} " rvm info
set statusline+=%h%1*%m%r%w%0* " flag
set statusline+=%= " right align
set statusline+=%-14.(%l,%c%V%)\ %<%P " offset
" Useful status information at bottom of screen
" set statusline=[%n]\ %<%.99f\ %h%w%m%r%y\ %{fugitive#statusline()}%{exists('*CapsLockStatusline')?CapsLockStatusline():''}%=%-16(\ %l,%c-%v\ %)%P
" Vim Fugitive
" display current branch in status bar
" set statusline=%<%f\ %h%m%r%{fugitive#statusline()}%=%-14.(%l,%c%V%)\ %P
" Search:
" show the `best match so far' as search strings are typed:
set incsearch
" Don't highlight search result.
set nohlsearch
" Searches wrap around the end of the file
set wrapscan
" assume the /g flag on :s substitutions to replace all matches in a line:
set gdefault
" Tags:
" Perform binary tag search (vs linear) in case tags aren't sorted to avoid
" missing tags
set notagbsearch
" Show extra information when using tags in insert mode
set showfulltag
" Window Heights:
set helpheight=10
" Formatting:
set fo+=o " Automatically insert the current comment leader after hitting 'o' or 'O' in Normal mode.
set fo-=r " Do not automatically insert a comment leader after an enter
set fo-=t " Do no auto-wrap text using textwidth (does not apply to comments)
" CTags Handle multiple matches
set cscopetag
set cscopetagorder=1