udalov / kotlin-vim

Kotlin plugin for Vim. Featuring: syntax highlighting, basic indentation, Syntastic support
Apache License 2.0
632 stars 51 forks source link

Plugin fails without Syntastic #42

Closed Vampire closed 2 years ago

Vampire commented 2 years ago

I just installed your plugin and started vim with a Kotlin file. First thing happening is this:

$ vim build.gradle.kts
Fehler beim Ausführen von "~/.vim/plugin/kotlin-vim/syntax_checkers/kotlin/kotlinc.vim":
Zeile   99:
E121: Undefinierte Variable: g:SyntasticRegistry
Betätigen Sie die EINGABETASTE oder geben Sie einen Befehl ein
Vampire commented 2 years ago

Besides that even after deleting that file, there is no syntax highlighting available. :-(

udalov commented 2 years ago

Can't reproduce. I use the plugin on multiple machines without Syntastic installed. Which vim version are you running? If it's 8+, can you try to put the plugin under ~/.vim/pack/plugins/start/kotlin-vim?

Vampire commented 2 years ago

It is the standard VIm shipped with Git for Windows as I am forced to Windows on this box:

$ vim --version
VIM - Vi IMproved 8.2 (2019 Dec 12 kompiliert am Nov 22 2021 19:31:05)
Inklusive der Patches: 1-3582
Übersetzt von <https://www.msys2.org/>
Riesige Version ohne GUI. Ein- (+) oder ausschließlich (-) der Eigenschaften:
+acl               +file_in_path      +mouse_urxvt       -tag_any_white
+arabic            +find_in_path      +mouse_xterm       -tcl
+autocmd           +float             +multi_byte        +termguicolors
+autochdir         +folding           +multi_lang        +terminal
-autoservername    -footer            -mzscheme          +terminfo
-balloon_eval      +fork()            +netbeans_intg     +termresponse
+balloon_eval_term +gettext           +num64             +textobjects
-browse            -hangul_input      +packages          +textprop
++builtin_terms    +iconv             +path_extra        +timers
+byte_offset       +insert_expand     +perl/dyn          +title
+channel           +ipv6              +persistent_undo   -toolbar
+cindent           +job               +popupwin          +user_commands
-clientserver      +jumplist          +postscript        +vartabs
+clipboard         +keymap            +printer           +vertsplit
+cmdline_compl     +lambda            +profile           +virtualedit
+cmdline_hist      +langmap           -python            +visual
+cmdline_info      +libcall           +python3/dyn       +visualextra
+comments          +linebreak         +quickfix          +viminfo
+conceal           +lispindent        +reltime           +vreplace
+cryptv            +listcmds          +rightleft         +wildignore
+cscope            +localmap          +ruby/dyn          +wildmenu
+cursorbind        -lua               +scrollbind        +windows
+cursorshape       +menu              +signs             +writebackup
+dialog_con        +mksession         +smartindent       -X11
+diff              +modify_fname      -sodium            -xfontset
+digraphs          +mouse             -sound             -xim
-dnd               -mouseshape        +spell             -xpm
-ebcdic            +mouse_dec         +startuptime       -xsmp
+emacs_tags        -mouse_gpm         +statusline        -xterm_clipboard
+eval              -mouse_jsbterm     -sun_workshop      -xterm_save
+ex_extra          +mouse_netterm     +syntax
+extra_search      +mouse_sgr         +tag_binary
-farsi             -mouse_sysmouse    -tag_old_static
          System-vimrc-Datei: "/etc/vimrc"
        Benutzer-vimrc-Datei: "$HOME/.vimrc"
 zweite Benutzer-vimrc-Datei: "~/.vim/vimrc"
         Benutzer-exrc-Datei: "$HOME/.exrc"
      defaults Datei: "$VIMRUNTIME/defaults.vim"
     Voreinstellung für $VIM: "/etc"
         und für $VIMRUNTIME: "/usr/share/vim/vim82"
Übersetzt: gcc -c -I. -Iproto -DHAVE_CONFIG_H -I/usr/include/ncursesw -march=x86-64 -mtune=generic -O2 -pipe -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linken: gcc -L. -pipe -fstack-protector-strong -pipe -Wl,--as-needed -o vim.exe -lm -lncursesw -liconv -lacl -lintl -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base -fstack-protector-strong -L/usr/lib/perl5/core_perl/CORE -lperl -lpthread -ldl -lcrypt

Moving to ~/.vim/pack/plugins/start/kotlin-vim and restoring the deleted file indeed makes it work. I don't see the error message and the syntax highlighting is working.

udalov commented 2 years ago

OK. I suspect that if the plugin is put under ~/.vim/plugin, every file gets executed, which is not the desirable behavior here. Using ~/.vim/pack/plugins is the recommended way (as per ReadMe).

Vampire commented 2 years ago

Oh, sorry, I thought I followed the readme. Maybe I was confused by other plugins being in there. Thanks for your help.