Git Product home page Git Product logo

django-plus.vim's People

Contributors

eyemyth avatar monkoose avatar ntcong avatar tweekmonster 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-plus.vim's Issues

indentation not working

{% 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

what's python file filetype?

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 ?

NERDTree/:Sex Error when opening 'new' files

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.

filetype check error

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.

improve settings detection

Like in the cookiecutter project, the settings structure is arranged this way:

settings/
    common.py
    local.py
    production.py
    test.py

Getting an error about UltiSnips

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

django-plus and coc ?

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?

go to template definition

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?

Add autodetection (only load plugin when editing a Django project)

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:

  • Move all setup functions into a separate file, which will only be run when needed
  • Do a quick check on BufReadPost: If django-plus is not yet loaded, and this file looks like a Django file, then load django-plus

Challenges:

  • If the user is starting a fresh project, or has not yet opened a Django-like file, then they will see none of the django-plus features. (I suggest providing an option to always load django-plus on startup, for those people who use django every day.)

Complete queryset fields

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.

Doesn't automatically set filetype to htmldjango

  • 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

Queryset completion Instructions

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.

deoplete + django-plus error

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'

Conflicting interaction with emmet-vim

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?

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.