mitsuhiko / vim-jinja Goto Github PK
View Code? Open in Web Editor NEWRepository for Jinja support in vim.
License: Other
Repository for Jinja support in vim.
License: Other
Jinja for Vim ------------- Jinja for Vim. This is the updated version unlike the one on vimscripts. Features -------- - Syntax highlighting - Automatic detection of Jinja HTML templates that plays well with Django and other HTML files. - Indent support Installation ------------ If you don't have a preferred installation method, I recommend installing pathogen.vim, and then simply copy and paste: cd ~/.vim/bundle git clone git://github.com/mitsuhiko/vim-jinja.git Configuration ------------- g:htmljinja_disable_detection (Default: 0) If set the plugin will not try to autodetect HTML files that contain Jinja code. g:htmljinja_disable_html_upgrade (Default: 0) If set the plugin will not try to check on each write of an HTML file it it should upgrade to htmljinja
I think your plugin duplicates some efforts that Vim already contains, namely dotted filetypes. Especially why do you need a new filetype and not use ft=html.jinja?
http://vimdoc.sourceforge.net/htmldoc/options.html#'filetype'
This is in relation to SirVer/ultisnips#137. Could you please have a look and comment there and here?
look for import
keyword while autodetecting jinja:
diff --git a/plugin/htmljinja.vim b/plugin/htmljinja.vim
index 3e9cc5c..beea5c5 100644
--- a/plugin/htmljinja.vim
+++ b/plugin/htmljinja.vim
@@ -26,7 +26,7 @@ fun! s:TryDetectJinja()
let n = 1
while n < 50 && n < line("$")
let line = getline(n)
- if line =~ '{%\s*\(extends\|block\|macro\|set\|if\|for\|include\|trans\)\>' || line =~ '{{\s*\S+[|(]'
+ if line =~ '{%\s*\(extends\|block\|macro\|set\|if\|for\|include\|trans\|import\)\>' || line =~ '{{\s*\S+[|(]'
setlocal filetype=htmljinja
return
endif
ps. but it seems that this plugin is all but abandoned, so moving on to another one...
I'm editing an HTML file in vim 8.0.0003. The first :w
produced this:
"index.html" 322L, 11154C written
Error detected while processing function <SNR>90_ConsiderSwitchingToJinjaAgain:
line 1:
E108: No such variable: "b:did_jinja_autodetect"
Press ENTER or type command to continue
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.