Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

Horgix
Copy link

@Horgix Horgix commented Feb 7, 2017

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

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!

@vim-ml
Copy link

vim-ml commented Feb 7, 2017 via email

@Horgix
Copy link
Author

Horgix commented Feb 7, 2017

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.

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 ?

@vim-ml
Copy link

vim-ml commented Feb 7, 2017 via email

@Horgix
Copy link
Author

Horgix commented Feb 8, 2017

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.

Indeed, you're totally right on that

  1. Identify as SSH configuration files those under the .ssh directory that have the commonly-used extension .conf:

That makes sense. It wouldn't cover the included files from somewhere else (which is allowed by the Include directive), but that would be a first step forward. It also wouldn't cover the files that may legitly be placed under /etc/ssh, which can't be strictly matched since it can be changed by --sysconfdir when building OpenSSH.

  1. Add the following line at the bottom of each included configuration file: # vim: ft=sshconfig

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).

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.

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

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.

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 !
Anyway, your perspective looks perfectly fine to me so let's see where we can go with it.

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 .conf files in .ssh

@brammool
Copy link
Contributor

Closing, because there has been no progress in a long time.

@brammool brammool closed this Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants