Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I have just started to play with neovim and the first thing I did was to define a function:

  function bindKey(mode, keys, command, options)
    options = options or {noremap = true, silent = true}
    return vim.api.nvim_set_keymap(mode, keys, command, options)
  end
With that, remapping looks like this:

  bindKey('n', '<Tab>', ':bnext<CR>')
Which is in my opinion better than Vim syntax. I definitely see the potential in having Lua as scripting language.


Don't get me wrong I prefer lua to vimscript in almost every way. For migrating my existing settings, I didn't see the need to translate to lua, `vim.api.nvim_exec([[ ... ]])` and `vim.cmd('source ' .. path_to_vim_file)` work wonderfully. It's a joy to use lua for refactoring the remaining logic.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: