ZSH函数在当前目录中创建文件
ZSH function to create file in current directory
我有在当前目录下创建文件的功能:
function note() {
vim "$PWD/$*.md"
}
如果我键入 note 2015 - new note
,我会得到一个文件名为“0”的 vim 文件。然而,如果我输入 note new note - 2015
,我会得到一个名为 "new note - 2015.md" 的 vim 文件。发生这种情况的原因是什么,我该如何解决。
我昨天有一个类似的查询 Jens 为我工作,我尝试在这里使用相同的逻辑,但将 $HOME 替换为 $PWD。
谢谢
ZSH - zsh 5.0.7 (x86_64-apple-darwin14.0.0)
VIM - 7.4.258
问题出在名为 file-line 的 vim 插件上。一旦我禁用了这个插件,创建一个任何名称的新文件都按预期工作。
我有在当前目录下创建文件的功能:
function note() {
vim "$PWD/$*.md"
}
如果我键入 note 2015 - new note
,我会得到一个文件名为“0”的 vim 文件。然而,如果我输入 note new note - 2015
,我会得到一个名为 "new note - 2015.md" 的 vim 文件。发生这种情况的原因是什么,我该如何解决。
我昨天有一个类似的查询
谢谢
ZSH - zsh 5.0.7 (x86_64-apple-darwin14.0.0)
VIM - 7.4.258
问题出在名为 file-line 的 vim 插件上。一旦我禁用了这个插件,创建一个任何名称的新文件都按预期工作。