[vim/vim] recognize .conf files in .ssh directory (PR #9322)

220 views
Skip to first unread message

David Auer

unread,
Dec 10, 2021, 10:44:18 AM12/10/21
to vim/vim, Subscribed

I and my colleagues put ssh configurations for different projects in separate files, but vim doesn't recognize them as sshconfig. With this PR, vim considers all files matching */.ssh/*.conf to be sshconfig files. I believe that this will not generate any false positives as there is no reason to put any other .conf files in that directory or its subdirectories.

However, I do understand if you consider this to be an edge case and therefore don't want it in the general filetype configuration. I'm aware that I can also add this to my personal .vimrc but thought there would be others out there with the same issue.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/9322

Commit Summary

  • 3f30030 recognize .conf files in .ssh directory

File Changes

(1 file)

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.

David Auer

unread,
Dec 10, 2021, 10:47:24 AM12/10/21
to vim/vim, Subscribed

@dreua commented on this pull request.


In runtime/filetype.vim:

> @@ -1761,8 +1761,8 @@ au BufNewFile,BufRead *.sqr,*.sqi		setf sqr
 au BufNewFile,BufRead *.nut			setf squirrel
 
 " OpenSSH configuration
-au BufNewFile,BufRead ssh_config,*/.ssh/config		setf sshconfig
-au BufNewFile,BufRead */etc/ssh/ssh_config.d/*.conf	setf sshconfig
+au BufNewFile,BufRead ssh_config,*/.ssh/config,*/.ssh/*.conf	setf sshconfig
+au BufNewFile,BufRead */etc/ssh/ssh_config.d/*.conf		setf sshconfig

This looks wrong in GH but is correctly indentated in Vim

Bram Moolenaar

unread,
Dec 10, 2021, 4:14:21 PM12/10/21
to vim/vim, Subscribed

Should be fine to add this pattern. Please add an entry to the test in src/testdir/test_filetype.vim

David Auer

unread,
Jan 3, 2022, 9:26:05 AM1/3/22
to vim/vim, Push

@dreua pushed 1 commit.

  • e890ce9 add check for .conf files in .ssh directory


View it on GitHub.


Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/9322/push/8743529280@github.com>

David Auer

unread,
Jan 3, 2022, 9:27:57 AM1/3/22
to vim/vim, Subscribed

I added a test and confirmed it works via make test. Let me know if you want more tests or a force-push of the squashed commits.


Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/9322/c1004130042@github.com>

codecov[bot]

unread,
Jan 3, 2022, 12:26:59 PM1/3/22
to vim/vim, Subscribed

Codecov Report

Merging #9322 (e890ce9) into master (2172bff) will decrease coverage by 87.74%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@

##           master    #9322       +/-   ##

===========================================

- Coverage   90.19%    2.44%   -87.75%     

===========================================

  Files         151      152        +1     

  Lines      170987   168176     -2811     

===========================================

- Hits       154226     4119   -150107     

- Misses      16761   164057   +147296     
Flag Coverage Δ
huge-clang-none ?
huge-gcc-none ?
huge-gcc-testgui ?
huge-gcc-unittests 2.44% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/float.c 0.00% <0.00%> (-99.22%) ⬇️
src/gui_gtk_f.c 0.00% <0.00%> (-97.54%) ⬇️
src/crypt_zip.c 0.00% <0.00%> (-97.06%) ⬇️
src/cmdhist.c 0.00% <0.00%> (-97.00%) ⬇️
src/match.c 0.00% <0.00%> (-96.98%) ⬇️
src/sha256.c 0.00% <0.00%> (-96.94%) ⬇️
src/evalbuffer.c 0.00% <0.00%> (-96.88%) ⬇️
src/textprop.c 0.00% <0.00%> (-96.61%) ⬇️
src/libvterm/src/rect.h 0.00% <0.00%> (-96.56%) ⬇️
src/debugger.c 0.00% <0.00%> (-96.51%) ⬇️
... and 140 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2172bff...e890ce9. Read the comment docs.


Reply to this email directly, view it on GitHub, or unsubscribe.


Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/9322/c1004241952@github.com>

Bram Moolenaar

unread,
Jan 3, 2022, 12:33:33 PM1/3/22
to vim/vim, Subscribed

Closed #9322 via 9acf2d8.


Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/9322/issue_event/5836408514@github.com>

Reply all
Reply to author
Forward
0 new messages