2016-08-30 85 views
4

在bash我经常使用的逃逸下划线快捷键:击式逃生下划线在PowerShell中

subl somedir/file.sh 
./(escape underscore) 

从最后一行中的最后一项填写,如:

./(escape underscore) 

变为:

./somedir/file.sh 

有没有一种方法,我可以在PowerShell中设置呢?

(我使用PowerShell 5.1,ConEmu和PSReadLine和PCSX)

回答

0

我不知道在PowerShell中(也许只是一个创建自己?)有类似的功能,但你可以用一个走阵列。例如:

(Get-Childitem somedir)[-1] 

这是不一样的,但也许你可以解决一个解决方案。

0

另一种选择是使用Select-对象:

长版本:

Get-ChildItem | Select-Object -Last 1 

短:

ls | select -l 1 
1

如果您使用Emacs模式PSReadline,然后Esc键下划线做正确的事情。 Alt + 也做同样的事情,并且在Emacs和Windows模式下都是绑定的。