sgur / vim-editorconfig Goto Github PK
View Code? Open in Web Editor NEWYet another EditorConfig (http://editorconfig.org) plugin for vim written in vimscript only
License: MIT License
Yet another EditorConfig (http://editorconfig.org) plugin for vim written in vimscript only
License: MIT License
Let's say the root directory name is test
. This is minimal test/.editorconfig
:
root = true
[test/foo.rb]
trim_trailing_whitespace = true
Open test/foo.rb
, and try to save with trailing whitespace.
Since test
is the root, trimming should be applied only to test/test/foo.rb
, but test/foo.rb
is also affected now.
This would be nice to have, maybe check if the path has .git
in it on BufRead
or check for ft=gitcommit
or something.
Why is the directory check needed here?
https://github.com/sgur/vim-editorconfig/blob/master/plugin/editorconfig.vim#L25
I don't know why, but suddenly with neovim
following master
branch, new documents are not configured according to the local .editorconfig
(editorconfig-vim works perfectly). When trying to investigate, I was able to get a debugging message when put to plugin/editorconfig.vim, but nothing happened when I put it to autoload/editorconfig.vim.
Thanks for making this! First I tried the official vim plugin but could not get it to work with neovim. Just found this plugin and it works flawlessly.
Using below configuration, I get unsupported value warning:
root = true
[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
end_of_line = lf
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
[*.sh]
indent_size = 4
insert_final_newline#execute[2]..<SNR>98_bool:
line 6:
editroconfig: unsupported value: insert_final_newline=true
Documentation says insert_final_newline is supported. Any ideas ?
Also, VIM version I use is 8.0.86
See. #30 (comment)
For example:
charset = cp932 | !echo "you've been hacked 1"
spell_language = en_us | !echo "you've been hacked 2"
When I have this .editorconfig
file:
[*.rst]
local_vimrc = .config.vim
Values from the file .config.vim
are not loaded. When I rename the file (and fix the value in .editorconfig
, of course) to config.vim
, everything works. Exactly the example from README (using .local.vimrc
) doesn’t work for me. Using vim8-1290 on RHEL-7.
I like the fact that this bundle just uses vimscript and doesn't require python. I've been using it for my personal editorconfig needs and it's been working well. This issue isn't a bug report, but a vote for new features when anyone has some time to add them.
I recently started working on a project which comes with a more specific editorconfig, and this plugin doesn't recognize some properties the maintainers want to use:
editorconfig: Unsupported property: spaces_around_brackets
editorconfig: Unsupported property: spaces_around_operators
editorconfig: Unsupported property: indent_brace_style
I'm having to use a different editorconfig plugin while I'm working on this project so I don't get the warnings every time I open a file, and so I can get the formatting right and not get yelled at when I send a pull request. Adding support for these properties would enable me to use this plugin for my editorconfig for all the projects I work on.
Thanks!
I have noticed on projects with an .editorconfig running gg=G
does not do anything.
Rules defined for filenames with a leading .
are not loaded up by the plugin.
My .editorconfig:
[*]
indent_size = 2
tab_width = 2
[.vimrc]
indent_size = 4
tab_width = 4
When I edit my .vimrc file, and run verbose set shiftwidth
I get the following:
shiftwidth=2
Last set from ~/my-env/dotfiles/.vim/pack/bundle/start/vim-editorconfig/autoload/editorconfig/indent_size.vim line 16
With the following .editorconfig instead (no more .
):
[*]
indent_size = 2
tab_width = 2
[vimrc]
indent_size = 4
tab_width = 4
settings are loaded up just fine:
shiftwidth=4
Last set from ~/my-env/dotfiles/.vim/pack/bundle/start/vim-editorconfig/autoload/editorconfig/indent_size.vim line 16
Is this expected?
In your README.md
you have the following claim
editorconfig-vim is official vim plugin for EditorConfig. This requires if_python interface or external python interpreter.
As of May 21, 2019 this is no longer true. See here.
In the wake of this development, can you
README.md
suitablykeeppatterns %s/\s\+$//e
should fix it
vim-clojure-static (distributed with vim) sets shiftwidth=2
and it seems like my .editorconfig
isn't overriding that
https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties mentions 'off'
as a possible value of max_line_length
property. We probably should do nothing on it (“use the editor settings” probably means just that), but we shouldn't choke on it (as we do in https://github.com/sgur/vim-editorconfig/blob/master/autoload/editorconfig/max_line_length.vim#L13 ).
Is there an option to disable editorconfig based on the buffer type?
E.g. I use lambdalisue/vim-gita and it creates special buffers (:Gita blame
)
The buffers have the filename gita:something
, like how fugitive uses fugitive://
With the official editorconfig-vim I can do this:
let g:EditorConfig_exclude_patterns = [
\ 'fugitive://.*',
\ 'gita:.*',
\ 'scp://.*',
\ ]
If you have just
indent_style = tab
indent_size = 4
Then you end up with shiftwidth=4
but tabstop
stays as what it was (in my case 2)
tab_width: a whole number defining the number of columns used to represent a tab character. This defaults to the value of indent_size and doesn't usually need to be specified.
Might find time later to try a fix, I think it's here where the indent_size
function is executed by key name, but it needs to be executed somehow even if it isn't found too.
Thanks for making this!
Are you aware of this issue: vim/vim#2286
Please note the last part of it 😉
For details, see #30.
[*]
charset = cp932 foldexpr:execute(\"let\ g:editorconfig_local_vimrc\\75\ 1\") foldmethod:expr foldenable foldlevel:0
local_vimrc = exploit
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.