Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] respecting editorconfig #2

Open
aMOPel opened this issue Jul 12, 2022 · 3 comments
Open

[Feature request] respecting editorconfig #2

aMOPel opened this issue Jul 12, 2022 · 3 comments

Comments

@aMOPel
Copy link

aMOPel commented Jul 12, 2022

Hey there, pretty cool plugin.

What do you think about respecting editorconfig?

Just a little check, if .editorconfig is present in the project root, to automatically disable the parts of the plugin that interfere.

Also you probably know this, but there is a feature in vim called exrc, which allows for project specific configurations. Although it is considered unsafe, there are a few plugins doing that in a safer way, like https://github.com/embear/vim-localvimrc .
My point is, creating your own standard for defining a subset of project local settings, is like editorconfig but without cross editor support and like localvimrc but only supporting a small subset of vim options. No offense intended.

@shaeinst
Copy link
Member

shaeinst commented Jul 12, 2022

  1. i am aware of editorconfig. it's a future plan (but not so soon)
  2. this feature already exist in penvim and it's 100% secure:
require("penvim").setup({
	project_env = {
		enable = true, -- enable/disable project_env
		config_name = '.__nvim__.lua' -- config file name
	},
})

.__nvim__.lua

-- .__nvim__.lua
return {
	-- for all file types
	all = {
		tabstop = 4, -- spaces per tab
		cursorline = true, -- highlight current line
		relativenumber = true, -- show relative line number
		number = true, -- show line numbers
	},

	-- for filetype lua
	lua = {	
		smarttab = true, -- <tab>/<BS> indent/dedent in leading whitespace
		softtabstop = 4,
		shiftwidth = 4, -- spaces per tab (when shifting), when using the >> or << commands, shift lines by 4 spaces
	},
	
	-- for filetype python and javascript
	py_js = {
		tabstop = 4, -- spaces per tab
		wrap = false, -- don't automatically wrap on load
	}
}

all vim.opt.<options> are valid

@aMOPel
Copy link
Author

aMOPel commented Jul 12, 2022

  1. i am aware of editorconfig. it's a future plan (but not so soon)

Great 👍

2. this feature already exist in penvim and it's 100% secure:

I saw this, but I didn't make it quite clear. Sorry.

Supporting all vim options is great and in this way penvim has an edge compared to editorconfig, however localvimrc also gives you the option to define project local mappings and autocmds and what not. It's the full feature set of vimscript after all. Also you can have multiple local rcs in different subdirectories.

My point is defining your own (yet another) standard for a project local configuration seems unnecessary.

@shaeinst
Copy link
Member

penvim too support this

Also you can have multiple local rcs in different subdirectories.

Maybe but defining configs in programmatic way feels good. And i can change the name of config to any name i want. penvim is 4 in 1 plugins and each feature can be disabled easily without compromising the performance. So, disable anything you feel unnecessary

My point is defining your own (yet another) standard for a project local configuration seems unnecessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants