-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
102 lines (80 loc) · 2.91 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
" Daniel DeSousa's vimrc.
" Solves the chicken and the egg problem thanks to
" http://gmarik.info/blog/2011/05/17/chicken-or-egg-dilemma
" Load the bundles by default
runtime! bundles.vim
"
" All other non-filetype settings follow below
"
" Enables syntax highlighting
syntax on
color desert-warm-256
" One of the most important options to activate. Allows you to switch from an
" unsaved buffer without saving it first. Also allows you to keep an undo
" history for multiple files. Vim will complain if you try to quit without
" saving, and swap files will keep you safe if your computer crashes.
set hidden
set nowrap
" Use case insensitive search, except when using capital letters
set ignorecase
set smartcase
" Show partial commands in the last line of the screen
set showcmd
" Highlight searches (use <C-L> to temporarily turn off highlighting; see the
" mapping of <C-L> below)
set hlsearch
" Allow backspacing over autoindent, line breaks and start of insert action
set backspace=indent,eol,start
" When opening a new line and no filetype-specific indenting is enabled, keep
" the same indent as the line you're currently on. Useful for READMEs, etc.
set autoindent
" Instead of failing a command because of unsaved changes, instead raise a
" dialogue asking if you wish to save changed files.
" set confirm
set cmdheight=1
" Display line numbers on the left
set number
" Display the cursor position on the last line of the screen or in the status
" line of a window
set ruler
" Always display the status line, even if only one window is displayed
set laststatus=2
" Creates a backup directory in the vim folder that stores the last saved copy
" of any editted file. This acts as a form of disaster recovery.
let preferred_dir = expand("~/.vim/backup")
if !isdirectory(preferred_dir)
if exists("*mkdir")
echo "Creating preferred backup file location: " . preferred_dir
call mkdir(preferred_dir,"p",0700)
else
echo "Cannot create directory: " . preferred_dir . " because the mkdir function does not exist"
endif
endif
set backup
set writebackup
set backupdir=~/.vim/backup
" 7.4 syntax highlighting is slow, this improves it by going back to old
" regexengine
set regexpengine=1
" Use visual bell instead of beeping when doing something wrong
set visualbell
" And reset the terminal code for the visual bell. If visualbell is set, and
" this line is also included, vim will neither flash nor beep. If visualbell
" is unset, this does nothing.
set t_vb=
" Tab spacing set to 4 by default
set shiftwidth=4
set softtabstop=4
set expandtab
" Indentation settings for using hard tabs for indent. Display tabs as
" two characters wide.
set tabstop=4
" Explicitly set the filetypes for certain file extensions
au BufRead,BufNewFile *.md set filetype=markdown
au BufRead,BufNewFile *.sls set filetype=yaml
au BufNewFile,BufRead *.tmpl,*.j2 set ft=jinja
"
" Key Bindings
"
"
map <C-n> :NERDTreeToggle<CR>