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

Add default \es keybinding for "prepend sudo" #6140

Merged
merged 1 commit into from Oct 6, 2019
Merged

Add default \es keybinding for "prepend sudo" #6140

merged 1 commit into from Oct 6, 2019

Conversation

gpanders
Copy link
Contributor

Description

This creates a new function __fish_prepend_sudo and a new default keybinding Alt+S that prepends sudo to the beginning of your current commandline.

Example:

$ vim /etc/hosts

pressing Alt+S yields

$ sudo vim /etc/hosts

This does not move the cursor.

This was inspired by the comment here.

Personally, I think this might allay some of the agitation around the lack of the !! operator in fish, since sudo !! can now effectively be done with Ctrl+p Alt+s, which is even easier!

gpanders added a commit to gpanders/dotfiles that referenced this pull request Sep 26, 2019
This can be removed if/when [1] is merged

[1]: fish-shell/fish-shell#6140
@krobelus
Copy link
Member

One possible issue here is that sudo might not be available on all systems fish supports (unlike say man)

@faho faho merged commit 0f802ea into fish-shell:master Oct 6, 2019
@faho faho added this to the fish 3.1.0 milestone Oct 6, 2019
@faho
Copy link
Member

faho commented Oct 6, 2019

Merged, thanks!

gpanders added a commit to gpanders/dotfiles that referenced this pull request Oct 11, 2019
This can be removed if/when [1] is merged

[1]: fish-shell/fish-shell#6140
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants