-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
128 lines (97 loc) · 4.08 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
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
" Richard Esguerra's .vimrc
" inspired by <http://www.linuxjournal.com/article/3805>
" inspired by <http://www.stripey.com/vim/vimrc.html>
" enable 256 color support
set t_Co=256 " needed to show colors of themes
" https://github.com/tpope/vim-pathogen
execute pathogen#infect()
" plugins installed via pathogen:
" https://github.com/altercation/vim-colors-solarized
" https://github.com/bling/vim-airline
" https://github.com/nvie/vim-flake8
" https://github.com/mkitt/tabline.vim
" https://github.com/digitaltoad/vim-jade
" https://github.com/pangloss/vim-javascript.git
" put backups and swap files somewhere sane
set backupdir=~/.vim/tmp/backup,.
set directory=~/.vim/tmp/swap,.
" required for vim-powerline to work
set laststatus=2
" turn filetype and plugin scripts on; indent left out for momentary sanity
filetype plugin on
" sets tabwidth at 4 characters
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
" set md as markdown filetype and not modulo2 as per tpope advice here:
" https://github.com/tpope/vim-markdown
autocmd BufNewFile,BufReadPost *.md set filetype=markdown
" if a python file, expand tabs into spaces, set tabwidth at 4 characters, and
" set autoindent commands to 4
autocmd Filetype python setlocal expandtab tabstop=4 shiftwidth=4
" if a jinja2 file, expand tabs into spaces, set tabwidth at 2 characters, and
" set autoindent commands to 2
autocmd Filetype htmldjango setlocal expandtab tabstop=2 softtabstop=2 shiftwidth=2
" if an html file, expand tabs into space, set tabwidth at 2 characters, and
" set autointend commands to 2
autocmd Filetype html setlocal expandtab tabstop=2 softtabstop=2 shiftwidth=2
" if a javascript file, expand tabs into space, set tabwidth at 2 characters, and
" set autointend commands to 2
autocmd Filetype javascript setlocal expandtab tabstop=2 softtabstop=2 shiftwidth=2
" if a jade file, expand tabs into space, set tabwidth at 2 characters, and
" set autointend commands to 2
autocmd Filetype jade setlocal expandtab tabstop=2 softtabstop=2 shiftwidth=2
" if a json file, expand tabs into space, set tabwidth at 2 characters, and
" set autointend commands to 2
autocmd Filetype json setlocal expandtab tabstop=2 softtabstop=2 shiftwidth=2
" turn on autoindent
set autoindent
" always use line numbers
set number
" use incremental search
set incsearch
" use search highlighting; highlight items you search for
set hlsearch
" use case insensitive search by default; remove with :set noignorecase
set ignorecase
" use syntax highlighting
syntax enable
" always show tab bar
set showtabline=2
" set command line height to 2
set ch=2
" soft wrap = wrap to a new line between words, not between characters
" set wrap linebreak textwidth=0
" highlight the current line
set cursorline
" color settings for cursor line highlighting
" hi CursorLine cterm=NONE ctermbg=darkgrey
" old setting: hi CursorLine cterm=NONE ctermbg=darkgrey
" Full example parameters: hi CursorLine cterm=NONE ctermbg=darkgrey ctermfg=white guibg=darkred
" color settings for column line highlighting
":hi CursorColumn cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred
" type :gf over filename to get list of colors
" $VIMRUNTIME/rgb.txt
" send commmands to change the title of the screen page when opening or
" closing a file
" !screen -X title @%
" :au[tocmd] [group] {event} {pat} [nested] {cmd}
" autocmd BufNewFile * silent !screen -X title vim
" autocmd BufRead * silent !screen -X title %
" autocmd BufWrite * silent !screen -X title %
" autocmd VimLeave * silent !screen -X title bash
" close vim if the only window left open is a NERDTree
" from: https://github.com/scrooloose/nerdtree
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
" powerline symbols
let g:airline_powerline_fonts=1
let ttimoutlen=50
set background=dark
colorscheme solarized
let g:airline_theme='solarized'
" when using splits, open the new split to the right and bottom
" instead of default, which pushes current working buffer to the right
" from: https://robots.thoughtbot.com/vim-splits-move-faster-and-more-naturally
set splitbelow
set splitright