penvim icon indicating copy to clipboard operation
penvim copied to clipboard

[Feature request] respecting editorconfig

Open aMOPel opened this issue 2 years ago • 3 comments

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.

aMOPel avatar Jul 12 '22 12:07 aMOPel

  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

shaeinst avatar Jul 12 '22 12:07 shaeinst

  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.

aMOPel avatar Jul 12 '22 13:07 aMOPel

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.

shaeinst avatar Jul 12 '22 13:07 shaeinst