Fork me on GitHub
#vim
<
2024-05-27
>
FlavaDave05:05:29

Hello! I am new to neovim and to fennel. I am experimenting with basic configuration with fennel. I got some basic config to work with aniseed but am now struggling to replicate something while using nfnl. After looking through https://github.com/rafaeldelboni/cajus-nfnl/tree/main as an example I tried the following only to get an error

(local {: autoload} (require :nfnl.module))
(local nvim (autoload :nvim))
(local core (autoload :nfnl.core))
(set nvim.g.maplocalleader ",")
error:
/Users/davidgonsalves/.vim/plugged/nfnl/lua/nfnl/module.lua:11: module 'nvim' not found:
	no field package.preload['nvim']
	no file './nvim.lua'
	no file '/opt/homebrew/share/luajit-2.1/nvim.lua'
	no file '/usr/local/share/lua/5.1/nvim.lua'
	no file '/usr/local/share/lua/5.1/nvim/init.lua'
	no file '/opt/homebrew/share/lua/5.1/nvim.lua'
	no file '/opt/homebrew/share/lua/5.1/nvim/init.lua'
	no file './nvim.so'
	no file '/usr/local/lib/lua/5.1/nvim.so'
	no file '/opt/homebrew/lib/lua/5.1/nvim.so'
	no file '/usr/local/lib/lua/5.1/loadall.so'
Can anyone help me out?

fuad13:05:35

I think what you want might be

(set vim.g.maplocalleader)

FlavaDave19:05:26

so that evaluates without error but it doesn't do anything

Oliver Marshall09:05:31

It looks like cajus is using https://github.com/norcalli/nvim.lua which provides the nvim module, although there's no need to as most of it was merged into neovim already under the vim module as @/fuad mentions. So your above code could probably be:

(local {: autoload} (require :nfnl.module))
(local core (autoload :nfnl.core))
(set vim.g.mapleader ",")

fuad10:05:09

Ah, I forgot the argument in my example facepalm

rafaeldelboni19:05:43

Hey good call, I've removed the norcalli/nvim.lua caju's dependency based on this conversation

FlavaDave19:05:04

Thanks @UMMMKKADU!!! I have been learning a lot from cajus-nfnl and your dotfile repository! I have been really enjoying configuring neovim with fennel and I could not have done it without some of your examples.

❤️ 1