Search code examples
pythonvimtagstagbar

How to disable showing visibility symbols in Tagbar for a specific filetype?


I want g:tagbar_show_visibility be set to '0' for Python files as there's no public/protected/private in Python. How can I configure Vim this way?


Solution

  • You can customize ctagsargs for a particular filetype, making ctags not output the 'visibility' information for tags in the first place, e.g.:

    let g:tagbar_type_python = {
        \ 'ctagsargs' : '-f - --excmd=pattern --fields=nksSmt'
    \ }
    

    The important bit here is the --fields option, which specifies the fields to be included for each tag.