Code Monkey home page Code Monkey logo

vim-jinja's Introduction

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

vim-jinja's People

Contributors

mitsuhiko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

vim-jinja's Issues

import keyword also helps autodetecting jinja

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...

E108: No such variable: "b:did_jinja_autodetect"

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.