You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
762 B
Plaintext
41 lines
762 B
Plaintext
6 years ago
|
Execute (Configure NERDCommenter to support Vue files):
|
||
|
let g:ft = ''
|
||
|
function! NERDCommenter_before()
|
||
|
if &ft == 'vue'
|
||
|
let g:ft = 'vue'
|
||
|
let stack = synstack(line('.'), col('.'))
|
||
|
if len(stack) > 0
|
||
|
let syn = synIDattr((stack)[0], 'name')
|
||
|
if len(syn) > 0
|
||
|
exe 'setf ' . substitute(tolower(syn), '^vue_', '', '')
|
||
|
endif
|
||
|
endif
|
||
|
endif
|
||
|
endfunction
|
||
|
function! NERDCommenter_after()
|
||
|
if g:ft == 'vue'
|
||
|
setf vue
|
||
|
let g:ft = ''
|
||
|
endif
|
||
|
endfunction
|
||
|
|
||
|
Given vue:
|
||
|
<template>
|
||
|
<div></div>
|
||
|
</template>
|
||
|
<style>
|
||
|
.glitters { color: gold }
|
||
|
<style>
|
||
|
|
||
|
Do:
|
||
|
j\cc
|
||
|
3j\cc
|
||
|
|
||
|
Expect:
|
||
|
<template>
|
||
|
<!--<div></div>-->
|
||
|
</template>
|
||
|
<style>
|
||
|
/*.glitters { color: gold }*/
|
||
|
<style>
|