-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
165 lines (127 loc) · 5.28 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
" 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()
set packpath+=$HOME/.vim/pack/
" plugins installed via pathogen:
" https://github.com/altercation/vim-colors-solarized
" https://github.com/bling/vim-airline
" https://github.com/vim-airline/vim-airline-themes
" 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
" https://github.com/powerman/vim-plugin-autosess
"
" other plugins
" https://github.com/davidoc/taskpaper.vim.git
" put backups and swap files somewhere sane
set backupdir=~/.vim/tmp/backup,.
set directory=~/.vim/tmp/swap,.
" powerline symbols
let g:airline_powerline_fonts=1
let ttimoutlen=50
set background=dark
colorscheme solarized
let g:airline_theme='solarized'
" required for vim-powerline to work
set laststatus=2
" use the wildmenu
set wildmenu
" set wildmode=longest,list
" set wildmode=longest:full,list
" set wildmode=longest:full,full
set wildmode=longest:list,full
" 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 python file, highlight the 81st character with the colorcolumn color to
" assist with line length management
autocmd Filetype python call matchadd('ColorColumn', '\%81v', 100)
" 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
" if an elm file, expand tabs into space, set tabwidth at 2 characters, and
" set autointend commands to 2
autocmd Filetype elm 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 number and cursor line highlighting
hi CursorLineNr cterm=NONE ctermbg=0
" 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
" highlight the current column
set cursorcolumn
" color settings for column line highlighting
hi CursorColumn cterm=NONE ctermbg=0
" 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
" 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
" Strip trailing whitespace on saving php, javascript, css, scss files
autocmd BufWritePre *.php,*.css,*.scss,*.js,*.jsx %s/\s\+$//e
" directives that ansible set?
let PHP_autoformatcomment = 0
" highlighting the 81st column or the 81st character to help manage line length
" use :help ctermcolors if investigating color options
highlight ColorColumn ctermbg=LightYellow
" set cc=81
" call matchadd('ColorColumn', '\%81v', 100)