LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Two bash questions (completion & vi mode) (https://www.linuxquestions.org/questions/linux-newbie-8/two-bash-questions-completion-and-vi-mode-647207/)

blehamiga 06-05-2008 09:55 AM

Two bash questions (completion & vi mode)
 
I'm a tcsh user setting up for a conversion to bash.

Two things I haven't been able to find yet:

In tcsh if you set autolist=ambiguous, if you are sitting at a prompt and hit TAB, it will essentially do an ls for you. It completes files instead of completing all available commands.

I've got the following set up in bash

bind "set completion-query-items 1000"
bind "set show-all-if-ambiguous on"
bind "set page-completions off"

If I hit TAB at an empty prompt, it still tries to complete all available commands instead of the files in my current directory. Is there any way I can change this, perhaps something I need to set in a "complete" command?

Second - I used 'bindkey -v' in tcsh as I'm familiar with vi and used to using the commands in shell interaction as well.

I've found and set:
bind "set editing-mode vi"
bind "set keymap vi"

shopt -o vi

And this works, but is slightly different behavior. This defaults me to insert mode instead of command mode. bindkey -v would default to command mode. (say I hit up to get to a history, in bash I have to learn to escape first to use vi commands).

Is there any way to get this to default to command mode instead of insert mode?

Thanks.

DotHQ 06-05-2008 10:31 AM

Sounds like you've hit on the reason for tcsh. :)
All the shell have their little differences. I understand what you want to do and I've been using bash a few years now, but to the best of my knowledge I do not know how to do what you are asking.
bash has a huge man page. Maybe you might find a way to do what you are after there.
Sorry I couldn't be of any help at all. :(


All times are GMT -5. The time now is 02:36 PM.