Glam Prestige Journal

Bright entertainment trends with youth appeal.

I want completion like in emacs that if there is only a sole completion to the command you are typing, than you don't need to type it all.

For example:

package ins

is enough instead of typing the whole:

package install

Is there a package or script that does that?

I am looking for a solution that doesn't require hitting the tab key but rather hitting the enter straight away and having a script do the auto completion before running the command.

0

4 Answers

I believe fish shell would be in order here. To install:

  1. Download from here

  2. Then use this tutorial to assist you learning.

3

You need to install bash-completion. If already installed, you need to source it:

source /etc/bash_completion

You can add it in your .bashrc file. You can add custom completions in /etc/bash_completion.d/

bash does that by default if the bash-completion package is installed, just type e.g.

> apt i

press Tab ↹ and you'll get

> apt install

If there are multiple matches, pressing Tab ↹ another time will display a list of them., e.g.

> ap

Tab ↹

nothing happens

Tab ↹

aplay apport-bug apt aptdcon aptitude-curses
aplaymidi apport-cli apt-add-repository apt-extracttemplates aptitude-run-state-bundle
apm_available apport-collect apt-cache apt-ftparchive apt-key
apparmor_parser apport-unpack apt-cdrom apt-get apt-mark
apparmor_status appres apt-config aptitude apt-sortpkgs
applygnupgdefaults apropos aptd aptitude-create-state-bundle 
7

If your problem is you want Bash Completion, please refer to the post Terminal autocomplete doesn't work properly, else if you need Enter become as like Tab ↹ and also execute that command immediately, then you need to add the command below in your ~/.bashrc and then source ~/.bashrc it.

bind 'RET:"\C-i\C-j"'

The RET is shortened for RETURN; You could use "\C-M" instead as well which is stands for Ctrl+M.

0

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy