dataify the things

This commit is contained in:
2025-08-17 12:09:36 -09:00
parent 228d6a6f00
commit 535c2e7472
3 changed files with 766 additions and 925 deletions
+63 -18
View File
@@ -1,36 +1,81 @@
(module main
{require {a aniseed.core}})
;; for the memes. gotta have a macro example that compiles. replace with some thing useful sooon
;; for the memes. gotta have a macro example that compiles. replace with some thing useful soon
(macro unless [condition & code]
`(when (not ,condition)
,(unpack code)))
;; utils
(fn opt! [name value]
(fn opt! [[name value]]
(tset vim.o name value))
(local keymap! vim.keymap.set)
(fn nmap! [ks then-do desc]
(keymap! "n" ks then-do
(when desc
{:desc desc})))
(vim.keymap.set "n"
(.. "<leader>" ks)
(.. ":" then-do "<cr>")
(when desc {:desc desc})))
;; general keymaps
(->> [[ "fs" "w" "[f]ile [s]ave"]
["cf" "e ~/.config/nvim/fnl/init.fnl" "[c]onfig [f]ennel"] ;config helpers
["cl" "e ~/.config/nvim/init.lua" "[c]onfig [l]ua"]
["bn" "bn" "[b]uffer [n]ext"] ;buffer controls
["bp" "bp" "[b]uffer [p]revious"]
["bd" "bd" "[b]uffer [d]elete"]]
(a.map #(nmap! (unpack $1))))
;; general settings
(opt! :relativenumber true)
(opt! :tabstop 2)
(opt! :softtabstop 2)
(opt! :shiftwidth 2)
(opt! :expandtab true)
(->> {:number true ;line numbers
:rnu true
:scrolloff 10
:confirm true
:mouse :a
:showmode false
:cursorline true
:ts 2 ;tab setttings
:sts 2
:et true
:bri true ;tab wrapped lines
:undofile true
:swf false
:scl :yes
:ut 250 ;perf timeouts
:tm 350
:spr true ;splits
:sb true
:list true ;whitespace
:listchars "tab:» ,trail:·,nbsp:␣"
:inccommand :split
:ignorecase true
:smartcase true}
(a.map-indexed opt!))
;; speed up scroll
(def scroll-speed 8)
(vim.keymap.set "n" "<c-e>" (.. scroll-speed "<c-e>") {})
(vim.keymap.set "n" "<c-y>" (.. scroll-speed "<c-y>") {})
(comment
;; repl imports
(do
(local a (require "aniseed.core")))
;; keymaps
(nmap! "<leader>fs" ":w<cr>" "[f]ile [s]ave")
(nmap! "<leader>cf" ":e ~/.config/nvim/fnl/init.fnl<cr>" "[c]onfig [f]ennel" )
(nmap! "<leader>bn" ":bn<cr>" "[b]uffer [n]ext" )
(nmap! "<leader>bp" ":bp<cr>" "[b]uffer [p]revious" )
(nmap! "<leader>bd" ":bd<cr>" "[b]uffer [d]elete" )
;; playground
(a.map a.inc {1 1 2 1 3 1})
(type [])
;
)