

GitHub - posva/vim-vue: Syntax Highlight for Vue.js components
source link: https://github.com/posva/vim-vue
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

vim-vue
Vim syntax highlighting for Vue components.
This was initially forked from darthmall/vim-vue. I already have an implementation for this but found his code much cleaner. That's why I created a new version instead of a PR.
Installation
Install with Vundle
Plugin 'posva/vim-vue'
Install with Pathogen
cd ~/.vim/bundle && \
git clone https://github.com/posva/vim-vue.git
Install without a plugin manager (Vim 8)
git clone https://github.com/posva/vim-vue.git ~/.vim/pack/plugins/start/vim-vue
Integration with Syntastic or ALE
Currently only eslint
is available. Please make sure
eslint and
eslint-plugin-vue are installed
and properly configured:
npm i -g eslint eslint-plugin-vue
Contributing
If your language is not getting highlighted open an issue or a PR with the fix.
You only need to add a line to the syntax/vue.vim
file.
Don't forget to write Vader tests for
the code you write. You can run the tests by executing make test
in the
terminal.
Where is Jade?
Jade has been renamed to pug.
Therefore you have to replace all your jade
occurrences with pug
. The new
plugin for pug
can be found on the same repository
(the name has already been updated).
How to use commenting functionality with multiple languages in Vue files?
tcomment
tcomment has some support for Vue files with multiple languages, without any extra configuration.
caw.vim
caw.vim features built-in support for file context through context_filetype.vim. Just install both plugins and context-aware commenting will work in most files. The fenced code is detected by predefined regular expressions.
NERDCommenter
To use NERDCommenter with Vue files, you can use its "hooks" feature to temporarily change the filetype. Click for an example.
()
&
stack ((), ())
(stack)
((stack)[], )
()
. ((), , , )
()
Vim slows down when using this plugin How can I fix that?
When checking for pre-processor languages, multiple syntax highlighting checks are done, which can slow down vim. You can trim down which pre-processors to use by setting g:vue_pre_processors
to a whitelist of languages to support:
let g:vue_pre_processors = ['pug', 'scss']
To disable pre-processor languages altogether (only highlight HTML, JavaScript, and CSS):
let g:vue_pre_processors = []
Available pre-processors are: coffee, haml, handlebars, less, pug, sass, scss, slm, stylus, typescript
When g:vue_pre_processors
is set to 'detect_on_enter' instead of a list, vim-vue will detect the pre-processors used when a file is opened, and load only their syntax files.
let g:vue_pre_processors = 'detect_on_enter'
Recommend
-
14
Hugo has a built-in syntax highlight that uses Chroma, a library written in go. As much as I love libraries such as highlight.js, and even if they have plenty of crazy go...
-
6
✏️ Edit Show NotesIt's another Syntax Highlight. In this episode, Scott and Wes take a look at portfolios and websites and evaluate them from the...
-
7
✏️ Edit Show NotesIn this episode of Syntax, Scott and Wes review your portfolios! Sanity - Sponsor Sanity.io is a real-time head...
-
18
Vim Highlighter Introduction Highlighting keywords or lines can be useful when analyzing code, reviewing summaries, and quickly comparing spellings. This plugin extends Vim's highlighting capabilities with additional fea...
-
10
✏️ Edit Show NotesIn this episode of Syntax, Scott and Wes review your portfolios and websites including some from Harryxli, Austin Baird, Jacks...
-
4
vim-lsp-cxx-highlight vim-lsp-cxx-highlight is a vim plugin that provides C/C++/Cuda/ObjC semantic highlighting using the language server protocol. Introduction How does this plugin differentiate itself from
-
6
Mar 30th, 2022Syntax Highlight👇 Download Show✏️ Edit Show Notes
-
9
Aug 31st, 2022Syntax Highlight👇 Download Show
-
8
Member
-
6
Notepad++ Syntax Highlight for Go · GitHub Instantly share code, notes, and snippets. Notepad++ Syntax Highlight for Go...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK