-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add a bunch of aliases #797
Conversation
doc: "Jump to a later point in edit history. Accepts a number of steps or a time span.", | ||
fun: later, | ||
completer: None, | ||
}, | ||
TypableCommand { | ||
name: "write-quit", | ||
alias: Some("wq"), | ||
aliases: &["wq", "x"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this also available in vim/kakoune? I was thinking :x could close the underlying buffer instead of the view
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to tell you yes, but it looks like it's not strictly the same in vim.
wq
always write the file to disk while x
write it only if it has changed.
And in kakoune they are the same I think? I don't find anything talking about it and I don't know where to find it in the code.
Personally, I think these aliases are enough for most people.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't seemed to find :x
in kakoune.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes you're right I forgot I had added it to my kakrc!
define-command x write-quit
There is even an issue about it:
mawww/kakoune#3503
I wonder if we really want a duplicate |
Personally, yes I use it every time; even after 3 weeks of using helix I'm always trying to |
As an individual coming from neovim, I cannot overstate how many times a day I'm using |
helix-term/src/commands.rs
Outdated
std::iter::once((cmd.name, cmd)) | ||
.chain(cmd.aliases.into_iter().map(move |&alias| (alias, cmd))) | ||
}) | ||
.flatten() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you just use flat_map here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done 👍
Is the hacktoberfest thing working with this repo? |
Is there? I'm on my phone so I can't see it right now but I was against enabling hacktoberfest. |
Hacktoberfest was requested in #795 a while ago. |
@irevoire is it still being counted? Or otherwise maybe I will try adding |
doc: "Open the file in a vertical split.", | ||
fun: vsplit, | ||
completer: Some(completers::filename), | ||
}, | ||
TypableCommand { | ||
name: "hsplit", | ||
alias: Some("sp"), | ||
aliases: &["hs", "sp"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does this hs
come from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For horizontal-split, it's not used by others editor I think but it looked quite logical to me if we have the vs
I don't really know, it's the first time I contribute to a repo with the hacktoberfest enabled. |
Now we can have multiple aliases to the same command.
I also added the alias
x
forwq
and all the associated variants.