Home

Awesome

<img src="docs/cajus-nvim.png" width="128" align="right">

Archiving this project

This project will be archived as the author of Aniseed is making a significant change to how Fennel is used and creating the nfnl project.

A new fennel based configuration based on this is being evaluated to in the future to replace this project.

If you want to test the new setup please check it on cajus-nfnl

cajus-nvim

A curvy and juicy neovim configuration following the "Keep it simple!" design principle.

What is this?

Setup config to transform your NVIM in a powerful Clojure IDE using fennel, clojure-lsp and conjure.

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

When you start nvim for the first time it will download packer and aniseed and show some errors, thats normal press enter to ignore and go to the nvim console pressing : and type PackerInstall. This will install all plugins declared in fnl/config/plugin.fnl, after packer's panel showing all the plugins where installed, close nvim and open it again, no errors should show up this time.

Plugins

Using with other languages

Files

init.lua

Wrapper responsible for two things:

fnl/config/init.fnl

In this file among other settings I do set the leader key as space and local-leader as , for the sake of the examples of how use this configuration I will use this as basis for the commands.

fnl/config/plugin.fnl

Here we define the plugins we want packer to download and load for us, we define here a private function called use which will search in the plugin map for the keyword :mod and load the namespace defined in its value.

For example in the line we define that we need telescope we have this map:

  :nvim-telescope/telescope.nvim {:requires [:nvim-lua/popup.nvim
                                             :nvim-lua/plenary.nvim]
                                  :mod :telescope}

This will state to packer download nvim-telescope/telescope.nvim and all the required plugins in :requires and search for the namespace telescope in file located in the following path fnl/config/plugin/telescope, where I usually add plugin specific configuration like keymaps and settings.

fnl/config/plugin/conjure.fnl

Conjure specifics settings, I like to remap the doc work keymap to be <localleader>K instead the only K, to not conflict with the LSP docs K.

fnl/config/plugin/telescope.fnl

Settings like ignore node_modules and everything in .gitignore to be listed in the file finder. Keymaps:

fnl/config/plugin/treesitter.fnl

Settings to select which treesitter's features we want enabled and which language extension we want to ensure they will be always installed.

fnl/config/plugin/lspconfig.fnl

All about nvim's lsp settings and keymaps.

Settings:

fnl/config/plugin/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.

fnl/config/plugin/theme.fnl

Theme settings like style and comment style.

fnl/config/plugin/sexp.fnl

Settings for vim-sexp like enabling it for another lisp languages like Fennel and Jannet

fnl/config/plugin/lualine.fnl

Settings for lualine status line like some theme overides and setting what will be shown in the line.

Features

Some gifs showing how it works.

Telescope - Find Files

telescope-find-files <leader>ff

Lsp - Loading

lsp-loading on startup

Lsp - Syntax check

lsp-syntax-check <leader>le

Lsp - Go to definition

lsp-go-to-definition gd

Lsp - Document/Signature Help

lsp-document K/<leader>lh

Lsp - Find definition/references

lsp-find-references <leader>lr

Lsp - Formatting

lsp-format <leader>lf

Lsp - Code actions

lsp-code-actions <leader>la

Lsp - Refactorings

lsp-refactorings <leader>la

Lsp - Rename

lsp-rename <leader>ln

Conjure - Eval

conjure-eval <localleader>er

Conjure - Repl

conjure-repl <localleader>lv

Conjure - Document

conjure-document <localleader>K

Completion

auto-complete

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