annotate runtime/indent/sshconfig.vim @ 27317:839be955609f v8.2.4187

patch 8.2.4187: gnuplot file not recognized Commit: https://github.com/vim/vim/commit/ff5cbe8133c6eb5dd86b9e042f32f589627e9bf9 Author: nobodyatandnothing <you@example.com> Date: Sun Jan 23 11:19:37 2022 +0000 patch 8.2.4187: gnuplot file not recognized Problem: Gnuplot file not recognized. Solution: Recognize ".gnuplot". (closes https://github.com/vim/vim/issues/9588)
author Bram Moolenaar <Bram@vim.org>
date Sun, 23 Jan 2022 12:30:04 +0100
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