-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.vimrc
116 lines (102 loc) · 2.94 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
set encoding=utf-8
silent! set modelineexpr
filetype on
syntax enable
" Configure Vundle
if getftype("~/.vim/bundle/Vundle.vim") ==? "dir"
filetype off
set nocompatible
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin "VundleVim/Vundle.vim"
call vundle#end()
filetype on
endif
" Configure Pathogen
if exists("g:loaded_pathogen")
execute pathogen#infect()
syntax on
filetype plugin indent on
endif
" Use Solarized theme if running graphically
if has("gui_running")
set background=dark
colorscheme solarized
endif
" Configure spellcheck
if has("spell")
set spelllang=en_au,en_gb
set spelloptions=camel
let s:old_syntax = ""
let s:new_syntax = ""
fun s:SyntaxChanged()
let s:new_syntax = ""
if exists("b:current_syntax")
let s:new_syntax = b:current_syntax
endif
if s:new_syntax =~ "gitcommit" | set spell
elseif s:old_syntax =~ "gitcommit" | set nospell
endif
let s:old_syntax = s:new_syntax
endfunction
autocmd Syntax * call s:SyntaxChanged()
endif
"======================================================================*
set number
set autoread
set backspace=indent,eol,start
set tabstop=4 softtabstop=0 noexpandtab shiftwidth=4
set hlsearch
set ignorecase
set incsearch
set modelines=50
set showmatch
highlight OverLength ctermbg=red ctermfg=white guibg=#592929
fun! UpdateMatch()
if exists("b:current_syntax")
if b:current_syntax =~ "gitcommit"
match OverLength /\%>72v.\+/
else
match NONE
endif
endif
endfun
autocmd BufEnter,BufWinEnter * call UpdateMatch()
"======================================================================*
" Status line colours
highlight statusline ctermbg=DarkGreen ctermfg=Black
" Display highlighting group at cursor
fun! StatusLineHighlightGroup()
return synIDattr(synID(line("."), col("."), 1), "name")
endfun
" Name of currently-active filetype
fun! StatusLineFileType()
return strlen(&ft) ? &ft : "none"
endfun
" Character encoding and byte-order mark indicators
fun! StatusLineEncoding()
let encoding = toupper (&fenc == "" ? &enc : &fenc)
if exists("+bomb") && &bomb
encoding += "(BOM)"
endif
return encoding
endfun
" Line-ending style
fun! StatusLineEOLStyle()
if (&fileformat ==? "unix") | return "LF"
elseif (&fileformat ==? "dos") | return "CRLF"
elseif (&fileformat ==? "mac") | return "CR"
endif; return type
endfun
if has("statusline")
set laststatus=2
set statusline=%#Question#%-2.2n\ " Buffer number
set statusline+=%#WarningMsg#%<%f\ %#Question# " Filename
set statusline+=\ %l:%c " Line:column
set statusline+=\ %{StatusLineHighlightGroup()} " Highlighting group at cursor
set statusline+=%= " Left/right divider
set statusline+=%{StatusLineEOLStyle()}\ \ " What line terminators are used
set statusline+=%{StatusLineEncoding()}\ \ " Encoding + BOM
set statusline+=%{StatusLineFileType()}\ \ " Filetype
set statusline+=%h%m%r%w\ " Flags
endif