raimondi / yaifa Goto Github PK
View Code? Open in Web Editor NEWYet Another Indent Finder, Almost...
Home Page: http://www.vim.org/scripts/script.php?script_id=3096
License: MIT License
Yet Another Indent Finder, Almost...
Home Page: http://www.vim.org/scripts/script.php?script_id=3096
License: MIT License
I just installed latest master and enabled debug output:
let g:yaifa_debug=2
Then, when starting vim on some C-file, I get:
Error detected while processing function <SNR>40_apply_settings[14]..yaifa#magic[20]..yaifa#analyze_lines:
line 38:
E117: Unknown function: s:l2str
E116: Invalid arguments for function <SNR>40_log
This error repeats quite a few times.
Somehow, it cannot find the s:l2str
function, though I can see it is actually defined in autoload/yaifa.vim
as expected. I'm not sure why it cannot find it.
As a workaround, I renamed the function (and calls) to yaifa#l2str
and then it works as expected. I'm not quite sure how vim scoping works, I'm just groping in the dark here, maybe this means more to others :-)
Do you have any license on this project?
The plugin doesn't apply indention settings to new files (check e.g. vim foo
).
As I see it, there's two ways to fix that:
BufNewFile
to the existing BufReadPost
autocmd
in https://github.com/Raimondi/yaifa/blob/master/plugin/yaifa.vim#L39Personally I like option 2 more, but maybe I overlooked something.
Side Note: https://github.com/Raimondi/yaifa/blob/master/doc/yaifa.txt#L124 is not about yaifa_disabled
.
Other than that thanks a lot for this nice plugin! Keep on hacking! :-)
Most importantly, to put yaifa.vim into a subdirectory, plugin
.
Pathogen is a plugin that'll search ~/.vim/bundle/ and add ~/.vim/bundle/foo/{plugin,doc,after,colors,...} to the runtime path, so that it's very easy. It's also great for version control, especially those with submodules (or related). That way many plugins are a git clone
away from being installed.
Otherwise, no complaints. Awesome job!
I've noticed that when reloading a python file (or also when navigating through the history), yaifa causes the first line of the file to be printed. To reproduce, simply open up any non-empty python file, and do :e
.
For this to work, filetype plugins must be on, but removing my custom python ftplugin does not fix this, so that is probably not it. Removing all my .vimrc
except filetype plugin on
and removing all plugins except yaifa does not help either.
Tracing this in the code, it is somehow caused by this line:
Line 312 in 72998c4
I'm not actually sure what that says or is supposed to do, but removing it fixes the problem. This line was introduced in 93b2c0e, but that says to only move code, but the line was not present in the old file, so that does not really help me.
I thought that the \
might be intended as a line continuation, but putting it at the end of the previous line gives errors, and removing it and just joining the lines does not fix the problem...
I'm just going to try removing that line for now and see what happens.
I'm not entirely sure what this approach would look like, but here goes:
It'd be very cool if yaifa could read the editorconfig file and derive the indentation settings from that. Or instead of reading it directly, using a "core" external program.
There is the editorconfig.vim plugin which provides this functionality. However installing both plugins results in conflicting settings when a file doesn't conform to what's in the editorconfig file. Maybe it has enough of an API to support direct integration?
So I figure something like this:
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.