forked from drmikehenry/vimfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscripts.vim
30 lines (22 loc) · 822 Bytes
/
scripts.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
" User support file to detect file types in scripts
" This file is called by an autocommand for every file that has just been
" loaded into a buffer. It checks if the type of file can be recognized by
" the file contents. The autocommand is in $VIMRUNTIME/filetype.vim.
" The user-supplied scripts.vim file should chain $VIMRUNTIME/scripts.vim
" at the end.
" Only do the rest when the FileType autocommand has not been triggered yet.
if did_filetype()
finish
endif
" Line continuation is used here, remove 'C' from 'cpoptions'
let s:cpo_save = &cpo
set cpo&vim
let s:line1 = getline(1)
if s:line1 =~ '^#format\s\+rst'
set ft=rst
endif
" Restore 'cpoptions' and tidy up variables.
let &cpo = s:cpo_save
unlet s:cpo_save s:line1
" Chain to system-supplied scripts.vim file.
source $VIMRUNTIME/scripts.vim