forked from jordwalke/VimBox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dotVimRc
executable file
·173 lines (145 loc) · 5.11 KB
/
dotVimRc
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
" ================================================
" .__ ___.
" ___ __|__| _____ \_ |__ ____ ___ ___
" \ \/ /| | / \ | __ \ / _ \ \ \/ /
" \ / | || Y Y \ | \_\ \( <_> ) > <
" \_/ |__||__|_| / |___ / \____/ /__/\_ \
" \/ \/ \/
" ================================================
"
"
" See `README.md` for features and shortcuts
" Additional features not mentioned in README:
"
" Spell Check:
" Command+shift+p to toggle spell check on comments (underlines in red).
"
" Mac ProTips:
" To further improve the text rendering on Mac OSX:
" 1. From the shell: defaults write org.vim.MacVim MMCellWidthMultiplier 0.9
" 2. Opens all files from other apps in vert split defaults write
" org.vim.MacVim MMVerticalSplit YES
" 3. If when changing monitors, your fonts go from nice and thin to ugly and
" bold: This should fix it:
" defaults -currentHost write -globalDomain AppleFontSmoothing -int 1
"
" Cygwin:
" Tested and should work. AutoHotkey exist that provide an identical experience
" to the Mac OSX experience.
"
" Bundle System:
" Uses the NeoBundle system. Add bundles to ~/.vim/bundlesVimRc with:
" NeoBundle "git://github.com/youruser/something.git"
" Open New Vim Windows and it will ask you to install.
" Close and then reopen the vim window.
filetype plugin on " Required for NeoBundle and also good.
filetype indent on " Required for NeoBundle and also good.
if has('vim_starting')
set nocompatible " Be iMproved
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
if has('gui_win32')
set rtp+=~/.vim
endif
if filereadable(expand("~/.vim/vimrc.custom.before"))
source ~/.vim/vimrc.custom.before
endif
set noswapfile " Don't make backups.
set nowritebackup " Even if you did make a backup, don't keep it around.
set nobackup
syntax on
set virtualedit=block
set tabstop=2
set nonumber
set noswapfile
set mouse=a
set nospell
set ic
set scs
" TODO: Set up mappings to toggle between text mode and code mode.
" Editing code
set nowrap
set wrapmargin=0
" let &textwidth=exists('g:textColumns') && !empty(g:textColumns) ? g:textColumns : 80
set nolinebreak
set hlsearch
set formatoptions+=or
let &tabstop=exists('g:tabSize') ? g:tabSize : 2
let &softtabstop=exists('g:tabSize') ? g:tabSize : 2
let &shiftwidth=exists('g:tabSize') ? g:tabSize : 2
set expandtab
set ignorecase
set infercase
let g:omni_syntax_ignorecase=1
set wildmode=full
" set wildignore+=*/node_modules/**
" Including this messes up fugitive in git mergetool:
" set wildignore+=*/.git/*,*/.hg/*,*/.svn/* " Linux/MacOSX
set sm! " show matching brace/paren
set visualbell
" Should avoid "Hit Enter" annoyingness (Does *not* work)
" set shortmess+=filmnrxoOtT
" Mac Support bootstrap
set wildignore+=*.DS_Store
set wildignore+=*/_build**
" Remove ugly folds
set nofoldenable
" nofoldenable doesn't work in diff mode so do something similar
set diffopt=filler,context:9999
" ============= Configure as Privacy Plugin =========================
" All sensitive data is not stored in your ~/.vimrc folder
" Configure the spelling language and file.
" ================================================================
set spelllang=en
set spellfile=$HOME/vim_spell/en.utf-8.add
" UndoDir:
let s:homeFolder = $HOME
let s:undoDir = s:homeFolder . '/vimUndo'
set undofile
" " Create undo dir if needed - not in your dotVim folder! It should be local to
" " your computer.
if !isdirectory(s:undoDir)
call mkdir(s:undoDir)
endif
execute "set undodir=".s:undoDir
" Since your file/folder history may show up in a git commit!
let g:netrw_dirhistmax=0
" ================================================================
" =========================== FIX SHELL ==========================
if &shell =~# 'fish$'
set shell=sh
endif
" ================================================================
" http://stackoverflow.com/questions/6852763/vim-quickfix-list-launch-files-in-new-tab
set switchbuf+=usetab,newtab
" A better diff link for macvim
" alias mvimdiff="mvim -O \"+windo set diff scrollbind scrollopt+=hor nowrap\""
" All ObjC/C++ files are ObjCPP.
" All snipets for ObjC are in ~/.vim/myUltiSnippets/objcpp.snippets
au BufNewFile,BufRead *.cpp set filetype=objcpp
au BufNewFile,BufRead *.h set filetype=objcpp
au BufNewFile,BufRead *.m set filetype=objcpp
call neobundle#rc(expand('~/.vim/bundle/'))
" Let NeoBundle manage NeoBundle
" Required:
NeoBundleFetch 'Shougo/neobundle.vim'
" <temporary until neobundle stops asking to hit enter for more>
if has("gui_macvim")
set guifont=Monaco:h10
set columns=195
endif
" </temporary until neobundle stops asking to hit enter for more>
set t_Co=256
source ~/.vim/.bundlesVimRc
" <temporary until neobundle stops asking to hit enter for more>
set linespace=0
autocmd VimEnter * exec ":set columns=85"
" </temporary until neobundle stops asking to hit enter for more>
source ~/.vim/.guiSettingsVimRc " Must come after .bundlesVimRc
source ~/.vim/.keysVimRc
source ~/.vim/.customFunctions.vim
" sensible.vim disturbs this - reset it.
set listchars = "eol:$"
if filereadable(expand("~/.vim/vimrc.custom.after"))
source ~/.vim/vimrc.custom.after
endif