Closed pjs59 closed 5 years ago
Can you show the directory structure of wherever dracula is installed?
An update to draculatheme.com that hasn't gone live yet includes these instructions for vundle users:
Plugin 'dracula/vim', { 'name': 'dracula' }
:PluginInstall
Here's the tree structure of the whole of my .vim
directory.
βββ bundle
βΒ Β βββ vim
βΒ Β βΒ Β βββ after
βΒ Β βΒ Β βΒ Β βββ plugin
βΒ Β βΒ Β βΒ Β βΒ Β βββ dracula.vim
βΒ Β βΒ Β βΒ Β βββ syntax
βΒ Β βΒ Β βΒ Β βββ css.vim
βΒ Β βΒ Β βΒ Β βββ gitcommit.vim
βΒ Β βΒ Β βΒ Β βββ html.vim
βΒ Β βΒ Β βΒ Β βββ javascript.vim
βΒ Β βΒ Β βΒ Β βββ json.vim
βΒ Β βΒ Β βΒ Β βββ markdown.vim
βΒ Β βΒ Β βΒ Β βββ ocaml.vim
βΒ Β βΒ Β βΒ Β βββ perl.vim
βΒ Β βΒ Β βΒ Β βββ php.vim
βΒ Β βΒ Β βΒ Β βββ plantuml.vim
βΒ Β βΒ Β βΒ Β βββ python.vim
βΒ Β βΒ Β βΒ Β βββ ruby.vim
βΒ Β βΒ Β βΒ Β βββ rust.vim
βΒ Β βΒ Β βΒ Β βββ sass.vim
βΒ Β βΒ Β βΒ Β βββ sh.vim
βΒ Β βΒ Β βΒ Β βββ tex.vim
βΒ Β βΒ Β βΒ Β βββ tsx.vim
βΒ Β βΒ Β βΒ Β βββ typescript.vim
βΒ Β βΒ Β βΒ Β βββ vim.vim
βΒ Β βΒ Β βΒ Β βββ xml.vim
βΒ Β βΒ Β βΒ Β βββ yaml.vim
βΒ Β βΒ Β βββ autoload
βΒ Β βΒ Β βΒ Β βββ airline
βΒ Β βΒ Β βΒ Β βΒ Β βββ themes
βΒ Β βΒ Β βΒ Β βΒ Β βββ dracula.vim
βΒ Β βΒ Β βΒ Β βββ dracula.vim
βΒ Β βΒ Β βΒ Β βββ lightline
βΒ Β βΒ Β βΒ Β βββ colorscheme
βΒ Β βΒ Β βΒ Β βββ dracula.vim
βΒ Β βΒ Β βββ colors
βΒ Β βΒ Β βΒ Β βββ dracula.vim
βΒ Β βΒ Β βββ doc
βΒ Β βΒ Β βΒ Β βββ dracula.txt
βΒ Β βΒ Β βΒ Β βββ tags
βΒ Β βΒ Β βββ LICENSE
βΒ Β βΒ Β βββ README.md
βΒ Β βββ Vundle.vim
βΒ Β βββ autoload
βΒ Β βΒ Β βββ vundle
βΒ Β βΒ Β βΒ Β βββ config.vim
βΒ Β βΒ Β βΒ Β βββ installer.vim
βΒ Β βΒ Β βΒ Β βββ scripts.vim
βΒ Β βΒ Β βββ vundle.vim
βΒ Β βββ changelog.md
βΒ Β βββ CONTRIBUTING.md
βΒ Β βββ doc
βΒ Β βΒ Β βββ tags
βΒ Β βΒ Β βββ vundle.txt
βΒ Β βββ ftplugin
βΒ Β βΒ Β βββ vundlelog.vim
βΒ Β βββ LICENSE-MIT.txt
βΒ Β βββ README_KR.md
βΒ Β βββ README.md
βΒ Β βββ README_ZH_CN.md
βΒ Β βββ README_ZH_TW.md
βΒ Β βββ syntax
βΒ Β βΒ Β βββ vundlelog.vim
βΒ Β βββ test
βΒ Β βββ files
βΒ Β βΒ Β βββ test.erl
βΒ Β βββ minirc.vim
βΒ Β βββ vimrc
βββ colors
βββ dracula.vim
Just tried adding , { 'name': 'dracula' }
- no change.
You have two colors/dracula.vim
files. The first one (the outermost one nearest the top level) is being loaded first. Delete that.
Still the same - i.e. works as soon as I run :colorscheme dracula
inside vim, but not otherwise. (If I comment out Plugin 'dracula/vim', { 'name': 'dracula' }
in my vimrc then :colorscheme dracula
no longer works though.)
Ah, so I should have guessed this earlier given that it works with :colorscheme dracula
inside vim, but the following vimrc now works:
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'dracula/vim'
call vundle#end()
filetype plugin indent on
colorscheme dracula
Sounds like your issue is resolved @pjs59 ? Going to close; please re-open if not resolved.
Strange though. Am I really the only one who's had to do this? I didn't mention, but this has actually resolved the same issue on two different machines I use. Could be worth adding as a troubleshooting measure somewhere?
Strange that having two different colorscheme files for the same colorscheme in multiple locations causes issues? To be honest, I'm not surprised, even if it seems like it could work: the errors themselves are bizarre, but having the same file in two different similar spots seems like a recipe for a problem to me.
In general, the situation seems similar to using more than one plugin-manager, or to manually managing plugins alongside a plugin-manager.
@pjs59 Can you clarify how you ended up in this situation (~/.vim/colors/dracula
and vundle dracula) so we can identify what needs to be clarified to future installees?
It wasn't deleting one of the two copies that resolved the issue though. It was adding colorscheme dracula
to the bottom of my vimrc, after the end vundle line, that did it.
On how I ended up with two copies: I only tried the manual version, adding ~/.vim/colors/dracula
, after I'd failed to get dracula to work via vundle. I should have deleted the vundle version when I did that.
In your original post, you said this was your vimrc
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'dracula/vim'
call vundle#end()
filetype plugin indent on
So I'm not sure that any of us caught that colorscheme dracula
was inside the vundle lines. That said, the screenshot on the Vundle repo says plugins will be available after vundle#end
. Perhaps the real problem is that this was not made clear?
For the non-vundle users, we have notes on the README and in the help on how to use, e.g., packages with vim8. The crucial change from v2.0 requires that dracula is fully on the runtime path before colorscheme dracula
executesβthis is not always the case during execution of vimrc, particularly with packages. However, if you place the files into your .vim
directory directly (like in the old days), theoretically things will work without issue.
Just adding a bit to @benknoble's response.
@pjs59 It appears that you might be new to vim. Vim is tricky at baseline. There's lots of places where loading your init files can go wrong and a lot of quirks that take time to get used to.
It sounds like the problem you had was twofold:
colorscheme dracula
before vundle fixed # 1.Finally: Just a quick comment about your pasted configuration...
Why do you set filetype off
and then filetype plugin indent on
? That's a redundancy. Looks like it's likely a copy/paste from stackoverflow without understanding what it does.
So in short: Because this can be attributed to growing pains. We're not going to adjust our docs. They should be clear enough.
@dsifford Re filetype
, it is indeed a copy and paste, but from https://github.com/VundleVim/Vundle.vim (both lines are annotated with 'required'). The whole of my current vimrc is copied from there.
I'm not new to vim (I've been using it for about 10 years), but I am new to customizing vim, which is maybe what you meant. I don't know why that's relevant though. Shouldn't anyone be able to follow the instructions and get it installed?
When you say 'You weren't initially registering this plugin correctly in your runtimepath', I'm not sure what I could have done differently given the publicly available documentation? I followed the instructions for using vundle and then the instructions for using dracula with vundle to the letter. I admit I went off piste by adding .vim/colors/dracula.vim
, but that was only after I'd established that it wasn't working under the combination of the vundle and dracula instructions. And I still can't get it to work without colorscheme dracula
at the end of my vimrc. What I'm trying to say is I don't know how just following the vundle and dracula instructions could ever have got me to a point where this was working.
As I've mentioned, the instructions on draculatheme.com/vim are out of date wrt Vundle and a few other plugin-management techniques. I've opened https://github.com/dracula/dracula.github.io/issues/85 to address this, which should get changes from https://github.com/dracula/dracula.github.io/pull/75 onto the site.
In the meantime, I believe the core difficulties were
vundle#end
has been call
ed.autoload
ed files that need to be on the 'runtimepath'
before colorscheme dracula
is called. The variables that caused your failure are loaded as part of these files.These two things combine to mean that colorscheme dracula
must come after vundle#end
. Even in the updated instructions, the maintainers assume that users of Vundle (or other plugin-managers) know how their manager/setup works.
How would you suggest we clarify this? Would asking Vundle to be more clear about its plugin-loading be helpful?
I think the main thing is that I didn't see anywhere in either the vundle documentation or the dracula documentation that colorscheme dracula
needed to be in the vimrc file (on dracula it's mentioned for manual installation but not vundle). Perhaps I missed it? I don't know where it would be best to put it (vundle if it's standard for all colour schemes? dracula if not?).
Aha: that is a far different source of confusion. Do you expect vim to know what colorscheme you want? If so, I recommend checking out :help usr_06.txt
, particularly :help 06.3
.
That help file is very interesting, thank you for that. But I don't think I agree with the premise of the question, which seems to me to be that the other two steps in the dracula/vundle installation guide (Plugin '...'
and :PluginInstall
) are less obvious than colorscheme dracula
. I mean, I don't see how your argument doesn't extend to 'Why have any installation instructions?' (Do you expect vundle to know to load the plugin?' 'Do you expect the plugin magically to be installed?')
Ok, let me back up and try to make sure I'm on your page.
1) You ran PluginInstall via Vundle
2) You expected dracula to load, but it didn't
3) You discovered that you need to use colorscheme dracula
to load dracula
Is that a (really brief) summary of what happened?
The truth is, yes, I think that the command colorscheme dracula
is fairly obvious to vim users looking at colorschemes. In addition, the very beginning of doc/dracula.txt mentions it.
Would you prefer to see it in the README/website as well?
@pjs59 Just wanted to drop you a note to say thanks for having the time and patience to help us improve Dracula. We care about our community of users and appreciate your feedback.
[Copied this over from stackoverflow - https://stackoverflow.com/questions/57219822/custom-syntax-highlighting-not-working-via-vimrc.]
I have dracula.vim in my
~/.vim/colors
directory, and if I set:colorscheme dracula
inside vim, then it works. However, if I try to replicate this via vimrc, I get errors.Specifically, if I make my
~/.vimrc
file either:or just:
I get the following errors when I run vim:
After the errors, vim opens but with no syntax highlighting.
I've also tried to use vundle. I've cloned vundle per the instructions on the git, and made my ~/.vimrc as follows:
I've then run
:PluginInstall
with success. But no syntax highlighting. If I add the line syntax on to my vimrc, then I do get syntax highlighting, but it's the default colours rather than the dracula theme.For reference,
I downloaded
dracula.vim
from the git and (separately) installed via vundle yesterday, 2019-07-26, so they should be the latest versions.