-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
177 lines (128 loc) · 4.28 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
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
" Explicitly setting the script encoding since i have special eol chars
scriptencoding utf-8
" this seems like something i should set. Still not completely sure about
" what it does haha
" http://vimdoc.sourceforge.net/htmldoc/starting.html#compatible-default
set nocompatible
" add line numbers
set number
" show position numbers and info
set ruler
" make sure that buffers get hidden, this will help hold on to undo histoory
" when switching buffers
set hidden
" Start pathogen
call pathogen#infect()
" turn on syntax highlighting
syntax on
" I usually use a dark background
set background=dark
" set color scheme
color badwolf
" Don't bother with font options and stuff unless we're in the gui
if has("gui_running")
" Set the font to inconsolata size 12
if has("gui_gtk2")
set guifont=DejaVu\ Sans\ Mono\ 9
elseif has("gui_photon")
set guifont=DejaVu\ Sans\ Mono:s9
elseif has("gui_kde")
set guifont=DejaVu\ Sans\ Mono/9/-1/5/50/0/0/0/1/0
else
set guifont=DejaVu_Sans_Mono:h9:cDEFAULT
endif
" I don't like this feature on the terminal
set cursorline
endif
" do not wrap long lines by default
set nowrap
" show tabs as 4 spaces
set tabstop=4
" number of spaces to use for each step of auto indent
set shiftwidth=4
" use spaces instead of tabs
set expandtab
" number of spaces to use when pressing the tab key
set softtabstop=4
" show tabs as ▹... and eol as ¬
set list listchars=tab:▹.,eol:¬
" highlight the search
set hlsearch
" incremental search
set incsearch
" ignore case when searching
set ignorecase
" if the search string has an upper case letter in it, the search will be case sensitive
set smartcase
" allow for tab completion in the command line
set wildmode=list:longest
" filetypes to ignore when auto completeing
set wildignore+=*.o,*.obj,.git,*.rbc,*.class,.svn
" always show the status bar
set laststatus=2
" put more information in the status line
set statusline=%F%m%r%h%w\ [format=%{&ff}]\ [type=%Y]\ [ascii=\%03.3b]\ [hex=\%02.2B]\ [len=%L]\ [enc=%{strlen(&fenc)?&fenc:&enc}]\ [pos=%04l,%04v][%p%%]
" Set a print margin at 85
set colorcolumn=85
" add json syntax highlighting
au BufNewFile,BufRead *.json set ft=javascript
" add markdown syntax highlighting
au BufNewFile,BufRead *.md set ft=mkd
" for notes and text files set the text with to 72 characters
au BufNewFile,BufRead *.txt,*.md,*.tmp set tw=72
" for notes and text files set spell checking on
au BufNewFile,BufRead *.txt,*.md,*.tmp set spell
" Add less syntax highighting
au BufNewFile,BufRead *.less set filetype=less
" stop making any noise and don't flash the screen...
" For some reason this has to be set like this..
au BufNewFile,BufRead * set vb t_vb="<Esc>|0f"
" Hightlight trailing whitespace
highlight ExtraWhitespace ctermbg=red guibg=red
" Show leading whitespace that includes spaces, and trailing whitespace.
match ExtraWhitespace /\s\+\%#\@<!$/
" For some reason, when I open new windows, the match isn't applied, this is a
" patch to fix that
au InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
au InsertLeave * match ExtraWhitespace /\s\+\%#\@<!$/
" make backspace work like most other things
set backspace=2
" set the fold method as using text markers
set foldmethod=marker
" A little snippet that should help with encoding
if has("multi_byte")
if &termencoding == ""
let &termencoding = &encoding
endif
set encoding=utf-8
setglobal fileencoding=utf-8
"setglobal bomb
set fileencodings=ucs-bom,utf-8,latin1
endif
" Setup indenation
if has("autocmd")
filetype plugin indent on
endif
" Turn on backups
set backup
" Keep the backup and swap files out of the working directory
" Forward slashes seem to work in window. The trailing double slash
" makes the file name unique
set directory=c:/tmp//,/tmp//,.
set backupdir=c:/tmp//,/tmp//,.
" Set a global variable for authors. I use this in templates
let g:author = "John Hilliard"
" Try to stop it from using strange characters
let g:NERDTreeDirArrows = 0
" make sure the default file format is unix
set ff=unix
" Set the mouse mode to be a so that everything works nicely on the terminal
set mouse=a
" Set to use blowfish encryption
set cm=blowfish
" include my mappings file
if has("win32")
source $HOME/vimfiles/mappings.vim
else
source $HOME/.vim/mappings.vim
endif