annotate runtime/indent/sshconfig.vim @ 31672:9dc48932db8e v9.0.1168

patch 9.0.1168: code to enable/disable mouse is not from terminfo/termcap Commit: https://github.com/vim/vim/commit/06cd14d0bf990d0002d61a721aa3d5b8a3c44028 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jan 10 12:37:38 2023 +0000 patch 9.0.1168: code to enable/disable mouse is not from terminfo/termcap Problem: Code to enable/disable mouse is not from terminfo/termcap. Solution: Request the "XM" entry and use it to set 'ttymouse' if possible.
author Bram Moolenaar <Bram@vim.org>
date Tue, 10 Jan 2023 13:45: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