Code Monkey home page Code Monkey logo

cajus-nfnl's Introduction

cajus-nfnl

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.

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.

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.

Theme settings like style and comment style.

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.

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 definition
      • K 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 for a bundle of plugins to have a modern "vim-sexp-mappings-for-regular-people" like experience for lisp languages like Clojure and Fennel.

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

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.

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.

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.

Setup a global state to define lsp's startup status, for later be read by lualine.

Set basic global vim configurations and general keymaps.

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

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

cajus-nfnl's People

Contributors

rafaeldelboni avatar threeinone avatar strobelt avatar pedrojunior-nubank avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.