-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
101 lines (74 loc) · 1.82 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
" Don't make vim vi-compatible
set nocompatible
" Enable filetype plugin, indentation, and detection
filetype plugin indent on
" Mapleader
let mapleader=","
" Enable syntax highlighting
syntax on
" Color scheme
set t_Co=256 " Enable full color support
set background=dark
colorscheme molotov
" Display cursor position
set ruler
" Highlight current line
set cursorline
" Display incomplete commands
set showcmd
" Indentation
set expandtab
set shiftwidth=2
set softtabstop=2
set autoindent
" Enable better command line <TAB> completion
set wildmenu
" Allow backspacing over everything in insert mode
set backspace=indent,eol,start
" Line numbers
set number
set numberwidth=5
" Line length ruler
set textwidth=80
set colorcolumn=+1
" Remap arrow keys
nnoremap <Left> :echoe "Don't be an idiot."<CR>
nnoremap <Right> :echoe "Don't be an idiot."<CR>
nnoremap <Up> :echoe "Don't be an idiot."<CR>
nnoremap <Down> :echoe "Don't be an idiot."<CR>
" New window goes below
set splitbelow
" New window goes right
set splitright
" Scroll offsets
set scrolloff=3
set sidescrolloff=3
set sidescroll=1
" Don't wrap lines
set nowrap
" Hide buffers instead of closing
set hidden
" History limit
set history=1000
" Show filename in window title bar
set title
" Searching
set ignorecase " case insensitive
set hlsearch " highlight search terms
set incsearch " show matches as you type
" Scroll viewport faster
nnoremap <C-e> 3<C-e>
nnoremap <C-y> 3<C-y>
" Set local directories
set backupdir=~/.vim/backups
set directory=~/.vim/swaps
set undodir=~/.vim/undo
" Filetypes
" Handlebars
autocmd BufRead,BufNewFile *.hbs,*.handlebars,*.hbs.erb,*.handlebars.erb set ft=html syntax=html
" Trim trailing whitespace on save
autocmd BufWritePre * :%s/\s\+$//e
" Load local settings if they exist
if filereadable(glob("~/.vimrc.local"))
source ~/.vimrc.local
endif