1、Tcsh Complete 参考
最近在研究tcsh的补全相关知识,于是将相关资料列出来,然后加以分析,据我所知,目前相关的材料大多是英文的,而且百度搜索出来匹配结果较差,而国内又不方便用谷歌,故写出来记录一下:
文件编辑位置: etc/csh.tcshrc
· 有的是.cshrc
或者 ~/.tcshrc
本文主要涉及tcsh的补全:
模板:
complete [command [word/pattern/list[:select]/[[suffix]/] …]]
作用:
通过定义一种补全方式,通过输入一部分命令,然后按TAB键,实现将期待的补全列出来,当我们对一些命令较长,而且记不清的时候尤其有用。
首先
complete可以理解为是一个Linux的内建命令或者函数,然后,就是command,理解为当 cd、man、ls、这样的命令。
然后
word部分,就是我们需要给出的补全方式,补全位置?第几个位置补全,如何补全?可选参数如下:
word specifies which word relative to the current word is to be completed, and can be one of the following:
c
Current-word completion. pattern is a glob-pattern which must match the beginning of the current word on the command line. pattern is ignored when completing the current word.
C
like c, but includes pattern when completing the current word.
n
Next-word completion. pattern is a glob-pattern which must match the beginning of the previous word on the command line.
N
Like n, but must match the beginning of the word two before the current word.
p
Position-dependent completion. pattern is a numeric range, with the same syntax used to index shell variables, which must include the current word.
list
The list of possible completions, which can be one of the following:
a
Aliases
b
Bindings (editor commands)
d
Directories
D
Directories which begin with the supplied path prefix
e
Environment variables
f
File names
F
File names which begin with the supplied path prefix