• Tips
  • Lua and Vimscript Together

Tips : lua ファイルで vimscript、vim ファイルで lua をそれぞれ呼び出す方法

  • vimscript inside lua file
vim.cmd([[
echo 'This is vimscript.'
echo 'Multiple lines also available.'
]])
  • lua inside vim file
    • This breaks compatibility with vim
lua << EOF
vim.pretty_print('This is lua inside vimscript.')
vim.pretty_print('Multiple lines also available.')
EOF
" Write script to only run in nvim
if has('nvim')
  " do nvim specific stuffs
endif
Last updated on September 21, 2022