Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Set TMPSUFFIX=.zsh in edit-command-line



Akinori MUSHA wrote on Fri, May 28, 2021 at 22:35:08 +0900:
> This patch makes the name of a temporary file to have a .zsh suffix so
> that the invoked editor will know it's a zsh script.  The .zsh suffix is
> commonly recognized by editors like Emacs, Vim and VS Code.

Thanks for the patch.

Vim already sets the filetype correctly in this case, via the «au
BufNewFile,BufRead zsh*,zlog* call s:StarSetf('zsh')» pattern match in
$VIMRTUNETIME/filetype.vim.  However, I suspect that pattern produces
some false negatives too (e.g., it also matches in cases such as «vim
=(ls)»), so I think this change would be an improvement even for Vim users.

> It's so much easier to edit a command line in a proper editing mode than in
> a plain text mode.

Agreed.  The patch looks good to me, but I haven't time to review or
test it properly, so I'll defer to others on that.

Thanks,

Daniel





Messages sorted by: Reverse Date, Date, Thread, Author