Custom auto-complete


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Custom auto-complete
# 1  
Old 05-20-2008
Question Custom auto-complete

Hello:

I am using csh, and am a complete noob when it comes to shell scripting.

I want the following:

1) Ignore case when doing auto-complete.

2) If there are multiple matches (example: I have files abc.txt abc.txt.1, abc.txt.2 and type abc<tab>), count the number of matches.

If the number of matches is less than a set amount, say 5, then cycle through them upon tab. Meaning when I press abc<tab> it first completes abc.txt, then when I press <tab> again, it completes it to abc.txt.1, then abc.txt.2, and then my original uncompleted word, abc.

If the number of matches is more than 5 and less than 20, it should show me all possibilities upon pressing tab.

If the number of matches is more than 20, it should ask me whether I want a full listing. Upon pressing y or n, it should do the appropriate action (i.e. show me all possible matches, or not show any match).

3) When the number of matches is less than 5, shift-tab should cycle backwards in the list of matched filenames/dir-names.

I want to write a script in .cshrc to do the above, but don't know how/where to start. Can anyone help me write this?

Regards,

[Bump]

Last edited by madiyaan; 05-23-2008 at 04:06 PM.. Reason: Added shift-tab
# 2  
Old 05-23-2008
Bumping this topic, since I did not get any answer.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Howto auto boot SPARC | How to auto supply "start /SYS" and "start /SP/console" commands

When I power ON my T4-1, I got a prompt -> where I have to start /SYS and start /SP/console. How can I auto supply these two commands ? (3 Replies)
Discussion started by: z_haseeb
3 Replies

2. UNIX for Advanced & Expert Users

Emacs auto-complete comments too

I am using emacs auto-complete. Auto completion works well, however text inside comments blocks is not auto completed. I want to auto complete when writing comments as well but cannot find a way to set it up yet. (0 Replies)
Discussion started by: kristinu
0 Replies

3. Shell Programming and Scripting

Shell - Auto complete shell windows

*Sorry for my other post in French* Hi everyone! In my work I have to find how can I auto complete this type of windows (screenshot) in Shell with defined variables. http://opsi-fr.opensides.be/opsi-doc/stable/xhtml/fr/images/mysql-config-input-mask.png Thank you so much for replies! :) (1 Reply)
Discussion started by: devilsnake88
1 Replies

4. UNIX for Dummies Questions & Answers

Auto Complete variable names in KSH

Hi, I use KSH a lot. I wanted to know if I can auto-complete a Variable name in the environment. I know this is possible in tcsh. I use the vi mode to edit commands on command prompt. Any help would be much appreciated. Thanks..!! (4 Replies)
Discussion started by: grep_me
4 Replies

5. UNIX for Dummies Questions & Answers

auto-complete in terminal

Dear friend i have intalled sun solaris in vmware (vertual machine) untill now every things are ok but i have proplem when i tray to use tap key in terminal for auto complete the terminal window prsent to me space only i tried many also in many profile it seem the same proplem also if i print... (3 Replies)
Discussion started by: Mohammed-syria
3 Replies

6. UNIX for Dummies Questions & Answers

BASH complete-filename & menu-complete together

Hi, Does anyone know how to make BASH provide a list of possible completions on the first tab, and then start cycling through the possibilites on the next tab? Right now this is what I have in my .bashrc: bind "set show-all-if-ambiguous on" bind \\C-o:menu-complete This allows... (0 Replies)
Discussion started by: Mithu
0 Replies

7. UNIX for Dummies Questions & Answers

Auto Complete

Hi ! Can anybody please give me any clue how to set on the Auto Complete option (auto complete paths by pressing escape) in unix ? Thanks! Pablo. (4 Replies)
Discussion started by: cordobapablo
4 Replies

8. UNIX Desktop Questions & Answers

Auto complete

How can I set up the profile for a use so when entering a eg first charachter of a file and then pressing the tab OS will complete the file name. Thanks in advance Tom (4 Replies)
Discussion started by: Tom_Zamani
4 Replies

9. UNIX for Advanced & Expert Users

Auto Complete under AIX

How can one setup auto complete under AIX when you type a path etc. by pressing a sequece of keys yu can complete the line. Any sugestions !!!! (7 Replies)
Discussion started by: truma1
7 Replies
Login or Register to Ask a Question

Featured Tech Videos