annotate runtime/indent/sshconfig.vim @ 30719:71137f73c94d v9.0.0694

patch 9.0.0694: no native sound support on Mac OS Commit: https://github.com/vim/vim/commit/4314e4f7da4db5d85f63cdf43b73be3689502c93 Author: Yee Cheng Chin <ychin.git@gmail.com> Date: Sat Oct 8 13:50:05 2022 +0100 patch 9.0.0694: no native sound support on Mac OS Problem: No native sound support on Mac OS. Solution: Add sound support for Mac OS. (Yee Cheng Chin, closes https://github.com/vim/vim/issues/11274)
author Bram Moolenaar <Bram@vim.org>
date Sat, 08 Oct 2022 15:00:05 +0200
parents 74e3316c1d5a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
20552
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 " Vim indent file
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2 " Language: ssh config file
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 " Maintainer: JasonKim <git@jasonk.me>
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4 " Last Change: 2020 May 16
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6 if exists("b:did_indent")
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7 finish
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
8 endif
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9 let b:did_indent = 1
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
11 setlocal autoindent
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 setlocal indentexpr=GetSshconfigIndent(v:lnum)
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13 setlocal indentkeys=o,O,*<Return>,0=~host\ ,0=~match\ ,0#,!^F
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15 let b:undo_indent = "setlocal autoindent< indentexpr< indentkeys<"
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
16
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17 if exists("*GetSshconfigIndent")
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 finish
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19 endif
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
20
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
21 function GetSshconfigIndent(lnum)
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22 let sw = shiftwidth()
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23 let prev_lnum = prevnonblank(a:lnum - 1)
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24 let curr_lnum = a:lnum
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25 let prev_line = getline(prev_lnum)
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26 let curr_line = getline(curr_lnum)
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27 if curr_line =~? '^\s*\(host\|match\)\s'
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 return 0
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 elseif prev_line =~? '^\s*\(host\|match\)\s'
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30 return sw
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31 else
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 return indent(prev_lnum)
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33 endif
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34 endfunction