Vim, Tagbar, and PowerShell

I discovered a plugin named Tagbar that provides a sort of outline view of the elements in your script or source code file. For example, here is how C# is displayed:

With a ctags.cnf file set up as described in a previous post, you need to add some information to your _vimrc to allow Tagbar to recognize tags for PowerShell.
In _vimrc:
let g:tagbar_type_ps1 = {
\ 'ctagstype' : 'powershell',
\ 'kinds' : [
\ 'f:function',
\ 'i:filter',
\ 'a:alias'
\ ]
\ }
(Note that the ‘f’, ‘i’, and ‘a’ match up with the end of the regex in ctags.cnf.)
Tell Tagbar where to find the Exuberant CTags executable, if it is not on your path:
let g:tagbar_ctags_bin='C:\ProgramData\chocolatey\bin\ctags.exe'

The result:

You can find Tagbar here: Tagbar

Leave a Reply

Your email address will not be published. Required fields are marked *

Are you human? * Time limit is exhausted. Please reload CAPTCHA.

Protected with IP Blacklist CloudIP Blacklist Cloud