diff --git a/after/plugin/dracula.vim b/after/plugin/dracula.vim index 8a32e27..e4f7991 100644 --- a/after/plugin/dracula.vim +++ b/after/plugin/dracula.vim @@ -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 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 diff --git a/after/syntax/css.vim b/after/syntax/css.vim index ad8f01e..cca9679 100644 --- a/after/syntax/css.vim +++ b/after/syntax/css.vim @@ -1,4 +1,4 @@ -if ! exists('b:current_syntax') || b:current_syntax !=# 'css' +if dracula#should_abort('css') finish endif diff --git a/after/syntax/gitcommit.vim b/after/syntax/gitcommit.vim index 4959f4e..08099e5 100644 --- a/after/syntax/gitcommit.vim +++ b/after/syntax/gitcommit.vim @@ -1,4 +1,4 @@ -if ! exists('b:current_syntax') || b:current_syntax !=# 'gitcommit' +if dracula#should_abort('gitcommit') finish endif diff --git a/after/syntax/html.vim b/after/syntax/html.vim index b9edef4..243aef6 100644 --- a/after/syntax/html.vim +++ b/after/syntax/html.vim @@ -1,4 +1,4 @@ -if ! exists('b:current_syntax') || b:current_syntax !=# 'html' +if dracula#should_abort('html') finish endif diff --git a/after/syntax/javascript.vim b/after/syntax/javascript.vim index ce1f405..025c34a 100644 --- a/after/syntax/javascript.vim +++ b/after/syntax/javascript.vim @@ -1,4 +1,4 @@ -if ! exists('b:current_syntax') || b:current_syntax !=# 'javascript' +if dracula#should_abort('javascript') finish endif diff --git a/after/syntax/markdown.vim b/after/syntax/markdown.vim index d287393..60b6457 100644 --- a/after/syntax/markdown.vim +++ b/after/syntax/markdown.vim @@ -1,5 +1,5 @@ -if ! exists('b:current_syntax') - finish +if dracula#should_abort('markdown', 'mkd') + finish endif if b:current_syntax ==# 'mkd' diff --git a/after/syntax/ocaml.vim b/after/syntax/ocaml.vim index 591391b..60c76c9 100644 --- a/after/syntax/ocaml.vim +++ b/after/syntax/ocaml.vim @@ -1,4 +1,4 @@ -if ! exists('b:current_syntax') || b:current_syntax !=# 'ocaml' +if dracula#should_abort('ocaml') finish endif diff --git a/after/syntax/php.vim b/after/syntax/php.vim index 19d86e2..501aa1a 100644 --- a/after/syntax/php.vim +++ b/after/syntax/php.vim @@ -1,4 +1,4 @@ -if ! exists('b:current_syntax') || b:current_syntax !=# 'php' +if dracula#should_abort('php') finish endif diff --git a/after/syntax/ruby.vim b/after/syntax/ruby.vim index 1a159ca..fec0058 100644 --- a/after/syntax/ruby.vim +++ b/after/syntax/ruby.vim @@ -1,4 +1,4 @@ -if ! exists('b:current_syntax') || b:current_syntax !=# 'ruby' +if dracula#should_abort('ruby') finish endif diff --git a/after/syntax/sass.vim b/after/syntax/sass.vim index 711f07c..35a810f 100644 --- a/after/syntax/sass.vim +++ b/after/syntax/sass.vim @@ -1,4 +1,4 @@ -if ! exists('b:current_syntax') || b:current_syntax !=# 'sass' +if dracula#should_abort('sass') finish endif diff --git a/after/syntax/typescript.vim b/after/syntax/typescript.vim index 7013c76..badd0ee 100644 --- a/after/syntax/typescript.vim +++ b/after/syntax/typescript.vim @@ -1,4 +1,4 @@ -if ! exists('b:current_syntax') || b:current_syntax !=# 'typescript' +if dracula#should_abort('typescript') finish endif diff --git a/after/syntax/typescriptreact.vim b/after/syntax/typescriptreact.vim index f83addf..66579d9 100644 --- a/after/syntax/typescriptreact.vim +++ b/after/syntax/typescriptreact.vim @@ -1,4 +1,4 @@ -if ! exists('b:current_syntax') || b:current_syntax !=# 'typescriptreact' +if dracula#should_abort('typescriptreact') finish endif diff --git a/after/syntax/vim.vim b/after/syntax/vim.vim index 940ecb6..946efb7 100644 --- a/after/syntax/vim.vim +++ b/after/syntax/vim.vim @@ -1,4 +1,4 @@ -if ! exists('b:current_syntax') || b:current_syntax !=# 'vim' +if dracula#should_abort('vim') finish endif diff --git a/after/syntax/yaml.vim b/after/syntax/yaml.vim index 33f4289..fedc41f 100644 --- a/after/syntax/yaml.vim +++ b/after/syntax/yaml.vim @@ -1,4 +1,4 @@ -if ! exists('b:current_syntax') || b:current_syntax !=# 'yaml' +if dracula#should_abort('yaml') finish endif diff --git a/autoload/dracula.vim b/autoload/dracula.vim new file mode 100644 index 0000000..faad6fc --- /dev/null +++ b/autoload/dracula.vim @@ -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 diff --git a/colors/dracula.vim b/colors/dracula.vim index 666a82c..ab03791 100644 --- a/colors/dracula.vim +++ b/colors/dracula.vim @@ -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)