ets-labs / python-vimrc

VIM Configuration for Python / Cython / C Development
BSD 3-Clause "New" or "Revised" License
652 stars 343 forks source link

Calling tagbar#autoopen(0) on line 129 causes errors when editing python files #34

Closed dbrill closed 6 years ago

dbrill commented 6 years ago

Line 129 causes errors 129: autocmd BufEnter *.py :call tagbar#autoopen(0)

Here are the errors I'm getting

Exit code: 1 
Error detected while processing function tagbar#autoopen[9]..<SNR>113_IsValidFile:
line   29: 
E121: Undefined variable: s:known_types 
E116: Invalid arguments for function has_key(s:known_types, a:ftype) 
E15: Invalid expression: !has_key(s:known_types, a:ftype
rmk135 commented 6 years ago

HI @dbrill ,

What type of file do you open? What version of Vim do you you?

dbrill commented 6 years ago

I'm running Vim 8.0 and I opened a python file.

rmk135 commented 6 years ago

It's very strange that you see an error. Can you, please, run vim --version and ctags --version and post it here?

It should be looking like this:

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Oct 26 2017 19:54:02)
MacOS X (unix) version
Included patches: 1-1220
Compiled by romanmogylatov@Romans-MacBook-Pro.local
Huge version without GUI.  Features included (+) or not (-):
+acl             +file_in_path    +mouse_sgr       +tag_old_static
+arabic          +find_in_path    -mouse_sysmouse  -tag_any_white
+autocmd         +float           +mouse_urxvt     -tcl
-balloon_eval    +folding         +mouse_xterm     +termguicolors
-browse          -footer          +multi_byte      +terminal
++builtin_terms  +fork()          +multi_lang      +terminfo
+byte_offset     -gettext         -mzscheme        +termresponse
+channel         -hangul_input    +netbeans_intg   +textobjects
+cindent         +iconv           +num64           +timers
-clientserver    +insert_expand   +packages        +title
+clipboard       +job             +path_extra      -toolbar
+cmdline_compl   +jumplist        +perl            +user_commands
+cmdline_hist    +keymap          +persistent_undo +vertsplit
+cmdline_info    +lambda          +postscript      +virtualedit
+comments        +langmap         +printer         +visual
+conceal         +libcall         +profile         +visualextra
+cryptv          +linebreak       -python          +viminfo
-cscope          +lispindent      +python3         +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con      -lua             +rightleft       +windows
+diff            +menu            +ruby            +writebackup
+digraphs        +mksession       +scrollbind      -X11
-dnd             +modify_fname    +signs           -xfontset
-ebcdic          +mouse           +smartindent     -xim
+emacs_tags      -mouseshape      +startuptime     -xpm
+eval            +mouse_dec       +statusline      -xsmp
+ex_extra        -mouse_gpm       -sun_workshop    -xterm_clipboard
+extra_search    -mouse_jsbterm   +syntax          -xterm_save
+farsi           +mouse_netterm   +tag_binary
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X_UNIX  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib  -L/usr/local/lib -o vim        -lncurses -liconv -framework Cocoa   -mmacosx-version-min=10.12 -fstack-protector-strong -L/usr/local/lib  -L/usr/local/Cellar/perl/5.26.1/lib/perl5/5.26.1/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc  -L/usr/local/opt/python3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/config-3.6m-darwin -lpython3.6m -framework CoreFoundation  -lruby.2.4.2 -lobjc
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
  Compiled: Sep 16 2017, 13:24:32
  Addresses: <dhiebert@users.sourceforge.net>, http://ctags.sourceforge.net
  Optional compiled features: +wildcards, +regex
dbrill commented 6 years ago

Hey I figured out the problem. When installing xcode it copied its BSD version of ctags to /usr/bin/ which was found and executed before my brew installed version of ctags at /usr/local/bin. For some reason xcode's version of ctags was causing trouble. Thanks for the responses!

rmk135 commented 6 years ago

Great! Good to know that it's figured out! Thanks!