Choose style:

Author Topic: How to make Terminal tab-completion case insensitive and zsh style autocomplete  (Read 2948 times)

0 Members and 1 Guest are viewing this topic.

Offline rajeev2631007

  • Member
  • ***
  • Posts: 234
  • Karma: 24
  • New Forum User
    • View Profile
You need to edit  /etc/inputrc  file.


Code: [Select]
sudo pluma /etc/inputrc

Append text as follows:

Bash  tab-completion case insensitive

Code: [Select]
set completion-ignore-case on

Bash autocomplete like zsh

Code: [Select]
set show-all-if-ambiguous on
TAB:menu-complete

This doesn't make bash work exactly as zsh tho. Zsh will complete up until the next ambiguous match. Bash will just cycle through all matches.

Source of above details

https://www.cyberciti.biz/faq/bash-shell-setup-filename-tab-completion-case-insensitive/
http://superuser.com/questions/288714/bash-autocomplete-like-zsh

I think this two options should be by default enable in peppermint distro. It will make peppermint terminal more feature rich by default.

Regards,

Rajeev Gautam
 

Offline VinDSL

  • Global Moderator
  • Hero
  • *****
  • Posts: 5443
  • Karma: 957
  • Peppermint Mod
    • View Profile
  • Peppermint version(s): Developmental Builds
This doesn't make bash work exactly as zsh tho. Zsh will complete up until the next ambiguous match.

Nice one, Rajeev !

I use ZSH 99% of the time, and love the added functionality above and beyond BASH that it provides, especially on gits, such as GitHub.

Here's the flavor I run:  http://ohmyz.sh/

There are a few obscure things that BASH will do that ZSH won't, and many, many things ZSH will do that BASH won't, soooo IMO one really needs to have both installed, but ...

It never hurts to prop up regular old BASH, as it goes limping down the road.   ;D

Offline rajeev2631007

  • Member
  • ***
  • Posts: 234
  • Karma: 24
  • New Forum User
    • View Profile
Thank you VinDSL

I never tried ZSH. After read your post I research and installed ZSH Shell.

Installation Step I followed

Code: [Select]
sudo apt-get update
sudo apt-get install zsh
sudo apt-get install git-core
#lets change default shell
chsh -s /bin/zsh

setup ohmyzsh

Code: [Select]
 sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

In order to enable a theme, set  ZSH_THEME  to the name of the theme in your  ~/.zshrc , before sourcing Oh My Zsh; for example:  ZSH_THEME=robbyrussell
 If you do not want any theme enabled, just set  ZSH_THEME  to blank:  ZSH_THEME=""

Source of above details

https://www.computersnyou.com/3145/setup-zsh-oh-zsh-linux-mint-quick-guide/
https://www.thinkingmedia.ca/2014/10/how-to-install-oh-my-zsh-on-ubuntu-14/
https://github.com/robbyrussell/oh-my-zsh/wiki/Themes

Thank you VinDSL for your idea and advice.

Regards,

Rajeev Gautam


Offline VinDSL

  • Global Moderator
  • Hero
  • *****
  • Posts: 5443
  • Karma: 957
  • Peppermint Mod
    • View Profile
  • Peppermint version(s): Developmental Builds
Good job, Rajeev !  I think you'll love it.

Personally, I use the 'gnzh' theme, but there are plenty of other choices - or you can make your own..   ;)

Offline rajeev2631007

  • Member
  • ***
  • Posts: 234
  • Karma: 24
  • New Forum User
    • View Profile
Thank you VinDSL . :)

Yes you're absolutely right I start loving it and gnzh  themes is really good choice.   8)

But I'm facing issues with bash scripts with read -p command. it start giving below error.


error: read:1: -p: no coprocess.


you ever face such issues with bash or zsh shell. There is any way out or best practices to avoid such issues.


Regards,

Rajeev Gautam


Offline VinDSL

  • Global Moderator
  • Hero
  • *****
  • Posts: 5443
  • Karma: 957
  • Peppermint Mod
    • View Profile
  • Peppermint version(s): Developmental Builds
You're welcome !

You ever face such issues with bash or zsh shell. There is any way out or best practices to avoid such issues.

No, not the same exact issue, but ...  Yes, I've run across issues such as that, so it doesn't surprise me.

ZSH is not a direct replacement for BASH.  I use ZSH a lot more than BASH, but sometimes need to use BASH temporarily.

It's easy enough to switch back n' forth ...

When I open a terminal, it defaults to ZSH.

Code: [Select]
╭─vindsl@Boogaloo-5 ~  
╰─➤ 

To switch to BASH, type 'bash' and <Enter>.

Code: [Select]
╭─vindsl@Boogaloo-5 ~  
╰─➤  bash

vindsl@Boogaloo-5 ~ $

To go back to ZSH, type 'zsh' and <Enter>

Code: [Select]
vindsl@Boogaloo-5 ~ $ zsh

╭─vindsl@Boogaloo-5 ~ 
╰─➤ 

If you're a PowerShell user, it's 'powershell' and so forth, and so on.

Code: [Select]
╭─vindsl@Boogaloo-5 ~  
╰─➤  powershell                                   

PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.

PS /home/vindsl>

AFAIK, you can install and use as many shells as you wish.

As far as best practices are concerned, maybe BASH will be a better fit for you, with an occasional foray into ZSH.  In that case, continue to use BASH by default, and switch to ZSH when needed, using the step(s) above.  Only you know the answer to that.   ;)

I just prefer to use ZSH, for the things I do ...
« Last Edit: December 09, 2016, 07:04:59 pm by VinDSL, Reason: Addendum »