Misc package updates

plus lots of fnlfmt updates
This commit is contained in:
2022-10-17 15:47:01 -05:00
parent 44c4e29ebd
commit b504520573
5 changed files with 167 additions and 159 deletions

View File

@@ -2,40 +2,37 @@
{autoload {nvim aniseed.nvim {autoload {nvim aniseed.nvim
nu aniseed.nvim.util nu aniseed.nvim.util
core aniseed.core core aniseed.core
util dotfiles.util util dotfiles.util}})
}})
(defn- noremap [mode from to] (defn- noremap [mode from to] "Sets a mapping with {:noremap true}."
"Sets a mapping with {:noremap true}."
(nvim.set_keymap mode from to {:noremap true})) (nvim.set_keymap mode from to {:noremap true}))
; (set nvim.g.mapleader "\\") ; (set nvim.g.mapleader "\\")
(noremap :n "<leader>`" ":source ~/.config/nvim/init.lua<CR>") (noremap :n "<leader>`" ":source ~/.config/nvim/init.lua<CR>")
(noremap :n "<leader>!" ":call AniseedCompile()<CR>") (noremap :n :<leader>! ":call AniseedCompile()<CR>")
(noremap :n :<Enter> ":nohlsearch<Enter>/<BS>") (noremap :n :<Enter> ":nohlsearch<Enter>/<BS>")
;; Correct to first spelling suggestion. ;; Correct to first spelling suggestion.
(noremap :n :<leader>zz ":normal! 1z=<cr>") (noremap :n :<leader>zz ":normal! 1z=<cr>")
;; nice paste from clipboard in insert mode ;; nice paste from clipboard in insert mode
(noremap :i :<C-V><C-O> ":set paste<CR><C-R><C-R>+<C-O>:set nopaste<CR>") (noremap :i :<C-V><C-O> ":set paste<CR><C-R><C-R>+<C-O>:set nopaste<CR>")
; Insert Date ; Insert Date
(noremap :n :<F5> "\"=strftime(\"%F\")<CR>p") (noremap :n :<F5> "\"=strftime(\"%F\")<CR>p")
(noremap :i :<F5> "<C-R>=strftime(\"%F\")<CR>") (noremap :i :<F5> "<C-R>=strftime(\"%F\")<CR>")
; Make markdown link with empty url ; Make markdown link with empty url
;map <Leader>ah S<a href="" target="_blank" rel="noopener noreferrer"><CR> ;map <Leader>ah S<a href="" target="_blank" rel="noopener noreferrer"><CR>
(noremap :v :<leader>ah "S<a href=\"\" target=\"_blank\" rel=\"nopener noreferrer\"><CR>") (noremap :v :<leader>ah
"S<a href=\"\" target=\"_blank\" rel=\"nopener noreferrer\"><CR>")
(noremap :v :<leader>ml "xi[<c-r>\"]()<esc>") (noremap :v :<leader>ml "xi[<c-r>\"]()<esc>")
(noremap :n :<C-e> :3<C-e>)
(noremap :n :<C-e> "3<C-e>") (noremap :n :<C-y> :3<C-y>)
(noremap :n :<C-y> "3<C-y>")
; Unimpaired configuration ; Unimpaired configuration
; Bubble single lines ; Bubble single lines
@@ -56,8 +53,9 @@
(noremap :n :gsh ":GitGutterStageHunk<CR>") (noremap :n :gsh ":GitGutterStageHunk<CR>")
; Open file in Marked 2 (markdown viewer) ; Open file in Marked 2 (markdown viewer)
(noremap :n :<leader>mv ":AsyncRun -mode=bang open -a Marked\\ 2.app \'%:p\'<cr>") (noremap :n :<leader>mv ":AsyncRun -mode=bang open -a Marked\\ 2.app '%:p'<cr>")
; Run current statement in DadBod-UI ; Run current statement in DadBod-UI
(nvim.ex.autocmd :FileType :sql :nmap :<leader>s "vap<leader>S") (nvim.ex.autocmd :FileType :sql :nmap :<leader>s :vap<leader>S)
(noremap :n :Q ":.!bash <CR>")

View File

@@ -1,19 +1,12 @@
(module dotfiles.plugin.cmp (module dotfiles.plugin.cmp {autoload {nvim aniseed.nvim luasnip luasnip}})
{autoload {nvim aniseed.nvim}})
(module config.plugin.cmp {autoload {nvim aniseed.nvim cmp cmp}})
(module config.plugin.cmp (def- cmp-src-menu-items {:buffer :buff :conjure :conj :nvim_lsp :lsp})
{autoload {nvim aniseed.nvim
cmp cmp}})
(def- cmp-src-menu-items (def- cmp-srcs [{:name :nvim_lsp}
{:buffer "buff"
:conjure "conj"
:nvim_lsp "lsp"})
(def- cmp-srcs
[{:name :nvim_lsp}
{:name :nvim_lua} {:name :nvim_lua}
{:name :luasnip}
{:name :vsnip} {:name :vsnip}
{:name :conjure} {:name :conjure}
{:name :buffer} {:name :buffer}
@@ -22,9 +15,11 @@
;; Setup cmp with desired settings ;; Setup cmp with desired settings
(let [cmp (require :cmp)] (let [cmp (require :cmp)]
(cmp.setup {:formatting (cmp.setup {:formatting {:format (fn [entry item]
{:format (fn [entry item] (set item.menu
(set item.menu (or (. cmp-src-menu-items entry.source.name) "")) (or (. cmp-src-menu-items
entry.source.name)
""))
item)} item)}
:mapping {:<C-p> (cmp.mapping.select_prev_item) :mapping {:<C-p> (cmp.mapping.select_prev_item)
:<C-n> (cmp.mapping.select_next_item) :<C-n> (cmp.mapping.select_next_item)
@@ -32,14 +27,13 @@
:<C-f> (cmp.mapping.scroll_docs 4) :<C-f> (cmp.mapping.scroll_docs 4)
:<C-Space> (cmp.mapping.complete) :<C-Space> (cmp.mapping.complete)
:<C-e> (cmp.mapping.close) :<C-e> (cmp.mapping.close)
:<CR> (cmp.mapping.confirm {:behavior cmp.ConfirmBehavior.Insert :<C-y> (cmp.mapping.confirm {;; :behavior cmp.ConfirmBehavior.Insert
:select true})} :select true})}
:snippet {:expand (fn [args] :snippet {:expand (fn [args]
(nvim.fn.vsnip#anonymous args.body))} (if args
(luasnip.lsp_expand args.body)))}
:sources cmp-srcs})) :sources cmp-srcs}))
;;; imap <expr> <C-j> vsnip#available(1) ? '<Plug>(vsnip-expand)' : '<C-j>' ;;; imap <expr> <C-j> vsnip#available(1) ? '<Plug>(vsnip-expand)' : '<C-j>'
;;; imap <expr> <C-l> vsnip#available(1) ? '<Plug>(vsnip-expand-or-jump)' : '<C-l>' ;;; imap <expr> <C-l> vsnip#available(1) ? '<Plug>(vsnip-expand-or-jump)' : '<C-l>'
;;; smap <expr> <C-l> vsnip#available(1) ? '<Plug>(vsnip-expand-or-jump)' : '<C-l>' ;;; smap <expr> <C-l> vsnip#available(1) ? '<Plug>(vsnip-expand-or-jump)' : '<C-l>'

View File

@@ -2,7 +2,9 @@
{autoload {a aniseed.core {autoload {a aniseed.core
u dotfiles.util u dotfiles.util
nvim aniseed.nvim nvim aniseed.nvim
nu aniseed.nvim.util}}) lsp vim.lsp
nu aniseed.nvim.util
cmp_nvim_lsp cmp_nvim_lsp}})
(defn bufmap [mode from to] (u.noremap mode from to {:local? true})) (defn bufmap [mode from to] (u.noremap mode from to {:local? true}))
@@ -32,7 +34,7 @@
:K "lua vim.lsp.buf.hover()" :K "lua vim.lsp.buf.hover()"
"[g" "lua vim.diagnostic.goto_prev()" "[g" "lua vim.diagnostic.goto_prev()"
"]g" "lua vim.diagnostic.goto_next()" "]g" "lua vim.diagnostic.goto_next()"
:<c-k> "lua vim.lsp.buf.signature_help()" ;:<c-k> "lua vim.lsp.buf.signature_help()"
:<leader>ca "lua vim.lsp.buf.code_action()" :<leader>ca "lua vim.lsp.buf.code_action()"
:<leader>cl "lua vim.lsp.codelens.run()" :<leader>cl "lua vim.lsp.codelens.run()"
:<leader>ic "lua vim.lsp.buf.incoming_calls()" :<leader>ic "lua vim.lsp.buf.incoming_calls()"
@@ -115,15 +117,14 @@
; -- buf_set_keymap('x', '<leader>ic', "<cmd>lua vim.lsp.buf.incoming_calls()<CR>", opts) ; -- buf_set_keymap('x', '<leader>ic', "<cmd>lua vim.lsp.buf.incoming_calls()<CR>", opts)
(nvim.buf_set_option 0 :omnifunc "v:lua.vim.lsp.omnifunc") (nvim.buf_set_option 0 :omnifunc "v:lua.vim.lsp.omnifunc")
(bind-client-mappings client) (bind-client-mappings client)
(nvim.ex.autocmd :BufWritePre :<buffer> :lua (nvim.ex.autocmd :BufWritePre :<buffer> :lua :vim.lsp.buf.format)
"vim.lsp.buf.formatting_sync()")
; (nvim.ex.autocmd "BufEnter,CursorHold,InsertLeave" :<buffer> :lua "vim.lsp.codelens.refresh()") ; (nvim.ex.autocmd "BufEnter,CursorHold,InsertLeave" :<buffer> :lua "vim.lsp.codelens.refresh()")
; client autocmds ; client autocmds
; -- vim.api.nvim_command[[autocmd BufWritePre <buffer> lua vim.lsp.buf_request_sync(vim.api.nvim_get_current_buf(), 'workspace/executeCommand', {command = 'clean-ns', arguments = {vim.uri_from_bufnr(1), vim.api.nvim_win_get_cursor(0)[1], vim.api.nvim_win_get_cursor(0)[2]}, title = 'Clean Namespace'})]] ; -- vim.api.nvim_command[[autocmd BufWritePre <buffer> lua vim.lsp.buf_request_sync(vim.api.nvim_get_current_buf(), 'workspace/executeCommand', {command = 'clean-ns', arguments = {vim.uri_from_bufnr(1), vim.api.nvim_win_get_cursor(0)[1], vim.api.nvim_win_get_cursor(0)[2]}, title = 'Clean Namespace'})]]
(print "LSP Client Attached.")) (print "LSP Client Attached."))
(let [lspi (require :nvim-lsp-installer)] (when-let [lspi (require :nvim-lsp-installer)]
(when lspi (let [capabilities (cmp_nvim_lsp.update_capabilities (lsp.protocol.make_client_capabilities))]
(defn lsp-execute-command [cmd ...] (defn lsp-execute-command [cmd ...]
(let [buf-uri (vim.uri_from_bufnr 0) (let [buf-uri (vim.uri_from_bufnr 0)
cursor (vim.api.nvim_win_get_cursor 0) cursor (vim.api.nvim_win_get_cursor 0)
@@ -135,6 +136,7 @@
(defn setup-servers [] (defn setup-servers []
(lspi.on_server_ready (fn [server] (lspi.on_server_ready (fn [server]
(let [opts {: on_attach (let [opts {: on_attach
: capabilities
:flags {:debounce_text_changes 150}}] :flags {:debounce_text_changes 150}}]
(server:setup opts)))) (server:setup opts))))
;; (let [lspconfig (require :lspconfig) ;; (let [lspconfig (require :lspconfig)

View File

@@ -0,0 +1,19 @@
(module dotfiles.plugin.luasnip
{autoload {nvim aniseed.nvim util dotfiles.util luasnip luasnip}
require {select_choice luasnip.extras.select_choice}})
(vim.keymap.set [:i :s] :<C-k>
(fn []
(if (luasnip.expand_or_jumpable)
(luasnip.expand_or_jump))) {:silent true})
(vim.keymap.set [:i :s] :<C-j>
(fn []
(if (luasnip.jumpable -1)
(luasnip.jump -1))) {:silent true})
(vim.keymap.set :i :<C-l> (fn []
(if (luasnip.choice_active)
(luasnip.choice 1))))
(vim.keymap.set :i :<C-u> select_choice)

View File

@@ -1,42 +1,33 @@
(module dotfiles.plugins (module dotfiles.plugins {autoload {nvim aniseed.nvim
{autoload {nvim aniseed.nvim
a aniseed.core a aniseed.core
;; util dotfiles.util ;; util dotfiles.util
packer packer} packer packer}
;; require {minpac minpac} ;; require {minpac minpac}
}) })
(defn safe-require-plugin-config [name] (defn safe-require-plugin-config [name]
(let [(ok? val-or-err) (pcall require (.. :dotfiles.plugin. name))] (let [(ok? val-or-err) (pcall require (.. :dotfiles.plugin. name))]
(when (not ok?) (when (not ok?)
(print (.. "dotfiles error: " val-or-err))))) (print (.. "dotfiles error: " val-or-err)))))
(defn- use [pkgs] (defn- use [pkgs] "Iterates through the arguments as pairs and calls packer's use function for
"Iterates through the arguments as pairs and calls packer's use function for
each of them. Works around Fennel not liking mixed associative and sequential each of them. Works around Fennel not liking mixed associative and sequential
tables as well." tables as well."
(packer.startup (packer.startup (fn [use]
(fn [use]
(each [name opts (pairs pkgs)] (each [name opts (pairs pkgs)]
(-?> (. opts :mod) (safe-require-plugin-config)) (-?> (. opts :mod) (safe-require-plugin-config))
(use (a.assoc opts 1 name)) (use (a.assoc opts 1 name))))))
))))
(def- packages {:Olical/aniseed {}
(def- packages :Olical/conjure {:mod :conjure}
{ :Olical/fennel.vim {}
:Olical/aniseed {} :airblade/vim-gitgutter {}
:Olical/conjure { :mod :conjure } ; Clojure
:Olical/fennel.vim {} ; Fennel
:airblade/vim-gitgutter {} ; Git
:airblade/vim-gitgutter {} ; Git
:akinsho/org-bullets.nvim {:mod :orgbullets} :akinsho/org-bullets.nvim {:mod :orgbullets}
:clojure-vim/vim-jack-in {} ; Conjure support - jack-in with nrepl dependencies :clojure-vim/vim-jack-in {}
:dhruvasagar/vim-table-mode {} ; table creation and formatting :dhruvasagar/vim-table-mode {}
:folke/lsp-colors.nvim {} :folke/lsp-colors.nvim {}
:folke/which-key.nvim {:mod :whichkey} :folke/which-key.nvim {:mod :whichkey}
:hashivim/vim-terraform {} ; Terraform :hashivim/vim-terraform {}
:hrsh7th/nvim-cmp {:requires [:hrsh7th/cmp-buffer :hrsh7th/nvim-cmp {:requires [:hrsh7th/cmp-buffer
:hrsh7th/cmp-emoji :hrsh7th/cmp-emoji
:hrsh7th/cmp-nvim-lsp :hrsh7th/cmp-nvim-lsp
@@ -44,34 +35,41 @@
:hrsh7th/cmp-path :hrsh7th/cmp-path
:hrsh7th/cmp-vsnip :hrsh7th/cmp-vsnip
:hrsh7th/vim-vsnip-integ :hrsh7th/vim-vsnip-integ
:PaterJason/cmp-conjure] :L3MON4D3/LuaSnip
:mod :cmp} ; autocomplete :PaterJason/cmp-conjure
:saadparwaiz1/cmp_luasnip]
:mod :cmp}
:hrsh7th/vim-vsnip {} :hrsh7th/vim-vsnip {}
:hrsh7th/vim-vsnip-integ {} :hrsh7th/vim-vsnip-integ {}
:Iron-E/nvim-soluarized {} :Iron-E/nvim-soluarized {}
:jiangmiao/auto-pairs {} ; backets, parens, and quotes in pairs :jiangmiao/auto-pairs {}
:jose-elias-alvarez/null-ls.nvim {:mod :null-ls :jose-elias-alvarez/null-ls.nvim {:mod :null-ls
:requires [:nvim-lua/plenary.nvim]} :requires [:nvim-lua/plenary.nvim]}
:junegunn/vim-easy-align {:mod :easyalign} :junegunn/vim-easy-align {:mod :easyalign}
:kovisoft/paredit {:mod :paredit} :kovisoft/paredit {:mod :paredit}
:kristijanhusak/vim-dadbod-completion {} :kristijanhusak/vim-dadbod-completion {}
:kristijanhusak/vim-dadbod-ui {} :kristijanhusak/vim-dadbod-ui {}
:L3MON4D3/LuaSnip {:mod :luasnip}
:lukas-reineke/headlines.nvim {:mod :headlines} :lukas-reineke/headlines.nvim {:mod :headlines}
; :michaelb/sniprun {:run "bash ./install.sh" :mod :sniprun} ; :michaelb/sniprun {:run "bash ./install.sh" :mod :sniprun}
:neovim/nvim-lspconfig {:mod :lspconfig} ; NeoVim lsp config :neovim/nvim-lspconfig {:mod :lspconfig}
:norcalli/nvim-colorizer.lua {:mod :colorizer} :norcalli/nvim-colorizer.lua {:mod :colorizer}
:nvim-orgmode/orgmode {:mod :orgmode} :nvim-orgmode/orgmode {:mod :orgmode}
:nvim-telescope/telescope.nvim {:requires [[:nvim-lua/popup.nvim] [:nvim-lua/plenary.nvim]] :mod :telescope} :nvim-telescope/telescope.nvim {:requires [[:nvim-lua/popup.nvim]
:nvim-treesitter/nvim-treesitter {:run ":TSUpdate" :mod :treesitter} [:nvim-lua/plenary.nvim]]
:mod :telescope}
:nvim-treesitter/nvim-treesitter {:run ":TSUpdate"
:mod :treesitter}
:nvim-treesitter/playground {} :nvim-treesitter/playground {}
:p00f/nvim-ts-rainbow {} :p00f/nvim-ts-rainbow {}
:radenling/vim-dispatch-neovim {} ; Clojure :radenling/vim-dispatch-neovim {}
:skywind3000/asyncrun.vim {} ; :AsyncRun :rafamadriz/friendly-snippets {}
:skywind3000/asyncrun.vim {}
:tpope/vim-classpath {} :tpope/vim-classpath {}
:tpope/vim-dadbod {} :tpope/vim-dadbod {}
:tpope/vim-dispatch {} ; Conjure support - jack-in with nrepl dependencies :tpope/vim-dispatch {}
:tpope/vim-fugitive {:mod :fugitive} ; Git :tpope/vim-fugitive {:mod :fugitive}
:tpope/vim-git {} ; Git Commit Message :tpope/vim-git {}
:tpope/vim-pathogen {} :tpope/vim-pathogen {}
:tpope/vim-rails {} :tpope/vim-rails {}
:tpope/vim-repeat {} :tpope/vim-repeat {}
@@ -79,19 +77,16 @@
:tpope/vim-unimpaired {} :tpope/vim-unimpaired {}
:tpope/vim-vinegar {} :tpope/vim-vinegar {}
:wbthomason/packer.nvim {:mod :packer} :wbthomason/packer.nvim {:mod :packer}
:williamboman/nvim-lsp-installer {} ; NeoVim lsp server installs :williamboman/nvim-lsp-installer {}
; NeoVim lsp server installs
; :luochen1990/rainbow {} ; :luochen1990/rainbow {}
; :thecontinium/asyncomplete-conjure.vim {} ; :thecontinium/asyncomplete-conjure.vim {}
} } ; :tpope/vim-fireplace {} ; Clojure
; :tpope/vim-fireplace {} ; Clojure
; :tpope/vim-sexp-mappings-for-regular-people {} ; :tpope/vim-sexp-mappings-for-regular-people {}
) )
(use packages) (use packages)
;; call minpac#add('dense-analysis/ale') " Linting ;; call minpac#add('dense-analysis/ale') " Linting
;; call minpac#add('editorconfig/editorconfig-vim') ;; call minpac#add('editorconfig/editorconfig-vim')
;; call minpac#add('elixir-lang/vim-elixir') " Elixir ;; call minpac#add('elixir-lang/vim-elixir') " Elixir