forked from daniellockard/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
95 lines (80 loc) · 1.55 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
"-- Pathogen
filetype off
call pathogen#runtime_append_all_bundles()
filetype plugin indent on
set nocompatible
set t_Co=256
"-- Sane timeout values
set notimeout
set ttimeout
set ttimeoutlen=10
"-- Tabs are 2 spaces, btw
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
set autoindent
set wrap
set textwidth=80
set formatoptions=qrn1
"-- Backups and stuff
set undofile
set undodir=~/tmp/undo//
set backupdir=~/tmp/backup//
set directory=~/tmp/swap//
set backup
set noswapfile
au FocusLost * :wa
"-- Colors and things
syntax on
set background=dark
colorscheme solarized
set showmatch
set backspace=2
set encoding=utf-8
set scrolloff=3
set showmode
set showcmd
set cursorline
set ttyfast
set ruler
set laststatus=2
"-- Nav keys, goooo
imap <silent> <Down> <C-o>gj
imap <silent> <Up> <C-o>gk
nmap <silent> <Down> gj
nmap <silent> <Up> gk
"-- Maps
cmap W w
cmap WQ wq
cmap wQ wq
cmap Q q
"-- Stupid help key, we don't need no stinking help.
inoremap <F1> <ESC>
nnoremap <F1> <ESC>
vnoremap <F1> <ESC>
"-- better search
nnoremap / /\v
vnoremap / /\v
set ignorecase
set smartcase
set gdefault
set incsearch
set showmatch
set hlsearch
nnoremap <leader><space> :noh<cr>
nnoremap <tab> %
vnoremap <tab> %
function! EnsureDirExists (dir)
if !isdirectory(a:dir)
if exists("*mkdir")
call mkdir(a:dir,'p')
echo "Created directory: " . a:dir
else
echo "Please create directory: " . a:dir
endif
endif
endfunction
call EnsureDirExists($HOME . '/tmp/swap')
call EnsureDirExists($HOME . '/tmp/undo')
call EnsureDirExists($HOME . '/tmp/backup')