nealium / django-plus.vim Goto Github PK
View Code? Open in Web Editor NEWThis project forked from tweekmonster/django-plus.vim
:guitar: Improvements to the handling of Django related files in Vim
License: MIT License
This project forked from tweekmonster/django-plus.vim
:guitar: Improvements to the handling of Django related files in Vim
License: MIT License
Add extra options to disable Django Syntax, Python & DjangoHTML independently. (Clashes with my existing color scheme)
Add option to use Sys calls instead of pydo's
Already done, but will make it a separate branch
Fixes conflict specifically with vim-qf's QuickFix functions. QuickFix, in general, should be skipped with this function
Issue could effect other Plugins in similar situations, but this commit only solves QuickFix.
:copen
+ :cclose
+ :copen
+ :cclose
Error detected while processing FileType Autocommands for "*"..function <SNR>7_LoadFTPlugin
{x}_LoadFTPlugin
x changes based on whatever pid vim{v}\ftplugin.vim
is in :scriptnames
legacy exe b:undo_ftplugin
With tinkering, using :make
, the error message [below] also shows up
Error detected while processig QuickFixCmdPost Autocommands for "make"..function qf#OpenQuickfix[17]..fileFileType Autocommands for "*"..function <SNR>6_LoadFTPlugin:
Line: 3:
E184: No such user-defined command: Filter
# :help undo_ftplugin
When the user does ":setfiletype xyz" the effect of the previous filetype
should be undone.
When setting the filetype of QuickFix to qf
again, it undoes all vim-qf's functions which causes vim-qf to crash.
Seeing most Plugins are designed to define functions one time, Django-Plus should avoid inadvertently removing them; especially with QuickFix which is a special case
function! djangoplus#detect#filetype(filename) abort
" Passed with: djangoplus#detect#filetype(expand('<afile>:p')
echom 'filename ' . a:filename
" expanded inside the function
echom 'expand path ' . expand('%:p')
" filetype Output
echom 'filetype &l ' . &l:filetype
" ... more stuff
endfunction
views.py
filename /path/to/project/app1/views.py
expand path /path/to/project/app1/views.py
filetype &l
QuickFix
filename /path/to/project/quickfix
expand path
filetype &l qf
This illustrates why the original empty(a:filename)
isn't catching the QuickFix.
Vim's pydo/py3do functions run the template finder function 3020 times, freezing up vim for ~10 seconds.
py
/ py3
commands only run it once and freeze vim for < ~1 second
Note: This is problem is only for the initial search, but 10 seconds is a long wait.
django-plus.vim/bin/template_finder.py
def record_start():
from datetime import datetime
logger = open('/path/to/my/plugins/django-plus.vim/start_times.txt', 'a')
logger.write('{0}\n'.format(datetime.now()))
logger.close()
def djangoplus_find_templates(cwd, app_paths, cmdline=False):
record_start()
# do the normal stuff
ci'
or ci"
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.