Fork me on GitHub
#vim
<
2022-03-07
>
walterl00:03:19

How should one translate let maplocalleader = "\<BS>" to Fennel? (set nvim.g.maplocalleader "<BS>") doesn't work. Neither does "\<BS>", "\\<BS>", nor "\b".

Leaf Garland08:03:18

Strings like "\<BS>" are a feature of vim script, so they don't work in Lua (or fennel which compiles to Lua). The vim api provides a function to convert them called nvim_replace_termcodes. You can use it like this in Lua: vim.g.maplocalleader = vim.api.nvim_replace_termcodes('<BS>', true, true, true). It should be easy to translate that to fennel.

🎉 1
walterl20:03:48

w00t! That did it, thanks!

clj.max06:03:51

Out of curiosity, are you using Fennel->Lua to replace vimscript stuff?

yes 2
walterl20:03:33

That's exactly what I was customizing... Gotta have <BS> as maplocalleader 🙂