From 4b16fc4ecc4fdb002ad9c833af148918767ed806 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 3 Jun 2018 00:28:53 +1200 Subject: Implement personal filetype.vim This implements only the syntax highlighting for file types I regularly use and care about, implemented in the way I want them to work, with files named per type in ftdetect/*.vim. I have chosen only file types with which I regularly deal and for which syntax highlighting and filetype/indent plugins are actually useful. Most other files, e.g. system config files I edit infrequently and only with sudoedit(8), don't really benefit from that. Much of this is just copied from the distribution filetype.vim file, but some of it I do specifically in a way I want, such as the shell decision logic. We'll see how well this works. --- vim/ftdetect/perl.vim | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 vim/ftdetect/perl.vim (limited to 'vim/ftdetect/perl.vim') diff --git a/vim/ftdetect/perl.vim b/vim/ftdetect/perl.vim new file mode 100644 index 00000000..3e8ec3b9 --- /dev/null +++ b/vim/ftdetect/perl.vim @@ -0,0 +1,9 @@ +" Perl 5 files +autocmd BufNewFile,BufRead + \ *.pl,*.pm,*.t,Makefile.PL + \ setfiletype perl +autocmd BufNewFile,BufRead + \ * + \ if getline(1) =~ '^#!.*perl$' + \ | setfiletype perl + \ | endif -- cgit v1.2.3