(let [cmp (require :cmp) luasnip (require :luasnip)] {:options (fn [] (set vim.g.mapleader " ") (set vim.g.maplocalleader "\\") (set vim.o.termguicolors true) (set vim.opt.clipboard :unnamedplus) (set vim.o.wrap false) (set vim.opt.colorcolumn "80,120") (vim.cmd.colorscheme :quiet) (set vim.o.formatoptions :tncro) (set vim.o.conceallevel 2) ;; 🤞 for anticonceal (set vim.o.foldlevel 1) (set vim.o.splitbelow true) (set vim.o.splitright true) (set vim.opt.swapfile false) (set vim.g.sexp_filetypes "racket,fennel,scheme,lisp")) :keymap (fn [] (let [nmap #(vim.keymap.set :n $1 $2 {:desc $3}) tmap #(vim.keymap.set :t $1 $2 {:desc (.. $3 " (from a terminal)")})] (nmap : :h "Move to window left") (tmap : :h "Move to window left") (nmap : :j "Move to window down") (tmap : :j "Move to window down") (nmap : :k "Move to window up") (tmap : :k "Move to window up") (nmap : :l "Move to window right") (tmap : :l "Move to window right") (tmap : "" "Escape to normal mode") (nmap : ":bn|bd!#" "Delete a buffer without removing the split") (nmap :tt ":termi" "Open a terminal in the current window") (nmap :to ":new term://bash|resize 8" "Open an 8 line terminal below the current window") (nmap :w :80| "Set the window width to 80 characters") (nmap :W :120| "Set the window width to 120 characters") (nmap :t ":tabnew" "Create a new tab page") (tmap :t ":tabnew" "Create a new tab page") (nmap : :gt "Go to next tab (cyclical)") (tmap : :gt "Go to next tab (cyclical)") (nmap :oo ":tcd ~/TDC-Obsidian/|edit WIP.md" "Open Obsidian") (nmap :ot ":ObsidianToday" "Open daily journal") (nmap :of ":ObsidianOpen" "Open this file in the Obsidian app") (nmap :p ":Telescope commands" "Search commands") (nmap :ff ":Telescope find_files" "Search filenames in :pwd") (nmap :fb ":Telescope buffers" "Search open buffers") (nmap :fs ":Telescope live_grep" "Search current buffer") (nmap :fe ":Telescope emoji" "Search for an emoji to copy to clipboard") (nmap :gs ":edit term://tigi" "Open tig(1) to stage and commit changes") (nmap :gn ":edit term://newsboati" "Open newsboat(1)") (let [duck (require :duck)] (nmap : #(duck.hatch) "hatch a duck") (nmap :dk #(duck.cook) "cook a duck")))) :obsidian {:workspaces [{:name "TDC-Obsidian" :path "/home/specter/TDC-Obsidian"}] :daily_notes {:folder "Journal/" :date_format "%Y/%m/%Y-%m-%d"} :disable_frontmatter true :ui { :enable true :checkboxes { " " {:char "⬜" :hl_group "ObsidianTodo"} "x" {:char "✔️" :hl_group "ObsidianDone"}} :external_link_icon {:char "↗️" :hl_group "ObsidianExtLinkIcon"}} :wiki_link_func "prepend_note_id" :follow_url_func (lambda [url] (vim.fn.jobstart ["xdg-open" url]))} :treesitter-languages [:c :lua :vim :vimdoc :query :fennel :racket] :language-servers {:lua_ls {:filetypes [:lua] :Lua {:workspace {:checkThirdParty false}} :telemetry {:enable false} :diagnostics {:globals [:vim]}} :fennel_language_server {:filetypes [:fennel] :fennel {:workspace {:library (vim.api.nvim_list_runtime_paths)} :diagnostics {:globals [:vim]}}} :bashls {:filetypes [:bash]} :marksman {:filetypes [:markdown]}} :lsp-attach (fn [_ bufnr] (let [nmap #(vim.keymap.set :n $1 $2 {:buffer bufnr :desc (.. "LSP: " $3)}) telescope (require :telescope.builtin)] (nmap :gd vim.lsp.buf.definition "[G]o to [D]efiniton") (nmap :gr telescope.lsp_references "[G]o to [R]eferences") (nmap :gI vim.lsp.buf.implementation "[G]o to [I]mplementation"))) :cmp-mapping {: (cmp.mapping.select_next_item) : (cmp.mapping.select_prev_item) : (cmp.mapping.scroll_docs -4) : (cmp.mapping.scroll_docs 4) : (cmp.mapping.complete) : (cmp.mapping.confirm {:behavior cmp.ConfirmBehavior.Replace :select true}) : (cmp.mapping (fn [fallback] (if (cmp.visible) (cmp.select_prev_item) (luasnip.expand_or_locally_jumpable) (luasnip.expand_or_jump) (fallback))) [:i :s]) : (cmp.mapping (fn [fallback] (if (cmp.visible) (cmp.select_prev_item) (luasnip.locally_jumpable -1) (luasnip.jump -1) (fallback))) [:i :s])}})