vim-crystal / vim-crystal

Vim filetype and tools support for Crystal language.
http://crystal-lang.org/
MIT License
412 stars 33 forks source link

vim-crystal commands do not work #113

Open Aeromus opened 2 years ago

Aeromus commented 2 years ago

Output of vim --version or nvim --version

VIM - Vi IMproved 8.1 (2018 May 18, compiled Feb 01 2022 09:16:32)
Included patches: 1-2269, 3612, 3625, 3669, 3741
Modified by team+vim@tracker.debian.org
Compiled by team+vim@tracker.debian.org
Huge version with GTK3 GUI.  Features included (+) or not (-):
+acl               -farsi             -mouse_sysmouse    -tag_any_white
+arabic            +file_in_path      +mouse_urxvt       +tcl
+autocmd           +find_in_path      +mouse_xterm       +termguicolors
+autochdir         +float             +multi_byte        +terminal
-autoservername    +folding           +multi_lang        +terminfo
+balloon_eval      -footer            -mzscheme          +termresponse
+balloon_eval_term +fork()            +netbeans_intg     +textobjects
+browse            +gettext           +num64             +textprop
++builtin_terms    -hangul_input      +packages          +timers
+byte_offset       +iconv             +path_extra        +title
+channel           +insert_expand     +perl              +toolbar
+cindent           +job               +persistent_undo   +user_commands
+clientserver      +jumplist          +postscript        +vartabs
+clipboard         +keymap            +printer           +vertsplit
+cmdline_compl     +lambda            +profile           +virtualedit
+cmdline_hist      +langmap           -python            +visual
+cmdline_info      +libcall           +python3           +visualextra
+comments          +linebreak         +quickfix          +viminfo
+conceal           +lispindent        +reltime           +vreplace
+cryptv            +listcmds          +rightleft         +wildignore
+cscope            +localmap          -ruby              +wildmenu
+cursorbind        +lua               +scrollbind        +windows
+cursorshape       +menu              +signs             +writebackup
+dialog_con_gui    +mksession         +smartindent       +X11
+diff              +modify_fname      +sound             -xfontset
+digraphs          +mouse             +spell             +xim
+dnd               +mouseshape        +startuptime       +xpm
-ebcdic            +mouse_dec         +statusline        +xsmp_interact
+emacs_tags        +mouse_gpm         -sun_workshop      +xterm_clipboard
+eval              -mouse_jsbterm     +syntax            -xterm_save
+ex_extra          +mouse_netterm     +tag_binary        
+extra_search      +mouse_sgr         -tag_old_static    
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wdate-time  -g -O2 -fdebug-prefix-map=/build/vim-9EpYYi/vim-8.1.2269=. -fstack-protector-strong -Wformat -Werror=format-security -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Linking: gcc   -Wl,-E  -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim   -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo -lnsl  -lselinux  -lcanberra -lacl -lattr -lgpm -ldl  -L/usr/lib -llua5.2 -Wl,-E  -fstack-protector-strong -L/usr/local/lib  -L/usr/lib/x86_64-linux-gnu/perl/5.30/CORE -lperl -ldl -lm -lpthread -lcrypt  -L/usr/lib/python3.8/config-3.8-x86_64-linux-gnu -lpython3.8 -lcrypt -lpthread -ldl -lutil -lm -lm -L/usr/lib/x86_64-linux-gnu -ltcl8.6 -ldl -lz -lpthread -lm

vim-crystal configuration in your .vimrc

No actual configuration for vim crystal outside of Plugin 'rhysd/vim-crystal' for Vundle.

Steps to reproduce

Installation either via copying the files into ~./vim as described in README or via Vundle does not appear to install vim-crystal properly. Crystal commands such as :CrystalFormat do not work / load and vim gives "Not and editor command"

Expected behavior

Vim-Crystal commands work

Actual behavior

All vim-crystal commands give "Not an editor command" when attempted to be run. It appears that vim-crystal is atleast partially installed correctly as syntax highlighting does work

Additional information

The information in issue 47 does not appear to help in my case

Results of crystal --version Crystal 1.1.1 [6d9a1d583] (2021-07-26)

LLVM: 10.0.1 Default target: x86_64-unknown-linux-gnu

rhysd commented 2 years ago

:Crystal* commands are defined in buffer local. They are only defined when you open a buffer with ft=crystal (the file name ends with .cr). Otherwise they won't be defined.

Aeromus commented 2 years ago

I am working with .cr files and even vim appears to recognize the open files as crystal but the :Crystal* commands still do not appear to be loading in properly

rhysd commented 2 years ago

It's weird because it means ftplugin is not loaded though a filetype is set properly. Can you check vim-crystal/ftplugin/ directory exists in your local?

rhysd commented 2 years ago

And can you check the output from

:echo exists('b:did_ftplugin')

after loading a .cr file?

Aeromus commented 2 years ago

The result of :echo exists('b:did_ftplugin') shows as 0 in vim. And inside my .vim directory there is a ftplugin it just does not reside under a vim-crystal directory

Aeromus commented 2 years ago

Sorry accidentally hit the close button

rhysd commented 2 years ago

The result of :echo exists('b:did_ftplugin') shows as 0 in vim.

So it means ftplugin is not loaded.

And inside my .vim directory there is a ftplugin it just does not reside under a vim-crystal directory

So ~/.vim/bundle/vim-crystal/ftplugin exists, am I correct?

Would you share the following information if you are ok?

Aeromus commented 2 years ago

Correct ~/.vim/bundle/vim-crystal/ftplugin does exist

Output of tree -L 3 ~/.vim/bundle/

/home/andrew/.vim/bundle
├── ag.vim
│   ├── autoload
│   │   └── ag.vim
│   ├── doc
│   │   ├── ag.txt
│   │   └── tags
│   ├── plugin
│   │   └── ag.vim
│   ├── Rakefile
│   └── README.md
├── ctrlp.vim
│   ├── autoload
│   │   ├── ctrlp
│   │   └── ctrlp.vim
│   ├── doc
│   │   ├── ctrlp.txt
│   │   └── tags
│   ├── plugin
│   │   └── ctrlp.vim
│   └── readme.md
├── delimitMate
│   ├── autoload
│   │   └── delimitMate.vim
│   ├── basic_vimrc
│   ├── doc
│   │   ├── delimitMate.txt
│   │   └── tags
│   ├── Makefile
│   ├── plugin
│   │   └── delimitMate.vim
│   ├── README.md
│   └── test
│       ├── autoclose_matchpairs.txt
│       ├── autoclose_matchpairs.vim
│       ├── autoclose_quotes.txt
│       ├── autoclose_quotes.vim
│       ├── eol_marker.vim
│       ├── expand_cr.txt
│       ├── expand_cr.vim
│       ├── expand_space.txt
│       ├── expand_space.vim
│       ├── first_buffer_no_ft.vim
│       ├── Makefile
│       ├── README.md
│       └── _setup.vim
├── html5.vim
│   ├── after
│   │   └── syntax
│   ├── autoload
│   │   ├── htmlcomplete.vim
│   │   └── xml
│   ├── CHANGES.markdown
│   ├── config.mk
│   ├── ftplugin
│   │   └── html.vim
│   ├── indent
│   │   └── html.vim
│   ├── Makefile
│   ├── README.md
│   └── syntax
│       ├── html
│       ├── html.vim
│       └── javascript
├── iceberg-dark
│   ├── autoload
│   │   ├── airline
│   │   └── lightline
│   ├── iceberg-dark-powerline.json
│   ├── LICENSE
│   ├── README.md
│   └── screenshots
│       ├── airline.png
│       ├── airline_tmux.png
│       ├── bumblebee.png
│       ├── code_snippet.png
│       ├── lightline_new.png
│       ├── lightline_old.png
│       ├── lightline_tmux.png
│       ├── tmux_minimal.png
│       ├── tmux_powerline.png
│       ├── tmux_rounded.png
│       └── tmux_slanted.png
├── indentLine
│   ├── after
│   │   ├── plugin
│   │   └── syntax
│   ├── doc
│   │   ├── indentLine.txt
│   │   └── tags
│   ├── glyph
│   │   └── indentLine-dotted-guide.eps
│   ├── LICENSE
│   └── README.md
├── nerdtree
│   ├── autoload
│   │   ├── nerdtree
│   │   └── nerdtree.vim
│   ├── CHANGELOG.md
│   ├── _config.yml
│   ├── doc
│   │   ├── NERDTree.txt
│   │   └── tags
│   ├── lib
│   │   └── nerdtree
│   ├── LICENCE
│   ├── nerdtree_plugin
│   │   ├── exec_menuitem.vim
│   │   ├── fs_menu.vim
│   │   └── vcs.vim
│   ├── plugin
│   │   └── NERD_tree.vim
│   ├── README.markdown
│   ├── screenshot.png
│   └── syntax
│       └── nerdtree.vim
├── nyancat-vim
│   ├── autoload
│   │   ├── nyancat2.vim
│   │   └── nyancat.vim
│   ├── images
│   │   ├── frame2-1.txt
│   │   ├── frame2-2.txt
│   │   ├── frame2-3.txt
│   │   ├── frame2-4.txt
│   │   ├── frame2-5.txt
│   │   ├── frame2-6.txt
│   │   └── pattern2.txt
│   ├── LICENSE
│   ├── nyancat2.vim
│   ├── nyancat.vim
│   ├── plugin
│   │   └── nyancat.vim
│   └── README.mkd
├── supertab
│   ├── doc
│   │   ├── supertab.txt
│   │   └── tags
│   ├── ftplugin
│   │   ├── html.vim
│   │   └── xml.vim
│   ├── Makefile
│   ├── plugin
│   │   └── supertab.vim
│   └── README.rst
├── tcomment_vim
│   ├── addon-info.json
│   ├── autoload
│   │   ├── tcomment
│   │   └── tcomment.vim
│   ├── CHANGES.TXT
│   ├── doc
│   │   ├── tags
│   │   └── tcomment.txt
│   ├── etc
│   │   └── tpl_tcomment.txt
│   ├── LICENSE.TXT
│   ├── plugin
│   │   └── tcomment.vim
│   ├── README
│   └── spec
│       └── tcomment
├── vim-airline
│   ├── autoload
│   │   ├── airline
│   │   └── airline.vim
│   ├── CHANGELOG.md
│   ├── CONTRIBUTING.md
│   ├── doc
│   │   ├── airline.txt
│   │   └── tags
│   ├── Gemfile
│   ├── LICENSE
│   ├── plugin
│   │   └── airline.vim
│   ├── Rakefile
│   ├── README.md
│   └── t
│       ├── airline.vim
│       ├── builder.vim
│       ├── commands.vim
│       ├── extensions_default.vim
│       ├── extensions_tabline.vim
│       ├── highlighter.vim
│       ├── init.vim
│       ├── parts.vim
│       ├── section.vim
│       ├── themes.vim
│       └── util.vim
├── vim-airline-themes
│   ├── autoload
│   │   └── airline
│   ├── doc
│   │   ├── airline-themes.txt
│   │   └── tags
│   ├── LICENSE
│   ├── plugin
│   │   └── airline-themes.vim
│   ├── README.md
│   └── test
│       └── airline-themes.vader
├── vim-crystal
│   ├── autoload
│   │   ├── crystal
│   │   ├── crystal_lang.vim
│   │   ├── ecrystal.vim
│   │   └── vital
│   ├── ftdetect
│   │   ├── crystal.vim
│   │   └── ecrystal.vim
│   ├── ftplugin
│   │   ├── crystal.vim
│   │   └── ecrystal.vim
│   ├── indent
│   │   ├── crystal.vim
│   │   └── ecrystal.vim
│   ├── LICENSE.txt
│   ├── plugin
│   │   └── crystal.vim
│   ├── README.md
│   ├── syntax
│   │   ├── crystal.vim
│   │   └── ecrystal.vim
│   └── syntax_checkers
│       └── crystal
├── vim-css3-syntax
│   ├── after
│   │   └── syntax
│   ├── README.md
│   └── test
│       └── test.css
├── vim-css-color
│   ├── after
│   │   └── syntax
│   ├── autoload
│   │   └── css_color.vim
│   ├── LICENSE
│   ├── README.md
│   ├── syntax
│   │   └── colornames
│   └── tests
│       ├── bench
│       ├── example.csh
│       ├── example.css
│       ├── example.fish
│       ├── example.jsx
│       ├── example.less
│       ├── example.nix
│       ├── example.sass
│       ├── example.scss
│       ├── example.sh
│       ├── example.stylus
│       ├── example.tcsh
│       ├── example.ts
│       ├── example.tsx
│       ├── example.zsh
│       └── torture.css
├── vim-endwise
│   ├── CONTRIBUTING.markdown
│   ├── plugin
│   │   └── endwise.vim
│   └── README.markdown
├── vim-fugitive
│   ├── autoload
│   │   └── fugitive.vim
│   ├── CONTRIBUTING.markdown
│   ├── doc
│   │   ├── fugitive.txt
│   │   └── tags
│   ├── ftdetect
│   │   └── fugitive.vim
│   ├── ftplugin
│   │   └── fugitiveblame.vim
│   ├── plugin
│   │   └── fugitive.vim
│   ├── README.markdown
│   └── syntax
│       ├── fugitiveblame.vim
│       └── fugitive.vim
├── vim-json
│   ├── ftdetect
│   │   └── json.vim
│   ├── ftplugin
│   │   └── json.vim
│   ├── indent
│   │   └── json.vim
│   ├── jsonl-test.jsonl
│   ├── jsonp-test.jsonp
│   ├── json-test.json
│   ├── license.md
│   ├── readme.md
│   └── syntax
│       └── json.vim
├── vim-markdown
│   ├── ftdetect
│   │   └── markdown.vim
│   ├── ftplugin
│   │   └── markdown.vim
│   ├── README.markdown
│   └── syntax
│       └── markdown.vim
├── vim-qargs
│   ├── plugin
│   │   └── qargs.vim
│   └── README.md
├── vim-ragtag
│   ├── CONTRIBUTING.markdown
│   ├── doc
│   │   ├── ragtag.txt
│   │   └── tags
│   ├── plugin
│   │   └── ragtag.vim
│   └── README.markdown
├── vim-rainbow
│   ├── plugin
│   │   └── rainbow.vim
│   └── README.md
├── vim-ruby
│   ├── autoload
│   │   └── rubycomplete.vim
│   ├── ChangeLog
│   ├── compiler
│   │   ├── eruby.vim
│   │   ├── rake.vim
│   │   ├── rspec.vim
│   │   ├── rubyunit.vim
│   │   └── ruby.vim
│   ├── CONTRIBUTORS
│   ├── doc
│   │   ├── ft-ruby-indent.txt
│   │   ├── ft-ruby-omni.txt
│   │   ├── ft-ruby-plugin.txt
│   │   ├── ft-ruby-syntax.txt
│   │   └── tags
│   ├── etc
│   │   └── examples
│   ├── ftdetect
│   │   ├── ruby_extra.vim
│   │   └── ruby.vim
│   ├── ftplugin
│   │   ├── eruby.vim
│   │   └── ruby.vim
│   ├── Gemfile
│   ├── Gemfile.lock
│   ├── indent
│   │   ├── eruby.vim
│   │   └── ruby.vim
│   ├── INSTALL.markdown
│   ├── NEWS
│   ├── README.markdown
│   ├── spec
│   │   ├── indent
│   │   ├── spec_helper.rb
│   │   ├── syntax
│   │   └── vim
│   └── syntax
│       ├── eruby.vim
│       └── ruby.vim
├── vim-surround
│   ├── doc
│   │   ├── surround.txt
│   │   └── tags
│   ├── plugin
│   │   └── surround.vim
│   └── README.markdown
├── vim-visual-multi
│   ├── autoload
│   │   ├── vm
│   │   └── vm.vim
│   ├── doc
│   │   ├── tags
│   │   ├── visual-multi.txt
│   │   ├── vm-ex-commands.txt
│   │   ├── vm-faq.txt
│   │   ├── vm-mappings.txt
│   │   ├── vm-settings.txt
│   │   ├── vm-troubleshooting.txt
│   │   └── vm-tutorial
│   ├── LICENSE
│   ├── plugin
│   │   └── visual-multi.vim
│   ├── python
│   │   └── vm.py
│   ├── README.md
│   ├── run_tests
│   ├── test
│   │   ├── default
│   │   ├── README.md
│   │   ├── requirements.txt
│   │   ├── test.py
│   │   └── tests
│   └── tutorialrc
└── Vundle.vim
    ├── autoload
    │   ├── vundle
    │   └── vundle.vim
    ├── changelog.md
    ├── CONTRIBUTING.md
    ├── doc
    │   ├── tags
    │   └── vundle.txt
    ├── ftplugin
    │   └── vundlelog.vim
    ├── LICENSE-MIT.txt
    ├── README_KR.md
    ├── README.md
    ├── README_ZH_CN.md
    ├── README_ZH_TW.md
    ├── syntax
    │   └── vundlelog.vim
    └── test
        ├── files
        ├── minirc.vim
        └── vimrc

153 directories, 260 files

Output of :set runtimepath

runtimepath=~/.vim,~/.vim/bundle/Vundle.vim,~/.vim/bundle/vim-markdown,~/.vim/
bundle/vim-fugitive,~/.vim/bundle/supertab,~/.vim/bundle/vim-ruby,~/.vim/bundle/
vim-crystal,~/.vim/bundle/vim-endwise,~/.vim/bundle/vim-ragtag,~/.vim/bundle/ctr
lp.vim,~/.vim/bundle/vim-qargs,~/.vim/bundle/html5.vim,~/.vim/bundle/delimitMate
,~/.vim/bundle/tcomment_vim,~/.vim/bundle/vim-airline,~/.vim/bundle/vim-airline-
themes,~/.vim/bundle/nyancat-vim,~/.vim/bundle/vim-css-color,~/.vim/bundle/vim-c
ss3-syntax,~/.vim/bundle/indentLine,~/.vim/bundle/vim-visual-multi,~/.vim/bundle
/vim-json,~/.vim/bundle/nerdtree,~/.vim/bundle/vim-rainbow,~/.vim/bundle/vim-sur
round,~/.vim/bundle/iceberg-dark,~/.vim/bundle/ag.vim,/var/lib/vim/addons,/etc/v
im,/usr/share/vim/vimfiles,/usr/share/vim/vim81,/usr/share/vim/vimfiles/after,/e
tc/vim/after,/var/lib/vim/addons/after,~/.vim/after,~/.vim/bundle/Vundle.vim,~/.
vim/bundle/Vundle.vim/after,~/.vim/bundle/vim-markdown/after,~/.vim/bundle/vim-f
ugitive/after,~/.vim/bundle/supertab/after,~/.vim/bundle/vim-ruby/after,~/.vim/b
undle/vim-crystal/after,~/.vim/bundle/vim-endwise/after,~/.vim/bundle/vim-ragtag
/after,~/.vim/bundle/ctrlp.vim/after,~/.vim/bundle/vim-qargs/after,~/.vim/bundle
/html5.vim/after,~/.vim/bundle/delimitMate/after,~/.vim/bundle/tcomment_vim/afte
r,~/.vim/bundle/vim-airline/after,~/.vim/bundle/vim-airline-themes/after,~/.vim/
bundle/nyancat-vim/after,~/.vim/bundle/vim-css-color/after,~/.vim/bundle/vim-css
3-syntax/after,~/.vim/bundle/indentLine/after,~/.vim/bundle/vim-visual-multi/aft
er,~/.vim/bundle/vim-json/after,~/.vim/bundle/nerdtree/after,~/.vim/bundle/vim-r
ainbow/after,~/.vim/bundle/vim-surround/after,~/.vim/bundle/iceberg-dark/after,~
/.vim/bundle/ag.vim/after