tweekmonster / django-plus.vim Goto Github PK
View Code? Open in Web Editor NEW:guitar: Improvements to the handling of Django related files in Vim
License: MIT License
:guitar: Improvements to the handling of Django related files in Vim
License: MIT License
{% extends "base.html" %} {% load static %} {% load cache %} {% block content %} {% cache 500 product_list %}
<div class="container">
<ul>
{% for product in object_list %}
<li><a href="{% url 'product_detail' product.id %}">{{ product.title }}</a></li>
{% endfor %}
</ul>
</div>
{% endcache %} {% endblock %}
all the blocks are lined up in one line, and also it is necessary that the li tag has an indent
Is it intentionally?
Or you just forgot to include it in after/syntax/python.vim syntax match djangoModelField #\k\+Field\># containedin=TOP
b:is_django
show equal 1, UltiSnips
still used python.snippets.
:set filetype
show equal python
.
when detected project is django, can automatically change filetype?
i use ycm + ultisnips.
Is this what is the problem ?
When opening a .py file from NERDtree or :Sex not yet in the buffer I get the following error:
Error detected while processing function djangoplus#detect#filetype..<SNR>108_simple_django_project:
line 6:
E867: (NFA) Unknown operation '\zo'
E68: Invalid character after \z
After hitting enter it opens the file just fine. It's entirely possible something else is conflicting or I'm missing something obvious. I tend to use NERDTree a lot to switch between files.
open a template html, the syntax is jinja.
edit a file is not saved on the hard disk,only in the buffer, the syntax is html.
Like in the cookiecutter project, the settings structure is arranged this way:
settings/
common.py
local.py
production.py
test.py
Although I'm able to use these completions from the templates themselves using {% extends %}
I don't get any when using render()
, get_template()
and friends.
I recently updated django-plus in my vim instance and now I'm getting the following error. I currently have the latest version of UltiSnips and django-plus installed.
Error detected while processing /home/chadgh/.dotfiles/vim/vim/bundle/django-plus.vim/after/ftplugin/python.vim:
line 15:
E117: Unknown function: UltiSnips#FileTypeChanged
Anyone got django-plus to play nicely with coc.nvim (coc-python & coc-html) ?
In django templates, I'm not getting completion after {%
and {{ var |
anymore, not sure how to put it back.
@tweekmonster are you not maintaining this plugin anymore?
In a template with the code {% extends "base.html" %}
, I would like to switch to the related base.html
file by pressing CTRL-].
Can Django-plus add the configuration to auto-create the appropriate tags? Or can you suggest a proper way to get this done?
This project could not be included in vim-polyglot because it does too much on startup, even if the user is only editing a text file or a Javascript file.
(I am also reluctant to keep it installed, for the same reason. I use Vim for lots of different things, and only use Django occasionally.)
Suggestion:
Challenges:
Would it be possible to add completion for queryset field arguments?
For example: typing SomeModel.objects.filter(
should complete the fields of the SomeModel
model.
This should also include lookups like id__in
, if possible.
Description
Upon opening a html template file in a django project, neovim doesn't automatically change filetype to htmldjango.
:echo b:is_django
returns 1
Issue
The filetype remains unchanged from html
Expected
The filetype is changed to htmldjango
Environment:
nvim -v
NVIM v0.10.0-dev-535+g8c9dab3e0
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe /MD /Zi /O2 /Ob1 -W3 -wd4311 -wd4146 -DUNIT_TESTING -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_WIN32_WINNT=0x0602 -DMSWIN -DINCLUDE_GENERATED_DECLARATIONS -DNVIM_TS_HAS_SET_MAX_START_DEPTH -ID:/a/neovim/neovim/.deps/usr/include/luajit-2.1 -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/build/src/nvim/auto -ID:/a/neovim/neovim/build/include -ID:/a/neovim/neovim/build/cmake.config -ID:/a/neovim/neovim/src
How do you install it?
Hello, i have this tree structure right now where i launch vim from the .
.
├── app
│ ├── app
│ │ └── settings/ [base|dev|prod].py
│ ├── core
│ │ ├── migrations
│ └── polls
│ │ ├── migrations
│ │ └── templates
│ └── manage.py
│ │ ├── migrations
├── _devops
└── requirements
Upon opening views|models|templates files i get is_dango = 1 set. However, i don't understand how to get the nice querysets completions mentioned on the Readme page.
Any help here would be welcome, thanks for the work.
When editing python files in django project(with outside python files all fine) with deoplete autocompletion there is the error appears in insert mode
[deoplete] Traceback (most recent call last):
[deoplete] File "/home/monkoose/.local/share/nvim/site/dein/.dein/rplugin/python3/deoplete/deoplete.py", line 46, in completion_begin
[deoplete] complete_position, candidates = self.gather_candidates(context)
[deoplete] File "/home/monkoose/.local/share/nvim/site/dein/.dein/rplugin/python3/deoplete/deoplete.py", line 72, in gather_candidates
[deoplete] results = self.gather_results(context)
[deoplete] File "/home/monkoose/.local/share/nvim/site/dein/.dein/rplugin/python3/deoplete/deoplete.py", line 83, in gather_results
[deoplete] charpos = source.get_complete_position(cont)
[deoplete] File "/home/monkoose/.local/share/nvim/site/dein/.dein/rplugin/python3/deoplete/sources/django.py", line 29, in get_complete_position
[deoplete] return self.vim.call('djangoplus#complete', 1, '')
[deoplete] File "/usr/lib/python3.5/site-packages/neovim/api/nvim.py", line 213, in call
[deoplete] return self.request('vim_call_function', name, args, **kwargs)
[deoplete] File "/usr/lib/python3.5/site-packages/neovim/api/nvim.py", line 129, in request
[deoplete] res = self._session.request(name, *args, **kwargs)
[deoplete] File "/usr/lib/python3.5/site-packages/neovim/msgpack_rpc/session.py", line 98, in request
[deoplete] raise self.error_wrapper(err)
[deoplete] neovim.api.nvim.NvimError: b'Vim(return):E117: Unknown function: pythoncomplete#Complete'
As I understand from mattn/emmet-vim#302, using Emmet with htmldjango filetype requires setting: autocmd FileType htmldjango EmmetInstall
.
With this autocmd set in vimrc, the following error occurs when opening an html file in a django project (htmldjango):
Error detected while processing FileType Auto commands for "htmldjango":
E492: Not an editor command: EmmetInstall
I noticed that manually doing :setf html
then :setf htmldjango
seems to enable Emmet without errors.
I imagine there are others who use this plugin with Emmet. Perhaps there is way to configure Emmet without requiring changing django-plus code?
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.