Open juancabrera opened 7 years ago
looks like you're missing setting the filetype to vue
. Open a new file and test with :set ft=vue
(this is done by the plugin automatically, no clue why it doesn't work, you may have something erasing that conf. Maybe move the plugin to the end of the list)
@posva yeah, that did the trick. But now how can I fix this on .vimrc
not sure how to do it.
Thanks!
you should add something like au BufNewFile,BufRead *.vue setf vue
but this should be added by the plugin already, I believe
I don't know if the problem here is the same as mine. I don't even know what is the expected behavior of vim-vue. But here's what I got:
Should my JS be so poorly highlighted? That is what always happened with my .html
files. I've tried running :set ft=vue
and :syntax sync fromstart
, but nothing has changed.
My .vimrc
: https://github.com/fiatjaf/dotfiles/blob/6827501b16253da63b5c64e17d29c34812326b4d/vimrc
@fiatjaf It is resolved in this PR: https://github.com/posva/vim-vue/pull/88/files
you might want to use the author's branch before the PR is merged in.
@posva Hi. I recognize " au BufNewFile,BufRead *.vue setf vue" not place on filetype.vim
And I manually insert that line. It work.
Can I ask to why? (Several time re-install..)
I use ubuntu 16.04.
Plz give me a little idia.. thankyou.
It is in ftdetect. Regarding the issue, there's a PR for it but it needs a bit more work. @adriaanzon will take a look when he can, please be patient 🙂
@yusunglee2074 How did you install vim-vue?
I will look further at this issue soon. I still need to reproduce it too...
@posva Having a similar issue here, vim installed via thoughtbot's laptop script, .vimrc managed via thoughtbot dotfiles with .local overrides, vim-vue installed via vim-plug
My issue is the highlighting just disappears while I'm working. When I type :syntax sync fromstart
it comes back. If I type :set ft=vue
it goes bland again.
thoughtbot vimrc https://github.com/thoughtbot/dotfiles/blob/master/vimrc
my appended vimrc https://github.com/joemsak/dotfiles-local/blob/master/vimrc.local
thoutbot plugins: https://github.com/thoughtbot/dotfiles/blob/master/vimrc.bundles
my plugins appended https://github.com/joemsak/dotfiles-local/blob/master/vimrc.bundles.local
I was seeing intermittent loss of syntax highlighting. The command mentioned above has solved it for me.
:syntax sync fromstart
I am experiencing the same issue. I installed vim-vue with vundle and I am not getting any syntax highlighting for .vue files unless I add au BufNewFile,BufRead *.vue setf vue
to my .vimrc.
I had the same problem.
My solution:
let g:vue_disable_pre_processors=1
autocmd FileType vue syntax sync fromstart
autocmd BufRead,BufNewFile *.vue setlocal filetype=vue.html.javascript.css.less.pug
Find what plugin was interested in vim-vue. Delete all the plugins and reinstalled them checking that vie-vue will work fine.
Same issue on Mac OS, added au BufNewFile,BufRead *.vue setf vue
to my ~/.vimrc
, restarted vim and it worked.
I'm not super familiar with the implementation of plugins, but is it possible to either run that command on install, or just include it in the README?
@pattrickrice It should already be handled by this ftdetect
file https://github.com/posva/vim-vue/blob/master/ftdetect/vue.vim, but for some reason it doesn't work for some people. No idea why, for me it works out of the box.
The latest version of Vim (patch 8.1.1762 to be precise) has added the ftdetect autocmd to their filetype.vim. I think that should solve it in places where it didn't work out of the box. Can anyone who had this issue confirm?
The latest version of Vim (patch 8.1.1762 to be precise) has added the ftdetect autocmd to their filetype.vim. I think that should solve it in places where it didn't work out of the box. Can anyone who had this issue confirm?
👍 Yes, updating Vim solved the highlighting issues for me. Thanks for the tip!
my problem is my filetype is being set to vuejs
, not vue
my solution was to add this to my .vimrc
autocmd BufRead,BufNewFile *.vue setlocal filetype=vue
@acidjazz on which version of vim are you? They changed it from vuejs to vue in a later release
@adriaanzon
Really tried to figure out what is wrong before posting this, so sorry in advance.
I started from scratch a new Vim configuration but now the
.vue
files are not being highlighted. Thought it could be a plugin incompatibility and tried removing/adding all syntax related plugins with not success. Also:syntax sync fromstart
didn't work.I'm using
VIM - Vi IMproved 7.4
and this is my.vimrc
conf:Please let me know if you see something weird so I can try. Thanks!