Vim Plugins ● We can get more powerful Vim with plugins. ○ Plugin examples: vim-rails (I don't use it), Denite.nvim, NeoSnippet, … ● Vim plug-ins are written in Vim script. ○ And, many "dark-powered" Vim plug-ins are written in Python.
Vim Ruby ● We can write Vim plugins in native language. ● We can use gems e.g.) ActiveSupport ● We can use Ruby's powerful standard libraries ○ https://docs.ruby-lang.org/ja/latest/class/String.html ● See more information → :help ruby ○ http://vim-jp.org/vimdoc-ja/if_ruby.html
Ruby → Vim(I think it is a workaround...) # In Ruby script, serialize the result, # and assign Vim script's variable Vim.command "let s:result = #{res.to_json}" " In Vim script echo s:result
Iro.vim ● A new syntax highlighter for Ruby, YAML, and Python (Python support is experimental). ● Use parser to highlight instead of regular expression. ○ Ripper, Psych, ... ● It highlights perfectly.
Conclusion ● We can write Vim plugins in Ruby ● You can find examples, iro.vim and yaml-path.vim. ● Maybe it is helpful for Rails. Thank you for listening! Follow me Twitter: @p_ck_ GitHub: @pocke