(module main {require {a aniseed.core}}) ;; 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))) ;; leader keymaps (->> [ ["fs" "w" "[f]ile [s]ave"] ["cl" "e ~/.config/nvim/fnl/init.fnl" "[c]onfig [l]isp"] ;config helpers ["ci" "e ~/.config/nvim/init.lua" "[c]onfig [i]nit"] ["bn" "bn" "[b]uffer [n]ext"] ;buffer controls ["bp" "bp" "[b]uffer [p]revious"] ["bd" "bd" "[b]uffer [d]elete"] ] (a.map (lambda [[ks then-do desc]] (vim.keymap.set "n" (.. "" ks) (.. ":" then-do "") (when desc {:desc desc}))))) ;; 🦘 hop (->> [["gw" ":HopWord" " [G]o to [W]ord"] ["gs" ":HopChar2" " [G]o to [S]earch by 2 chars"] ] (a.map (lambda [[ks then-do desc]] (vim.keymap.set "n" ks (.. ":" then-do "") (when desc {:desc desc}))))) (vim.cmd "hi HopNextKey1 guifg=#fad82f") (vim.cmd "hi HopNextKey2 guifg=#c5b12d") ;; general settings (->> { :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 (lambda [[name value]] (tset vim.o name value)))) ;; speed up scroll (def scroll-speed 8) (vim.keymap.set "n" "" (.. scroll-speed "") {:desc "scroll down"}) (vim.keymap.set "n" "" (.. scroll-speed "") {:desc "scroll up"}) (comment ;; repl imports (do (local a (require "aniseed.core"))) ;; playground (a.map a.inc {1 1 2 1 3 1}) (type []) ; )