-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdot_vimrc
More file actions
131 lines (99 loc) · 2.83 KB
/
dot_vimrc
File metadata and controls
131 lines (99 loc) · 2.83 KB
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
if &secure
finish
endif
syntax on " Syntax highlighting
set foldmethod =syntax " Fold method
set background =dark " Background colour scheme
set autoindent " Auto indent
set showmatch " Show matching braces and brackets
set ls =2 " status line bar
"set cindent " C indent
set title " Console title change
"set spell " Spell checking
set number " Line numbering
set cursorline
set encoding=utf-8
"set expandtab " Tabs are tabs not spaces
set showtabline =2
set foldclose= " Automatic foldclosing is irritating too
"set list " Show me whitespace where I care
set nocompatible
set history=1000
" Improve statusline tab completion
" set wildmenu
" Activate TAB auto-completion for file paths
" set wildmode=list:longest,full
" Make search wrap around the file
set wrapscan
" Enable filetype plugins
filetype plugin on
filetype indent on
"" Set to auto read when a file is changed from the outside
" set autoread
"Always show current position
set ruler
" Ignore case when searching
set ignorecase
" When searching try to be smart about cases
set smartcase
" For regular expressions turn magic on
set magic
" Properly disable sound on errors on MacVim
if has("gui_macvim")
autocmd GUIEnter * set vb t_vb=
endif
" Enable 256 colors palette in Gnome Terminal
if $COLORTERM == 'gnome-terminal'
set t_Co=256
endif
" Be smart when using tabs ;)
set smarttab
if v:version >= 700
set spelllang=en_au,en
set dictionary+=spell
elseif v:version >= 600
set encoding=utf-8
set termencoding=utf-8
"set fileencodings=ucs-bom,ascii,utf-8,latin1
endif
set backup
set writebackup
set backupcopy=yes
let &backupdir=$HOME."/.vim/backups"
let &directory=$HOME."/.vim/swaps"
let &undodir=$HOME."/.vim/undo"
if !isdirectory(&backupdir)
silent! execute "!mkdir -p '".&backupdir."'"
endif
if !isdirectory(&directory)
silent! execute "!mkdir -p '".&directory."'"
endif
if !isdirectory(&undodir)
silent! execute "!mkdir -p '".&undodir."'"
endif
if &compatible
" Vim defaults to `compatible` when selecting a vimrc with the command-line
" `-u` argument. Override this.
set nocompatible
endif
" Enable per-directory .vimrc files and disable unsafe commands in them
set exrc
set secure
" Highlight current line
set cursorline
" Highlight searches
set hlsearch
" Always show status line
set laststatus=2
" Enable mouse in all modes
set mouse=a
" Show the filename in the window titlebar
set title
" when folding is enabled the default settings will fold all blocks by default.
" To start with unfolded content we can set
set foldlevelstart=8
set smartcase " Enable smart-case search
set ignorecase " Always case-insensitive
set cursorline " Activate cursorline
" w!! allows saving with elevated privileges when needed
cnoremap w!! write !sudo tee -- % >/dev/null <bar> edit!