annotate runtime/ftplugin/bash.vim @ 16413:4734d601ebdd v8.1.1211

patch 8.1.1211: not all user command code is tested commit https://github.com/vim/vim/commit/e61e548dd6a20471fd81160b1c2a16089505ec8c Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 27 15:05:12 2019 +0200 patch 8.1.1211: not all user command code is tested Problem: Not all user command code is tested. Solution: Add more tests.
author Bram Moolenaar <Bram@vim.org>
date Sat, 27 Apr 2019 15:15:07 +0200
parents f0f06837a699
children 03b854983b14
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15512
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 " Vim filetype plugin file
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2 " Language: bash
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 " Maintainer: Bram Moolenaar
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4 " Last Changed: 2019 Jan 12
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5 "
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6 " This is not a real filetype plugin. It allows for someone to set 'filetype'
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7 " to "bash" in the modeline, and gets the effect of filetype "sh" with
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
8 " b:is_bash set. Idea from Mahmode Al-Qudsi.
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10 if exists("b:did_ftplugin")
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
11 finish
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 endif
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14 let b:is_bash = 1
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15 if exists("b:is_sh")
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
16 unlet b:is_sh
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17 endif
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 if exists("b:is_kornshell")
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19 unlet b:is_kornshell
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
20 endif
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
21
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22 " Setting 'filetype' here directly won't work, since we are being invoked
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23 " through an autocommand. Do it later, on the BufWinEnter event.
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24 augroup bash_filetype
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25 au BufWinEnter * call SetBashFt()
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26 augroup END
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 func SetBashFt()
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 au! bash_filetype
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30 set ft=sh
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31 endfunc