{"action":"created","issue":{"url":"https://api.github.com/repos/neovim/neovim/issues/1913","labels_url":"https://api.github.com/repos/neovim/neovim/issues/1913/labels{/name}","comments_url":"https://api.github.com/repos/neovim/neovim/issues/1913/comments","events_url":"https://api.github.com/repos/neovim/neovim/issues/1913/events","html_url":"https://github.com/neovim/neovim/issues/1913","id":56027974,"number":1913,"title":"[RFC] Investigate a major refactor of the option system","user":{"login":"tarruda","id":842846,"avatar_url":"https://avatars.githubusercontent.com/u/842846?v=3","gravatar_id":"","url":"https://api.github.com/users/tarruda","html_url":"https://github.com/tarruda","followers_url":"https://api.github.com/users/tarruda/followers","following_url":"https://api.github.com/users/tarruda/following{/other_user}","gists_url":"https://api.github.com/users/tarruda/gists{/gist_id}","starred_url":"https://api.github.com/users/tarruda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tarruda/subscriptions","organizations_url":"https://api.github.com/users/tarruda/orgs","repos_url":"https://api.github.com/users/tarruda/repos","events_url":"https://api.github.com/users/tarruda/events{/privacy}","received_events_url":"https://api.github.com/users/tarruda/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-30T12:29:57Z","updated_at":"2015-01-30T13:21:03Z","closed_at":null,"body":"option.c currently has about 8k loc, which is a lot of code for managing editor configuration. I haven't examined that file with a great level of detail, but it seems to me that all it does is validate option names and invoke certain functions to parse and trigger events when options are set.\r\n\r\nMaybe we can use dicts for storing options? I suggest adding a new global dict/namespace for options(prefix o:) which will be used for option storage, and an autocommand that can be used to validate/parse options. The `:set NAME` ex command will simply be a shortcut for `let o:name = value` that triggers the `OptionSet` autocommand. With this in place we can move the validation/parse logic from option.c to vimscript(which is very good at parsing/validating text).\r\n\r\nThis would be a major undertaking due to all the C -> vimscript translation(though lots of options do nothing right now and could be removed) and because all the `p_*` read/writes will have to be translated into dict lookups. I'm not sure if it would be worth all the trouble(thus the RFC), but removing that file could go a long way into improving maintenance."},"comment":{"url":"https://api.github.com/repos/neovim/neovim/issues/comments/72199408","html_url":"https://github.com/neovim/neovim/issues/1913#issuecomment-72199408","issue_url":"https://api.github.com/repos/neovim/neovim/issues/1913","id":72199408,"user":{"login":"tarruda","id":842846,"avatar_url":"https://avatars.githubusercontent.com/u/842846?v=3","gravatar_id":"","url":"https://api.github.com/users/tarruda","html_url":"https://github.com/tarruda","followers_url":"https://api.github.com/users/tarruda/followers","following_url":"https://api.github.com/users/tarruda/following{/other_user}","gists_url":"https://api.github.com/users/tarruda/gists{/gist_id}","starred_url":"https://api.github.com/users/tarruda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tarruda/subscriptions","organizations_url":"https://api.github.com/users/tarruda/orgs","repos_url":"https://api.github.com/users/tarruda/repos","events_url":"https://api.github.com/users/tarruda/events{/privacy}","received_events_url":"https://api.github.com/users/tarruda/received_events","type":"User","site_admin":false},"created_at":"2015-01-30T13:21:03Z","updated_at":"2015-01-30T13:21:03Z","body":"> What would then be of the let &name = ... notation? Would we have 2 ways of setting an option in vimscript? We can't remove the & notation...\r\n\r\nyes, I didn't mean that we should remove the existing notations, simply make them set a dict value under the hoods."}}