From 95f89832be313ccb9536e4ab7187cbdf1b13a506 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 29 Dec 2018 22:18:56 +1300 Subject: Choose regex character classes for some filetypes --- vim/after/ftplugin/perl.vim | 4 ++++ vim/after/ftplugin/php.vim | 4 ++++ vim/after/ftplugin/vim.vim | 4 ++++ vim/ftplugin/awk.vim | 4 ++++ 4 files changed, 16 insertions(+) (limited to 'vim') diff --git a/vim/after/ftplugin/perl.vim b/vim/after/ftplugin/perl.vim index 5dd2b7bb..bcee97d6 100644 --- a/vim/after/ftplugin/perl.vim +++ b/vim/after/ftplugin/perl.vim @@ -8,6 +8,10 @@ let b:undo_ftplugin .= '|unlet b:current_compiler' setlocal matchpairs+=<:> let b:undo_ftplugin .= '|setlocal matchpairs<' +" Specify ERE regex (close to perlre) for regex_escape.vim +let b:regex_escape_flavor = 'ere' +let b:undo_ftplugin .= '|unlet b:regex_escape_flavor' + " Stop here if the user doesn't want ftplugin mappings if exists('g:no_plugin_maps') || exists('g:no_perl_maps') finish diff --git a/vim/after/ftplugin/php.vim b/vim/after/ftplugin/php.vim index ee0ce5c8..801f1c76 100644 --- a/vim/after/ftplugin/php.vim +++ b/vim/after/ftplugin/php.vim @@ -12,6 +12,10 @@ let b:undo_ftplugin .= '|setlocal comments< formatoptions<' setlocal keywordprg=pman let b:undo_ftplugin .= '|setlocal keywordprg<' +" Specify ERE regex (close to PCRE) for regex_escape.vim +let b:regex_escape_flavor = 'ere' +let b:undo_ftplugin .= '|unlet b:regex_escape_flavor' + " Stop here if the user doesn't want ftplugin mappings if exists('g:no_plugin_maps') || exists('g:no_php_maps') finish diff --git a/vim/after/ftplugin/vim.vim b/vim/after/ftplugin/vim.vim index a7a69993..905d21dc 100644 --- a/vim/after/ftplugin/vim.vim +++ b/vim/after/ftplugin/vim.vim @@ -5,6 +5,10 @@ if bufname('%') !=# 'command-line' \ . '|setlocal errorformat< makeprg<' endif +" Specify Vim pattern flavor for regex_escape.vim +let b:regex_escape_flavor = 'vim' +let b:undo_ftplugin .= '|unlet b:regex_escape_flavor' + " Stop here if the user doesn't want ftplugin mappings if exists('g:no_plugin_maps') || exists('g:no_vim_maps') finish diff --git a/vim/ftplugin/awk.vim b/vim/ftplugin/awk.vim index 9627941d..663ba810 100644 --- a/vim/ftplugin/awk.vim +++ b/vim/ftplugin/awk.vim @@ -8,3 +8,7 @@ let b:did_ftplugin = 1 setlocal comments=:# setlocal formatoptions+=or let b:undo_ftplugin = 'setlocal comments< formatoptions<' + +" Specify ERE flavor for regex_escape.vim +let b:regex_escape_flavor = 'ere' +let b:undo_ftplugin .= '|unlet b:regex_escape_flavor' -- cgit v1.2.3