我已经在vi编辑器中打开了一个文件,在另一个文件的该文件路径中将其称为
export abc=$xyz/code/function/pqr.txt
path=$xyz/code/function/java_func.txt
这里xyz = /user/main_data
现在,我想通过命令gf打开文件pqr.txt和java_func.txt,因此我必须设置变量xyz。
然后如何在打开的vi文件中设置变量xyz?
答案 0 :(得分:0)
这个答案实际上是针对vim的。我猜您所说的vi也是vim。因为您期望class Supplier
{
public string Ref { get; set; }
public string Name { get; set; }
}
class SupplierComparer : Comparer<Supplier>
{
public override int Compare(Supplier x, Supplier y)
{
var compareRef = x.Ref.CompareTo(y.Ref);
if (compareRef != 0)
{
return compareRef;
}
var compareName = x.Name.CompareTo(y.Name);
if (compareName != 0)
{
return compareName;
}
return 0;
}
}
public void MyTestMethod()
{
var suppliers = new[]
{
new Supplier { Ref = "abc", Name = "steve" },
new Supplier { Ref = "abc", Name = "bob" },
new Supplier { Ref = "cde", Name = "ian" },
new Supplier { Ref = "fgh", Name = "dan" }
};
var comparer = new SupplierComparer();
suppliers.Should().BeInAscendingOrder(comparer);
}
能够正常工作。
您可以在vim中设置shell变量(环境变量)。是:
gf
然后,您可以直观地选择路径,然后:let $xyz="the/value/you/want"
跳转到目标。