address issues #82, #83, #84 (#85)

* address issues #82, #83, #84

* address code review issues

* remove fzf autocmd per code review comments
This commit is contained in:
Derek Sifford 2018-05-23 22:52:06 -04:00 committed by GitHub
parent c01ceb9a84
commit b5548cd0af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 31 additions and 22 deletions

View file

@ -1,3 +1,7 @@
if dracula#should_abort()
finish
endif
" Fzf: {{{
if exists('g:loaded_fzf') && ! exists('g:fzf_colors')
let g:fzf_colors = {
@ -14,16 +18,12 @@ if exists('g:loaded_fzf') && ! exists('g:fzf_colors')
\ 'marker': ['fg', 'Keyword'],
\ 'spinner': ['fg', 'Label'],
\ 'header': ['fg', 'Comment'] }
augroup dracula_fzf
autocmd!
autocmd FileType fzf set laststatus=0 noshowmode noruler
\| autocmd BufLeave <buffer> set laststatus=2 showmode ruler
augroup END
endif
"}}}
" GitGutter: {{{
" FIXME: This can be removed once airblade/vim-gitgutter#520 closes
" see: https://github.com/airblade/vim-gitgutter/issues/520#issuecomment-389931281
if exists('g:gitgutter_enabled')
hi! link GitGutterAdd DraculaGreen
hi! link GitGutterChange DraculaYellow

View file

@ -1,4 +1,4 @@
if ! exists('b:current_syntax') || b:current_syntax !=# 'css'
if dracula#should_abort('css')
finish
endif

View file

@ -1,4 +1,4 @@
if ! exists('b:current_syntax') || b:current_syntax !=# 'gitcommit'
if dracula#should_abort('gitcommit')
finish
endif

View file

@ -1,4 +1,4 @@
if ! exists('b:current_syntax') || b:current_syntax !=# 'html'
if dracula#should_abort('html')
finish
endif

View file

@ -1,4 +1,4 @@
if ! exists('b:current_syntax') || b:current_syntax !=# 'javascript'
if dracula#should_abort('javascript')
finish
endif

View file

@ -1,5 +1,5 @@
if ! exists('b:current_syntax')
finish
if dracula#should_abort('markdown', 'mkd')
finish
endif
if b:current_syntax ==# 'mkd'

View file

@ -1,4 +1,4 @@
if ! exists('b:current_syntax') || b:current_syntax !=# 'ocaml'
if dracula#should_abort('ocaml')
finish
endif

View file

@ -1,4 +1,4 @@
if ! exists('b:current_syntax') || b:current_syntax !=# 'php'
if dracula#should_abort('php')
finish
endif

View file

@ -1,4 +1,4 @@
if ! exists('b:current_syntax') || b:current_syntax !=# 'ruby'
if dracula#should_abort('ruby')
finish
endif

View file

@ -1,4 +1,4 @@
if ! exists('b:current_syntax') || b:current_syntax !=# 'sass'
if dracula#should_abort('sass')
finish
endif

View file

@ -1,4 +1,4 @@
if ! exists('b:current_syntax') || b:current_syntax !=# 'typescript'
if dracula#should_abort('typescript')
finish
endif

View file

@ -1,4 +1,4 @@
if ! exists('b:current_syntax') || b:current_syntax !=# 'typescriptreact'
if dracula#should_abort('typescriptreact')
finish
endif

View file

@ -1,4 +1,4 @@
if ! exists('b:current_syntax') || b:current_syntax !=# 'vim'
if dracula#should_abort('vim')
finish
endif

View file

@ -1,4 +1,4 @@
if ! exists('b:current_syntax') || b:current_syntax !=# 'yaml'
if dracula#should_abort('yaml')
finish
endif

10
autoload/dracula.vim Normal file
View file

@ -0,0 +1,10 @@
" Helper function that takes a variadic list of filetypes as args and returns
" whether or not the execution of the ftplugin should be aborted.
func! dracula#should_abort(...)
if ! exists('g:colors_name') || g:colors_name !=# 'dracula'
return 1
elseif a:0 > 0 && (! exists('b:current_syntax') || index(a:000, b:current_syntax) == -1)
return 1
endif
return 0
endfunction

View file

@ -210,8 +210,7 @@ call s:h('DraculaRedInverse', s:fg, s:red)
call s:h('DraculaYellow', s:yellow)
call s:h('DraculaYellowItalic', s:yellow, s:none, [s:attrs.italic])
call s:h('DraculaError', s:red, s:none, [s:attrs.undercurl], s:red)
call s:h('DraculaWarn', s:orange, s:none, [s:attrs.undercurl], s:orange)
call s:h('DraculaError', s:red, s:none, [], s:red)
call s:h('DraculaErrorLine', s:none, s:none, [s:attrs.undercurl], s:red)
call s:h('DraculaWarnLine', s:none, s:none, [s:attrs.undercurl], s:orange)