Awesome
cajus-nfnl <img src="docs/cajus-nvim.png" width="128" align="right">
A curvy and juicy neovim configuration following the "Keep it simple!" design principle, but using nfnl instead of aniseed.
Fork from cajus-nvim
What is this?
Setup config to transform your NVIM in a powerful Clojure IDE using fennel, clojure-lsp and conjure.
This is simplified version on my personal dotfiles setup, I highly recommend you to check it out for more advanced and updated configurations.
Prerequisites
Things you need installed in your OS to use this setup
How to use
Make sure you backup your current configuration files in $HOME/.config/nvim
BEFORE running this.
Run these commands in the root of this repo:
# Delete the current nvim config
rm -rf $HOME/.config/nvim
# Makes a symbolic link to the files in this repo
ln -sf $PWD/.config/nvim $HOME/.config/nvim
The first time you open a Fennel file under this directory you'll be prompted to trust this configuration file since it's Fennel code that's executed on your behalf. You can put any Fennel code you want in this file, just be sure to return a table of configuration at the end.
Plugins
- lazy A modern plugin manager for Neovim
- nfnl Enhance your Neovim with Fennel
- conjure Interactive repl based evaluation for nvim
- telescope Find, Filter, Preview, Pick
- treesitter Incremental parsing system for highlighting, indentation, or folding
- nvim-lspconfig Quickstart configurations for the Nvim LSP client
- nvim-cmp Autocompletion plugin
- tokyonight-nvim A clean, dark Neovim theme written in Lua
- nvim-paredit A Paredit implementation for Neovim, built using Treesitter and written in Lua.
- nvim-paredit-fennel A fennel language extension for nvim-paredit
- nvim-surround * Add/change/delete surrounding delimiter pairs with ease. Written with ❤️ in Lua.*
- nvim-autopairs autopairs for neovim written by lua
- lualine neovim statusline plugin written in pure lua
- luasnip Snippet Engine for Neovim written in Lua.
Files
All *.lua
files, apart from .config/nvim/init.lua
and .config/nvim/lua/plugins.lua
, are generated by nfnl and should not be edited directly.
.config/nvim/init.lua
Bootstrapper is written in Lua with recommended setup for lazy.nvim.
This file also contains settings for the leader key as
space
and local-leader as,
, unfortunately, this has to be done only here before lazy.nvim setup due to its limitations.
.config/nvim/lua/plugins.lua
The last lua file manually created for this setup, defines some required plugins (nfnl & nvim.lua) that are needed for the fennel setup works and the lazy.nvim as an updatable plugin.
.config/nvim/fnl/plugins/theme.fnl
Theme settings like style and comment style.
.config/nvim/fnl/plugins/lualine.fnl
Settings for lualine status line like some theme overrides and setting what will be shown in the line. Also calls some lsp functions to read the startup state on the status line.
.config/nvim/fnl/plugins/lsp.fnl
All about nvim's lsp settings and keymaps.
Settings:
- In the first session, we define which symbols to show for lsp diagnostics.
- Later we describe which features and server settings we want to enable/customize.
- Handler defines features and how we want to render the server outputs.
- Capabilities we link with our autocompletion plugin (nvim-cmp), to say to the lsp servers that we have this feature enabled.
- On_Attach we customize our interaction with the LSP server, here we define the following keymaps:
gd
Go to definitionK
Show documentation<leader>ld
Function declarations<leader>lt
Type Definitions<leader>lh
Signature Help<leader>ln
Rename<leader>le
Show line diagnostics<leader>lq
Show all diagnostics information<leader>lf
Auto format<leader>lj
Go to the next diagnostic<leader>lk
Go to the previous diagnostic<leader>la
Open code actions menu (Using telescope plugin interface)<leader>la
Open code actions menu for the selected text in VISUAL mode (Using telescope plugin interface)<leader>lw
Open workspace diagnostics list (Using telescope plugin interface)<leader>lr
Show all references list for an item under the cursor (Using telescope plugin interface)<leader>lr
Show all implementations list for an item under the cursor (Using telescope plugin interface)
- Lastly, we configure to use all settings above in clojure-lsp server instance.
.config/nvim/fnl/plugins/paredit.fnl
Config for a bundle of plugins to have a modern "vim-sexp-mappings-for-regular-people" like experience for lisp languages like Clojure and Fennel.
.config/nvim/fnl/plugins/telescope.fnl
Settings like ignore node_modules
and everything in .gitignore
to be listed in the file finder.
Keymaps:
<leader>ff
open the find files<leader>fg
open the fuzzy finder<leader>fb
open the find open buffer<leader>fh
open the nvim help fuzzy finder
.config/nvim/fnl/plugins/conjure.fnl
Conjure specifics settings, I like to remap the doc work keymap to be <localleader>K
instead of K
, to not conflict with the LSP docs K
.
.config/nvim/fnl/plugins/treesitter.fnl
Settings to select which treesitter's features we want to be enabled and which language extension we want to ensure they will be always installed.
.config/nvim/fnl/plugins/cmp.fnl
Here settings of which sources we want to show up in the autocomple menu like (conjure, lsp, buffer) and some mapping to navigate in the menu.
.config/nvim/fnl/config/lsp.fnl
Setup a global state to define lsp's startup status, for later be read by lualine.
.config/nvim/fnl/config/init.fnl
Set basic global vim configurations and general keymaps.
.config/nvim/.nfnl.fnl
nfnl's configuration file at the root of the project, is blank to rely on the defaults.
Features
Some gifs showing how it works.
Telescope - Find Files
<leader>ff
Lsp - Loading
on startup
Lsp - Syntax check
<leader>le
Lsp - Go to definition
gd
Lsp - Document/Signature Help
K
/<leader>lh
Lsp - Find definition/references
<leader>lr
Lsp - Formatting
<leader>lf
Lsp - Code actions
<leader>la
Lsp - Refactorings
<leader>la
Lsp - Rename
<leader>ln
Conjure - Eval
<localleader>er
Conjure - Repl
<localleader>lv
Conjure - Document
<localleader>K
Completion
Etymology
Cajus is the Portuguese for cashews, which is a fitting name because the format of its nuts reminded me of a parenthesis.
Contributing
If you find any dead links, misinformation or any improvements in this documents at all Emails, PRs and Issues are highly encouraged.
License
This is free and unencumbered software released into the public domain. For more information, please refer to http://unlicense.org