docs: update readme

This commit is contained in:
Youwen Wu 2025-02-01 15:01:36 -08:00
parent bbd2c8f4ba
commit 68f9f880a4
Signed by: youwen5
GPG key ID: 865658ED1FE61EC3

View file

@ -1,9 +1,44 @@
# viminal2 # viminal2
This is my second attempt at creating a Neovim configuration intended for This is my Neovim configuration, written in [Fennel](https://fennel-lang.org/),
NixOS. The [first](https://github.com/youwen5/viminal) was configured using a Lisp that transpiles to Lua. This allows me to continue Vimming while
[Nixvim](https://github.com/nix-community/nixvim). This mostly worked, except masquerading as an Emacs lisper, walking the fine line between the light and
you often had to escape into raw Lua strings to get precise customization. dark sides of text editing.
## Fennel
Originally I wrote this configuration in Lua but I decided to switch to Fennel
in order to make it even more esoteric to the average software developer. I
hand-wrote a few parts, and migrated all the existing code using
[antifennel](https://git.sr.ht/~technomancy/antifennel).
Fennel is a Lisp, so you see a lot of S-expressions. It looks really disgusting
at first, but once you grasp the true naked structure of Lisp code, you begin
to understand that it's the most powerful language God ever wrought.
![xkcd 297, lisp cycles](https://imgs.xkcd.com/comics/lisp_cycles.png)
Here is a snippet from `init.fnl`:
```fennel
(vim.api.nvim_create_autocmd [:VimResized]
{:callback (fn []
(local current-tab
(vim.api.nvim_get_current_tabpage))
(vim.cmd "tabdo wincmd =")
(vim.api.nvim_set_current_tabpage current-tab))
:desc "Resize splits with terminal window"
:group (vim.api.nvim_create_augroup :EqualizeSplits
{})})
```
## Nix
This configuration is built around the Nix package manager. In fact it is my
second attempt to do so. The [first](https://github.com/youwen5/viminal) was
configured using [Nixvim](https://github.com/nix-community/nixvim). This mostly
worked, except you often had to escape into raw Lua strings to get precise
customization.
Enter [nixCats](https://github.com/BirdeeHub/nixCats-nvim). It provides the Enter [nixCats](https://github.com/BirdeeHub/nixCats-nvim). It provides the
tools needed to mix Nix and Lua in your configurations. For advanced users, tools needed to mix Nix and Lua in your configurations. For advanced users,
@ -28,9 +63,7 @@ everything that a text editor's plugins shouldn't, and it's a perfect match.
You can test drive the configuration (even if you aren't on NixOS) if you have You can test drive the configuration (even if you aren't on NixOS) if you have
the Nix package manager available (with flakes). the Nix package manager available (with flakes).
```bash ```bash nix run 'github:youwen5/viminal2' ```
nix run 'github:youwen5/viminal2'
```
## Design ## Design