wizard-28 / nyoom.nvim

Blazing fast, configurable, minimal and lispy neovim config written in Fennel. Base config for users to extend and add upon, leading to a more unique editing experience. (๐Ÿš€)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nyoom.nvim

Fennel

License Open Issues Neovim Minimum Version

<leader><space> Nyoommmmm!

~ Nyoom.nvim users (probably)

This config was a response to new configs that pop up, with very abstracted and complex codebases, such as NvChad. They try to be a one-size-fits-all config. NvChad and LunarVim both try to fit as much overall functionality as possible and needlessly lazy load everything, when it really isn't needed. Complex codebases lead to less freedom for end-user extensiblity. Try forking NvChad and making your own configuration out of it. Thats right, you can't. Everything is tied to the userConfig, and you rely on the maintainer of said code to implement features.

Nyoom.nvim provides a solution to these problems by providing only the necessary code in order to make a functioning configuration. The end goal of nyoom.nvim is to be used as a base config for users to extend and add upon, leading to a more unique editing experience. Its relatively small and simple, offers the bare minimum needed plugins to have a powerful config, and is suited to my needs, but can just as easily be suited to yours!

I recommend not to clone and directly install this config, but to fork it, inspect the code, and adjust it to your liking. The best neovim configuration is what you make, and this config is only supposed to provide you the tools to do so.

Design

Nyoom.nvim is designed against the mantras of doom-emacs: (shamelessly copypasted)

  • Gotta go fast. Startup and run-time performance are priorities.
  • Close to metal. There's less between you and vanilla neovim by design. That's less to grok and less to work around when you tinker.
  • Opinionated, but not stubborn. Nyoom (and Doom) are about reasonable defaults and curated opinions, but use as little or as much of it as you like.
  • Your system, your rules. You know better. At least, Nyoom hopes so! There are no external dependencies, and there never will be.

It also aligns with many of Doom's features:

  • Minimalistic good looks inspired by modern editors.
  • A modular organizational structure for separating concerns in your config. (somewhat, I plan to improve on this in the future by turning sets of packages into nyoom modules โ„ข๏ธ, and loading them via a macro like doom does)
  • A standard library designed to simplify your fennel bike shedding.
  • A declarative package management system (inspired by use-package, powered by Packer.nvim). Install packages from anywhere, and pin them to any commit.
  • A Space(vim)-esque keybinding scheme, centered around leader and localleader prefix keys (SPC and SPCm).
  • Project search (and replace) utilities, powered by ripgrep, fzf-native, sqlite, and telescope.

However, it also disagrees with some of those ideals

  • Packages are not pinned to commits by default. Unlike Doom, this configuration includes fewer than 20 packages by default and breaking changes are usually few and far between. Everything is rolling release, and if a breaking change does occur I will push a fix within a day (pinky promise!). Of course, you are free to pin packages yourself (and use :PackerSnapshot). I may reconsider as nyoom grows.

Credits

  • David Guevara For getting me into fennel, and for some of his beautiful macros. Without him Nyoom wouldn't exist!
  • Oliver Caldwell For his excellent work on Aniseed, Conjure, and making fennel feel like a first class langugae in neovim

Showcase

Lispy editing using conjure and parinfer-rust

conjure

parinfer.mov

Note-taking and Getting Things Done with neorg and orgmode

neorg

Syntax highlighting and Error checking with Neovim's builtin LSP, lspconfig, nvim-lsp-installer, trouble.nvim and nvim-treesitter

lsp

treesitter.mov

Quick Completion powered by nvim-cmp and copilot.vim

Screen Shot 2022-02-13 at 4 45 22 PM

Pretty notifications and focused editing using TrueZen, nvim-notify, and nvim-hlslens

notifymap

Informative Keybinds, Native Fuzzy Finding, and fast file history using nvim-telescope, telescope-fzf-native.nvim, telescope-frecency.nvim, sqlite.lua and which-key.nvim

which-key

telescope.mov

Install

Dependencies

The only dependencies are neovim-nightly and git.

Regular:

Install the following dependencies:

  • neovim-nightly (or neovim stable)
  • ripgrep
  • nodejs (optional, for copilot)
  • fennel + fnlfmt (not required, but recommended)
  • font with nerdfont icons
git clone --depth 1 https://github.com/shaunsingh/nyoom.nvim.git ~/.config/nvim 
nvim

Then run :PackerSync

Using nix:

Requires nix version > 21.11, with experimental features flakes and nix-commands enabled

git clone --depth 1 https://github.com/shaunsingh/nyoom.nvim.git && cd nyoom.nvim
nix develop

Then run nvim as usual, and :PackerSync to update/install plugins

Why fennel?

Fennel is a programming language that brings together the speed, simplicity, and reach of Lua with the flexibility of a lisp syntax and macro system. Macros are how lisps accomplish metaprogramming. Youโ€™ll see a lot of people treat lisp macros with a kind of mystical reverence. While several other languages have macro systems, the power of macros in lisps stem from allowance of lisps to you to write programs using the same notation you use for data structures. Remember: code is data, and we just need to manipulate data.

While people largely over exaggerate the usefulness of macros, there are a few places where macros shine, and configurations are one of them. Utilizing macros, we can essentially create our own syntax. For example, lets take a look at the set! macro I've used. set! is used for vim.opt options. For example, (set! mouse :a) expands to vim.opt["mouse"]="a". If a string or number isn't passed to set!, it will assume true. e.g. (set! list) will expand to vim.opt["list"]=true. Similarly if the option starts with no, it will assume false e.g. (set! noru) will expand to vim.opt["ru"]=false.

With the macros provided, you can configure neovim just as easily, or dare I say easier than you can with Lua or vimscript, while retaining the performance benefits of LuaJIT.

All the magic happens in the fnl/ folder. Some files to check out:

  • init.fnl: This is where you require any "main" fennel files (i.e. not plugin configurations).
  • pack.fnl: This is where all your plugins go. The pack file is in charge of configuring packer, installing, as well as loading plugins
  • config.fnl: This is where neovim settings go.
  • macros.fnl: In lisps, macros allow the user to define arbitrary functions that convert certain Lisp forms into different forms before evaluating or compiling them. This file contains all the macros that I (and a few others, thanks David and Kat!) have written to help you out on your neovim journey. I don't recommend touching this file unless you know what you're doing
  • maps.fnl: This is where all your mappings go
  • pack/: This is where plugin configs go.

Learning Fennel

For most people, chances are you haven't even heard of fennel before. So where should you start?

  1. Read through the Documentation
  2. Install fennel yourself! (Skip the part where it goes over adding fennel support to your editor, thats what this project is for :p)
  3. Learn lua first. I recommend reading through the Neovim lua guide as well.
  4. Learn fennel
  5. Go over the Style guide.
  6. Learn macros.

If you have trouble configuring neovim to your needs, check out Antifennel to see how lua code compiles back to fennel! However, the generated code isn't always the cleanest, so its recommend you use it as a last resort. If you need any help, feel free to reach out to me via email or discord, and be sure to join the Conjure Discord too!

Aniseed vs Hotpot

  • Aniseed: Aniseed bridges the gap between Fennel and Neovim, Allowing you to easily write plugins or configuration in a Clojure-like Lisp with great runtime performance. As opposed to hotpot, aniseed provides macros, is slightly faster and more featureful, compiles fennel files to the lua/ directory, and has better integration with conjure. It aims to provide a more clojure-like experience, and behaves as a superset of fennel.

  • Hotpot: Hotpot will transparently compile your Fennel code into Lua and then return the compiled module. Future calls to require (including in future Neovim sessions) will skip the compile step unless it's stale. Only compiles and caches fennel files, providing a more native experience for the user. On the other hand, it is slightly slower and less developed. Users looking for macros can use the builtin macros defined in macros.fnl, or the zest.nvim library.

In init.lua, you can set the compiler to aniseed/hotpot, and nyoom will handle the rest. All the current configuration is hotpot-compatible, so it doesn't use any aniseed macros by default. However, you are free to use them yourself.

Notes

If you have an issue with a plugin in Nyoom.nvim, first you should report it to Nyoom.nvim to see if it's an issue with it. Please don't bother package maintainers with issues that are caused by my configs, and vice versa. I'm new to fennel, so don't hesitate to tell me my lisp-fu sucks!

About

Blazing fast, configurable, minimal and lispy neovim config written in Fennel. Base config for users to extend and add upon, leading to a more unique editing experience. (๐Ÿš€)

License:MIT License


Languages

Language:Fennel 94.0%Language:Lua 3.5%Language:Nix 2.4%