annotate runtime/ftplugin/bash.vim @ 16850:50b4afe57e9c

Added tag v8.1.1426 for changeset 629f3d3b6886cb307088305dd034765284d2ca5f
author Bram Moolenaar <Bram@vim.org>
date Thu, 30 May 2019 18:45:06 +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