(let [cmp (require :cmp) luasnip (require :luasnip)] {:options (fn [] (set vim.o.termguicolors true) (set vim.o.clipboard :unnamedplus) (set vim.o.wrap false) (set vim.opt.colorcolumn "80,120") (vim.cmd.colorscheme :everforest) ;; http://neovim.io/doc/user/change.html#fo-table (set vim.o.formatoptions :tncro) (set vim.o.conceallevel 2)) :keymap (fn [] (let [nmap #(vim.keymap.set [:n] $1 $2 {:desc $3})] (nmap : ":bnext" "Next Buffer") (nmap : ":bprevious" "Previous Buffer") (nmap : ":Telescope find_files" "Telescope find_files") (nmap :x ":write|bdelete" "Save and delete buffer") (nmap :dt #(vim.cmd (.. "split ~/gemwiki/diary/" (os.date "%Y%m%d") ".gmi" "| resize 8 | $") "Open today's diary")) (let [duck (require :duck)] (nmap :dd #(duck.hatch) "hatch a duck") (nmap :dk #(duck.cook) "cook a duck")) )) :treesitter-languages [:c :lua :vim :vimdoc :query :fennel] :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])}})