-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
80 lines (66 loc) · 2.37 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
syntax on " enabled syntax highlighting
set nocompatible
set backspace=indent,eol,start
set history=100
set ruler
set showcmd " show incomplete commands
set number " line numbers
set ai " autoindent
set incsearch " incremental searching
set nowrap " never wrap lines
set autoindent " always indent
set esckeys " Allow cursor keys in insert mode
set ttyfast " optimized for fast terminals
set encoding=utf-8 nobomb " use UTF-8 without BOM
set mouse=a " Enable mouse in all modes
set noerrorbells
set nostartofline " Don't reset cursor to start of line when moving around
set showmode " Show current mode
set title " Show the filename in window titlebar
" don't add empty newlines at the end of the files
set binary
set noeol
set backup
" Centralize backups, swapfiles, and undo history
set backupdir=~/.vim/backups
set directory=~/.vim/swaps
set undodir=~/.vim/undo
" Colors and scheme
set background=dark
colorscheme elflord
" DEFAULTS
set tabstop=4 " sets tabs to 4 characters
set shiftwidth=4
set expandtab
set softtabstop=4 " makes the spaces feel like real tabs
" CSS (tabs = 2, lines = 79)
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType css set sw=2
autocmd FileType css set ts=2
autocmd FileType css set sts=2
" JavaScript (tabs = 4, lines = 79)
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType javascript set sw=4
autocmd FileType javascript set ts=4
autocmd FileType javascript set sts=4
" autocmd FileType javascript set tw=79
" Jade
autocmd FileType jade set omnifunc=jadecomplete#CompleteJade
autocmd FileType jade set sw=2
autocmd FileType jade set ts=2
autocmd FileType jade set sts=2
" ejs
autocmd FileType ejs set sw=2
autocmd FileType ejs set ts=2
autocmd FileType ejs set sts=2
" Highlight current line only in insert mode
autocmd InsertLeave * set nocursorline
autocmd InsertEnter * set cursorline
" Makefiles require TAB instead of whitespace
autocmd FileType make setlocal noexpandtab
" Highlight cursor
highlight CursorLine ctermbg=8 cterm=NONE
" Load a local configuration file if it exists
if filereadable(".vimrc.local")
source .vimrc.local
endif