-
Notifications
You must be signed in to change notification settings - Fork 9
/
vimrc-defaults
161 lines (136 loc) · 2.98 KB
/
vimrc-defaults
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
" Fix vim defaults
set nocompatible
set lazyredraw
set ttyfast
set backspace=indent,eol,start " backspace works as expected
set nostartofline " Make j/k respect the columns (after all, this is not a freaking typewriter)
set modeline " Respect modeline of the file (the famous "vi:noai:sw=3 ts=6" on the beginning of the files)
set hidden " Avoid asking to save before hiding
set enc=utf-8
"setlocal spell spelllang=en_us " I assume you code in english
" Load Vundle
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
filetype plugin indent on
" Basic UI
set visualbell
set shm=atIWswxrnmlf
set ruler
set title
set titlestring=%f%(\ [%M]%) " Show file name at the title
set numberwidth=1
set report=2
set laststatus=2
set statusline=%f
set showcmd
set showmode
set winminheight=0
"
" Bend vim features and behaviors to our wishes.
"
syntax on
"
" Command-mode completion
"
set wildmenu
set wildignore=*.o,*.obj,*.pyc,*.swc,*.DS_STORE,*.bkp
set wildmode=list:longest
" Insert-mode completion
set complete=.,w,b,u,U,t,i,d
" Scrolling
set scroll=5
set scrolloff=5
set sidescrolloff=5
set sidescroll=1
" Matching
set showmatch
set matchpairs=(:),{:},[:],<:>
" Search and replace
set gdefault " Make regexp matches everything, instead of just the first one
set incsearch " Search all instances
set hlsearch " Highlight matched regexp
set ignorecase
set smartcase " Intelligent case-smart searching
"
" Indentation
"
set autoindent
set smartindent
set smarttab
set shiftround
set nojoinspaces
set nofoldenable
if softab == "on"
set expandtab
endif
let &tabstop=tabsize
let &softtabstop=tabsize
let &shiftwidth=tabsize
"
" Autocomplete
"
set infercase
set completeopt=longest,menuone
set ofu=syntaxcomplete#Complete
"
" Soft/Hard Wrapping
"
set wrap
set textwidth=79
set formatoptions=qrn1
"
" History and backup
"
set viminfo='10,:20,\"100,%,n~/.viminfo
set history=1000
set nobackup
set nowritebackup
set noswapfile
"
" Persistent-undo (vim 7.3)
"
if has("persistent_undo")
set undofile
set undodir=.vim/undo
endif
"
" Tabs
"
set guitablabel=%N/\ %t\ %M
"
" Grep
"
if executable("ack")
set grepprg=ack
set grepformat=%f:%l:%m
endif
" Format
set formatprg=par
" GUI Options
if has("mouse")
set mouse=a
set mousefocus
endif
if has("gui_running")
set cursorline
let &guifont=gui_font
" Don't show toolbar and scrollbars
set go-=T to
set guioptions-=L
set guioptions-=r
" Use system clipboard
set clipboard=unnamed
endif
" When editing a file, always jump to the last known cursor position.
" " Don't do it when the position is invalid or when inside an event handler
" " (happens when dropping a file on gvim).
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
" Write with superuser permissions using :W command
command W w !sudo tee % > /dev/null
" Enable matchit and editExisting
runtime! macros/machit.vim
runtime! macros/editExisting.vim