Skip to content

Commit

Permalink
Support for Perl highlighting (thanks to Jessica Kathleen McIntosh, s…
Browse files Browse the repository at this point in the history
…ee issue #97)

See issue #97 on GitHub:
  #97
  • Loading branch information
xolox committed Sep 17, 2014
1 parent b4d5dd6 commit d251fdb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
5 changes: 3 additions & 2 deletions README.md
Expand Up @@ -12,11 +12,11 @@ There's just one problem: You have to manually keep your tags files up-to-date a

Unzip the most recent ZIP archives of the [vim-easytags] [download-easytags] and [vim-misc] [download-misc] plug-ins inside your Vim profile directory (usually this is `~/.vim` on UNIX and `%USERPROFILE%\vimfiles` on Windows), restart Vim and execute the command `:helptags ~/.vim/doc` (use `:helptags ~\vimfiles\doc` instead on Windows).

If you prefer you can also use [Pathogen] [pathogen], [Vundle] [vundle] or a similar tool to install & update the [vim-easytags] [github-easytags] and [vim-misc] [github-misc] plug-ins using a local clone of the git repository.
If you prefer you can also use [Pathogen] [pathogen], [Vundle] [vundle] or a similar tool to install and update the [vim-easytags] [github-easytags] and [vim-misc] [github-misc] plug-ins using a local clone of the git repository.

Now try it out: Edit any file type supported by Exuberant Ctags and within ten seconds the plug-in should create/update your tags file (`~/.vimtags` on UNIX, `~/_vimtags` on Windows) with the tags defined in the file you just edited! This means that whatever file you're editing in Vim (as long as it's on the local file system), tags will always be available by the time you need them!

Additionally if the file you just opened is an AWK, C#, C, C++, Objective-C, Java, Lua, PHP, Python, Ruby, Shell, Tcl or Vim source file you should also notice that the function and type names defined in the file have been syntax highlighted.
Additionally if the file you just opened is an AWK, C#, C, C++, Objective-C, Java, Lua, Perl, PHP, Python, Ruby, Shell, Tcl or Vim source file you should also notice that the function and/or type names defined in the file have been syntax highlighted.

The `easytags.vim` plug-in is intended to work automatically once it's installed, but if you want to change how it works there are several options you can change and commands you can execute from your own mappings and/or automatic commands. These are all documented below.

Expand Down Expand Up @@ -248,6 +248,7 @@ The easytags plug-in defines new highlighting groups for dynamically highlighted
* **C, C++, Objective C:** `cTypeTag`, `cEnumTag`, `cPreProcTag`, `cFunctionTag`, `cMemberTag`
* **Java:** `javaClassTag`, `javaInterfaceTag`, `javaMethodTag`
* **Lua:** `luaFuncTag`
* **Perl:** `perlFunctionTag`
* **PHP:** `phpFunctionsTag`, `phpClassesTag`
* **Python:** `pythonFunctionTag`, `pythonMethodTag`, `pythonClassTag`
* **Ruby:** `rubyModuleNameTag`, `rubyClassNameTag`, `rubyMethodNameTag`
Expand Down
14 changes: 12 additions & 2 deletions autoload/xolox/easytags.vim
@@ -1,9 +1,9 @@
" Vim script
" Author: Peter Odding <peter@peterodding.com>
" Last Change: September 14, 2014
" Last Change: September 17, 2014
" URL: http://peterodding.com/code/vim/easytags/

let g:xolox#easytags#version = '3.6.7'
let g:xolox#easytags#version = '3.7'
let g:xolox#easytags#default_pattern_prefix = '\C\<'
let g:xolox#easytags#default_pattern_suffix = '\>'

Expand Down Expand Up @@ -826,6 +826,16 @@ call xolox#easytags#define_tagkind({

highlight def link tclCommandTag Operator

" Perl. {{{2

call xolox#easytags#define_tagkind({
\ 'filetype': 'perl',
\ 'hlgroup': 'perlFunctionTag',
\ 'tagkinds': '[s]',
\ 'pattern_prefix': '\%(\<sub\s\+\)\@<!\<'})

highlight def link perlFunctionTag Operator

" }}}

" Restore "cpoptions".
Expand Down
11 changes: 6 additions & 5 deletions doc/easytags.txt
Expand Up @@ -84,8 +84,8 @@ and '%USERPROFILE%\vimfiles' on Windows), restart Vim and execute the command
':helptags ~/.vim/doc' (use ':helptags ~\vimfiles\doc' instead on Windows).

If you prefer you can also use Pathogen [8], Vundle [9] or a similar tool to
install & update the vim-easytags [10] and vim-misc [11] plug-ins using a local
clone of the git repository.
install and update the vim-easytags [10] and vim-misc [11] plug-ins using a
local clone of the git repository.

Now try it out: Edit any file type supported by Exuberant Ctags and within ten
seconds the plug-in should create/update your tags file ('~/.vimtags' on UNIX,
Expand All @@ -94,9 +94,9 @@ This means that whatever file you're editing in Vim (as long as it's on the
local file system), tags will always be available by the time you need them!

Additionally if the file you just opened is an AWK, C#, C, C++, Objective-C,
Java, Lua, PHP, Python, Ruby, Shell, Tcl or Vim source file you should also
notice that the function and type names defined in the file have been syntax
highlighted.
Java, Lua, Perl, PHP, Python, Ruby, Shell, Tcl or Vim source file you should
also notice that the function and/or type names defined in the file have been
syntax highlighted.

The 'easytags.vim' plug-in is intended to work automatically once it's
installed, but if you want to change how it works there are several options you
Expand Down Expand Up @@ -527,6 +527,7 @@ by the easytags plug-in:
'cFunctionTag', 'cMemberTag'
- **Java:**'javaClassTag', 'javaInterfaceTag', 'javaMethodTag'
- **Lua:**'luaFuncTag'
- **Perl:**'perlFunctionTag'
- **PHP:**'phpFunctionsTag', 'phpClassesTag'
- **Python:**'pythonFunctionTag', 'pythonMethodTag', 'pythonClassTag'
- **Ruby:**'rubyModuleNameTag', 'rubyClassNameTag', 'rubyMethodNameTag'
Expand Down

0 comments on commit d251fdb

Please sign in to comment.