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

Rename commands to fit a more consistent naming scheme #827

Closed
wants to merge 1 commit into from

Conversation

lenormf
Copy link
Contributor

@lenormf lenormf commented Sep 25, 2016

Hi,

As discussed in #806, the naming scheme of the commands can feel a bit inconsistent, so I decided to make my proposal for new names.

This PR does not modify anything other than the hardcoded names in commands.cc, as I think we should all agree (and by all I mean @mawww) on what names to use before changing the scripts.

Discuss.

Copy link
Owner

@mawww mawww left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder the kind of commands we need, change-buffer vs buffer, hook or add-hook...

On one hand, I like the consistency of change-buffer, rename-session... on the other hand, we are getting a bit further away from vim (it might be time to do that), and we lengthen command names a bit as well.

@@ -982,9 +982,9 @@ void define_command(const ParametersParser& parser, Context& context, const Shel
}

const CommandDesc define_command_cmd = {
"define",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shall we use a more explicit name ? command ?

Copy link
Contributor Author

@lenormf lenormf Oct 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better if we keep this command name a verb, in the name of consistency.

define-command ?

@@ -1251,9 +1251,9 @@ const CommandDesc unset_option_cmd = {
};

const CommandDesc declare_option_cmd = {
"declare",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A more explicit name ? option ?

Copy link
Contributor Author

@lenormf lenormf Oct 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better if we keep this command name a verb, in the name of consistency.

declare-option ?

@@ -667,9 +667,9 @@ Highlighter& get_highlighter(const Context& context, StringView path)
}

const CommandDesc add_highlighter_cmd = {
"add-highlighter",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or just highlight ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C.f. my answer.

@lenormf
Copy link
Contributor Author

lenormf commented Oct 5, 2016

I wonder the kind of commands we need, change-buffer vs buffer, hook or add-hook...

That's the issue I hit when changing the names, and I've decided not to go completely for one naming format, even if that made the changeset inconsistent.

On one hand you have commands whose name is just a verb (alias, map etc), those are easy to remember and the name of their removal counter part simply starts with "un" (unalias, unmap etc). I could have made it so they all followed the action-object name format, but it seemed rather unnecessary and cumbersome (add-alias, add-map etc).

But on the other hand there are commands whose removal counter part would not sound so great if they followed the verb only convention: unhook, unhighlight… So since the name for the removing commands had to be prefixed with remove-, I made the regular command start with add-. That's why we don't have highlight/unhighlight or hook/unhook, but add-highlighter/remove-highlighter and add-hook/remove-hooks (the latter should be renamed to remove-hook by the way, even though the current command name is rmhooks).

The corner case of all this is buffer, I hesitated before changing its name because the entire world is so used to that command. But since this PR is based on the remark that it's not very complicated to intuitively find the correct command name with fuzzy matching, I think it's the right decision to steer away from the vim model.

@Delapouite
Copy link
Contributor

I also prefer a consistent naming scheme over vim old names.

@lenormf
Copy link
Contributor Author

lenormf commented Nov 15, 2016

Should this be closed now that new names have been merged? Should we move on to option names?

@mawww
Copy link
Owner

mawww commented Nov 15, 2016

Names have been changed through some other commits, thanks for the inspiration 👍

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

Successfully merging this pull request may close these issues.

3 participants