Fork me on GitHub

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

w00t! That did it, thanks!


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

yes 2

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