-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
107 lines (87 loc) · 2.94 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
" tabs as spaces
set autoindent
set autowrite
set showmatch
set wrapmargin=0
set report=1
set ts=4
set nobackup
set ignorecase
set smartcase
set nocp
set expandtab
set hlsearch
" set t_Co=256
:filetype indent off
" for when you accidentally type :W or :WQ or :Q
:cmap W w
:cmap Q q
":colorscheme solarized
":colorscheme github
":colorscheme desert
":colorscheme default
":colorscheme peachbuff
":colorscheme shine
":colorscheme zellner
" Set the search highlight colors
hi Search cterm=NONE ctermfg=grey ctermbg=blue
" Show trailing whitepace
" :highlight ExtraWhitespace ctermbg=green guibg=green
:highlight ExtraWhitespace ctermbg=green
:match ExtraWhitespace /\s\+$/
" Show tab characters
" Run :so ~/mikebin/color_demo.vim in vim to see all the possibile colors
" Note the following errors:
" E254: Cannot allocate color 255
" Seem to be related to the guibg setting.
" :highlight Tabs ctermbg=255 guibg=255
:highlight Tabs ctermbg=255
:2match Tabs /\t/
"" This is OK where line length really matters, but obscures other highlights.
"" Show characters beyond 95 width limit
":highlight OverLength ctermbg=lightgrey guibg=lightgrey
":call matchadd('OverLength', '\%>95v.\+')
" turns showmatch off
let loaded_matchparen = 1
" for mac color syntax
:syntax on
if has("autocmd")
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif
" preserve <tab> in makefiles
autocmd FileType make set noexpandtab
autocmd FileType go set noexpandtab
" highlights carriage returns (\r) as ^M at end of line
set fileformats=unix
" load vim plugins with pathogen
execute pathogen#infect()
" Highlight nextflow files as groovy
au BufNewFile,BufRead *.nf set filetype=groovy
" Highlight Jenkinsfile files as groovy
au BufNewFile,BufRead Jenkinsfile* set filetype=groovy
" Highlight json files as javascript
au BufNewFile,BufRead *.json set filetype=javascript
" Highlight cromwell conf files as wdl
au BufNewFile,BufRead *.conf set filetype=wdl
" Highlight Vagrantfile files as ruby
au BufNewFile,BufRead Vagrantfile set filetype=ruby
" see Linux Security Cookbook 7.24, pg 170 for details
augroup encrypted
au!
autocmd BufReadPre,FileReadPre *.gpg,*.asc set viminfo=
autocmd BufReadPre,FileReadPre *.gpg,*.asc set noswapfile
autocmd BufReadPre,FileReadPre *.gpg set bin
autocmd BufReadPre,FileReadPre *.gpg,*.asc let ch_save = &ch|set ch=2
autocmd BufReadPost,FileReadPost *.gpg,*.asc
\ '[,']!sh -c 'gpg --decrypt 2> /dev/null'
autocmd BufReadPost,FileReadPost *.gpg set nobin
autocmd BufReadPost,FileReadPost *.gpg,*.asc
\ let &ch = ch_save|unlet ch_save
autocmd BufReadPost,FileReadPost *.gpg,*.asc
\ execute ":doautocmd BufReadPost " . expand("%:r")
autocmd BufWritePre,FileWritePre *.gpg
\ '[,']!sh -c 'gpg --default-recipient-self -e 2>/dev/null'
autocmd BufWritePre,FileWritePre *.asc
\ '[,']!sh -c 'gpg --default-recipient-self -e -a 2>/dev/null'
autocmd BufWritePost,FileWritePost *.gpg,*.asc u
augroup END