New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
runtime: add sshconfig to filetypes #1452
Conversation
On 2017-02-07, Horgix wrote:
Hello,
OpenSSH 7.3 introduced the Include directive for SSH configuration file,
meaning that ssh config files can now be something else than ~/.ssh/config or
ssh_config (from which they can be included).
To be able to have the filetype detected on those included files, this commit
adds *.sshconfig to the matchings for sshconfig filetype.
• Current behavior: ~/.ssh/my_sub_config.sshconfig included by an Include
my_sub_config.sshconfig in ~/.ssh/config doesn't get its filetype detected
• Behavior after this commit: ~/.ssh/my_sub_config.sshconfig included by an
Include my_sub_config.sshconfig in ~/.ssh/config gets its filetype detected
as sshconfig
In a brief search for information on that include directive,
I didn't find anything about a naming convention for included files.
If *.sshconfig is just your personal naming convention, I'd be
reluctant to include it as part of standard Vim.
Regards,
Gary
|
Indeed, it seems that there is no naming convention officially defined for that; however the need for a filetype detection is still there.
It may be seen as "personal" since it's not officially defined, but I think that it is reasonably close to what it should be and don't really see any other possibility that wouldn't conflict with another filetype and would still be explicit about what it is; and it doesn't mean it couldn't be changed if some convention is defined in the future. If despite this you really are reluctant to include it as part of Vim, I guess I'll try to see if I can submit something to the openssh manual about that as an advice to users in an effort to standardize the extention for sshconfig files. |
On 2017-02-07, Horgix wrote:
In a brief search for information on that include directive, I didn't find
anything about a naming convention for included files.
Indeed, it seems that there is no naming convention officially defined for
that; however the need for a filetype detection is still there.
If *.sshconfig is just your personal naming convention, I'd be reluctant to
include it as part of standard Vim.
It may be seen as "personal" since it's not officially defined, but I think
that it is reasonably close to what it should be and don't really see any other
possibility that wouldn't conflict with another filetype and would still be
explicit about what it is; and it doesn't mean it couldn't be changed if some
convention is defined in the future.
Since it's neither a standard nor recommended by OpenSSH, I doubt
that anyone is going to discover this convention unless they go
looking in $VIMRUNTIME/filetype.vim.
I can think of two alternatives that might be better.
1. Identify as SSH configuration files those under the .ssh
directory that have the commonly-used extension .conf:
*/.ssh/*.conf
Since .conf is used by many programs for their configuration
files, a user is more likely to try that than .sshconf. There
are several examples of this in $VIMRUNTIME/filetype.vim.
2. Add the following line at the bottom of each included
configuration file:
# vim: ft=sshconfig
If despite this you really are reluctant to include it as part of Vim, I guess
I'll try to see if I can submit something to the openssh manual about that as
an advice to users in an effort to standardize the extention for sshconfig
files.
Would that make it for you if it was to be accepted ?
If the OpenSSH folks were to suggest a standard naming convention
for included SSH config files, then it would make sense for Vim to
use that convention in its filetype detection.
My opinion doesn't carry any more weight than anyone else's on this
list. I'm just offering my perspective. It's up to Bram to accept
or reject your proposal.
Regards,
Gary
|
Indeed, you're totally right on that
That makes sense. It wouldn't cover the included files from somewhere else (which is allowed by the
You're right on that too; however I see this more as something for purely personal filetypes or as temporary solution for what can be considered "well-known" filetypes until they are properly recognized by default by Vim (just offering my opinion here).
Well, let's see what they think about it then, I submitted the suggestion here : http://lists.mindrot.org/pipermail/openssh-unix-dev/2017-February/035774.html
I admit that since the message is authored by "vim-ml" on Github I didn't pay enough attention to the real author in the signature and supposed you were Bram ! I think that right now the best is to just wait for some answers on the openssh-unix-dev mailing list regarding my suggestion for the manpage; if it were to be accepted then this PR would make sense, and if it is rejected I will modify this PR to match your first suggestion about |
Closing, because there has been no progress in a long time. |
Hello,
OpenSSH 7.3 introduced the
Include
directive for SSH configuration file, meaning that ssh config files can now be something else than~/.ssh/config
orssh_config
(from which they can be included).To be able to have the filetype detected on those included files, this commit adds
*.sshconfig
to the matchings forsshconfig
filetype.~/.ssh/my_sub_config.sshconfig
included by anInclude my_sub_config.sshconfig
in~/.ssh/config
doesn't get its filetype detected~/.ssh/my_sub_config.sshconfig
included by anInclude my_sub_config.sshconfig
in~/.ssh/config
gets its filetype detected assshconfig
PS: I didn't find anything in the repo about testing filetypes detection, please point me to it if I missed it so I can add a test for this!