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

@@ -1,41 +1,38 @@
(module dotfiles.mapping
{autoload {nvim aniseed.nvim
nu aniseed.nvim.util
core aniseed.core
util dotfiles.util
}})
{autoload {nvim aniseed.nvim
nu aniseed.nvim.util
core aniseed.core
util dotfiles.util}})
(defn- noremap [mode from to]
"Sets a mapping with {:noremap true}."
(nvim.set_keymap mode from to {:noremap true}))
(defn- noremap [mode from to] "Sets a mapping with {:noremap true}."
(nvim.set_keymap mode from to {:noremap true}))
; (set nvim.g.mapleader "\\")
(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>")
;; Correct to first spelling suggestion.
(noremap :n :<leader>zz ":normal! 1z=<cr>")
;; 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>")
; Insert Date
(noremap :n :<F5> "\"=strftime(\"%F\")<CR>p")
(noremap :i :<F5> "<C-R>=strftime(\"%F\")<CR>")
; Make markdown link with empty url
;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 :n :<C-e> "3<C-e>")
(noremap :n :<C-y> "3<C-y>")
(noremap :n :<C-e> :3<C-e>)
(noremap :n :<C-y> :3<C-y>)
; Unimpaired configuration
; Bubble single lines
@@ -56,8 +53,9 @@
(noremap :n :gsh ":GitGutterStageHunk<CR>")
; 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
(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,45 +1,39 @@
(module dotfiles.plugin.cmp
{autoload {nvim aniseed.nvim}})
(module dotfiles.plugin.cmp {autoload {nvim aniseed.nvim luasnip luasnip}})
(module config.plugin.cmp {autoload {nvim aniseed.nvim cmp cmp}})
(module config.plugin.cmp
{autoload {nvim aniseed.nvim
cmp cmp}})
(def- cmp-src-menu-items {:buffer :buff :conjure :conj :nvim_lsp :lsp})
(def- cmp-src-menu-items
{:buffer "buff"
:conjure "conj"
:nvim_lsp "lsp"})
(def- cmp-srcs
[{:name :nvim_lsp}
{:name :nvim_lua}
{:name :vsnip}
{:name :conjure}
{:name :buffer}
{:name :orgmode}
{:name :emoji :max_item_count 8}])
(def- cmp-srcs [{:name :nvim_lsp}
{:name :nvim_lua}
{:name :luasnip}
{:name :vsnip}
{:name :conjure}
{:name :buffer}
{:name :orgmode}
{:name :emoji :max_item_count 8}])
;; Setup cmp with desired settings
(let [cmp (require :cmp)]
(cmp.setup {:formatting
{:format (fn [entry item]
(set item.menu (or (. cmp-src-menu-items entry.source.name) ""))
item)}
(cmp.setup {:formatting {:format (fn [entry item]
(set item.menu
(or (. cmp-src-menu-items
entry.source.name)
""))
item)}
:mapping {:<C-p> (cmp.mapping.select_prev_item)
:<C-n> (cmp.mapping.select_next_item)
:<C-b> (cmp.mapping.scroll_docs (- 4))
:<C-f> (cmp.mapping.scroll_docs 4)
:<C-Space> (cmp.mapping.complete)
:<C-e> (cmp.mapping.close)
:<CR> (cmp.mapping.confirm {:behavior cmp.ConfirmBehavior.Insert
:select true})}
:<C-y> (cmp.mapping.confirm {;; :behavior cmp.ConfirmBehavior.Insert
:select true})}
:snippet {:expand (fn [args]
(nvim.fn.vsnip#anonymous args.body))}
(if args
(luasnip.lsp_expand args.body)))}
:sources cmp-srcs}))
;;; 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>'
;;; smap <expr> <C-l> vsnip#available(1) ? '<Plug>(vsnip-expand-or-jump)' : '<C-l>'

View File

@@ -2,7 +2,9 @@
{autoload {a aniseed.core
u dotfiles.util
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}))
@@ -32,7 +34,7 @@
:K "lua vim.lsp.buf.hover()"
"[g" "lua vim.diagnostic.goto_prev()"
"]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>cl "lua vim.lsp.codelens.run()"
:<leader>ic "lua vim.lsp.buf.incoming_calls()"
@@ -115,39 +117,39 @@
; -- 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")
(bind-client-mappings client)
(nvim.ex.autocmd :BufWritePre :<buffer> :lua
"vim.lsp.buf.formatting_sync()")
(nvim.ex.autocmd :BufWritePre :<buffer> :lua :vim.lsp.buf.format)
; (nvim.ex.autocmd "BufEnter,CursorHold,InsertLeave" :<buffer> :lua "vim.lsp.codelens.refresh()")
; 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'})]]
(print "LSP Client Attached."))
(let [lspi (require :nvim-lsp-installer)]
(when lspi
(defn lsp-execute-command [cmd ...]
(let [buf-uri (vim.uri_from_bufnr 0)
cursor (vim.api.nvim_win_get_cursor 0)
r (- (a.first cursor) 1)
c (a.second cursor)
opts [buf-uri r c]
args (a.concat opts [...])]
(vim.lsp.buf.execute_command {:command cmd :arguments args})))
(defn setup-servers []
(lspi.on_server_ready (fn [server]
(let [opts {: on_attach
:flags {:debounce_text_changes 150}}]
(server:setup opts))))
;; (let [lspconfig (require :lspconfig)
;; servers (lspi.get_installed_servers)]
;; (each [_ server (pairs servers)]
;; (server.setup {:on_attach on_attach :flags {:debounce_text_changes 150} })))
)
(defn on-post-install [] (setup-servers) (nvim.ex.bufdo :e))
(setup-servers)
(set lspi.post_install_hook on-post-install)
(nu.fn-bridge :LspExecuteCommand :dotfiles.plugin.lspconfig
:lsp-execute-command {:return false})
(u.nnoremap :<leader>li :LspInfo)))
(when-let [lspi (require :nvim-lsp-installer)]
(let [capabilities (cmp_nvim_lsp.update_capabilities (lsp.protocol.make_client_capabilities))]
(defn lsp-execute-command [cmd ...]
(let [buf-uri (vim.uri_from_bufnr 0)
cursor (vim.api.nvim_win_get_cursor 0)
r (- (a.first cursor) 1)
c (a.second cursor)
opts [buf-uri r c]
args (a.concat opts [...])]
(vim.lsp.buf.execute_command {:command cmd :arguments args})))
(defn setup-servers []
(lspi.on_server_ready (fn [server]
(let [opts {: on_attach
: capabilities
:flags {:debounce_text_changes 150}}]
(server:setup opts))))
;; (let [lspconfig (require :lspconfig)
;; servers (lspi.get_installed_servers)]
;; (each [_ server (pairs servers)]
;; (server.setup {:on_attach on_attach :flags {:debounce_text_changes 150} })))
)
(defn on-post-install [] (setup-servers) (nvim.ex.bufdo :e))
(setup-servers)
(set lspi.post_install_hook on-post-install)
(nu.fn-bridge :LspExecuteCommand :dotfiles.plugin.lspconfig
:lsp-execute-command {:return false})
(u.nnoremap :<leader>li :LspInfo)))
(comment (let [lspi (require :nvim-lsp-installer)
;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,97 +1,92 @@
(module dotfiles.plugins
{autoload {nvim aniseed.nvim
a aniseed.core
;; util dotfiles.util
packer packer}
;; require {minpac minpac}
})
(module dotfiles.plugins {autoload {nvim aniseed.nvim
a aniseed.core
;; util dotfiles.util
packer packer}
;; require {minpac minpac}
})
(defn safe-require-plugin-config [name]
(let [(ok? val-or-err) (pcall require (.. :dotfiles.plugin. name))]
(when (not ok?)
(print (.. "dotfiles error: " val-or-err)))))
(let [(ok? val-or-err) (pcall require (.. :dotfiles.plugin. name))]
(when (not ok?)
(print (.. "dotfiles error: " val-or-err)))))
(defn- use [pkgs]
"Iterates through the arguments as pairs and calls packer's use function for
(defn- use [pkgs] "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
tables as well."
(packer.startup
(fn [use]
(each [name opts (pairs pkgs)]
(-?> (. opts :mod) (safe-require-plugin-config))
(use (a.assoc opts 1 name))
))))
(packer.startup (fn [use]
(each [name opts (pairs pkgs)]
(-?> (. opts :mod) (safe-require-plugin-config))
(use (a.assoc opts 1 name))))))
(def- packages
{
:Olical/aniseed {}
:Olical/conjure { :mod :conjure } ; Clojure
:Olical/fennel.vim {} ; Fennel
:airblade/vim-gitgutter {} ; Git
:airblade/vim-gitgutter {} ; Git
:akinsho/org-bullets.nvim {:mod :orgbullets}
:clojure-vim/vim-jack-in {} ; Conjure support - jack-in with nrepl dependencies
:dhruvasagar/vim-table-mode {} ; table creation and formatting
:folke/lsp-colors.nvim {}
:folke/which-key.nvim {:mod :whichkey}
:hashivim/vim-terraform {} ; Terraform
:hrsh7th/nvim-cmp {:requires [:hrsh7th/cmp-buffer
:hrsh7th/cmp-emoji
:hrsh7th/cmp-nvim-lsp
:hrsh7th/cmp-nvim-lua
:hrsh7th/cmp-path
:hrsh7th/cmp-vsnip
:hrsh7th/vim-vsnip-integ
:PaterJason/cmp-conjure]
:mod :cmp} ; autocomplete
:hrsh7th/vim-vsnip {}
:hrsh7th/vim-vsnip-integ {}
:Iron-E/nvim-soluarized {}
:jiangmiao/auto-pairs {} ; backets, parens, and quotes in pairs
:jose-elias-alvarez/null-ls.nvim {:mod :null-ls
:requires [:nvim-lua/plenary.nvim]}
:junegunn/vim-easy-align {:mod :easyalign}
:kovisoft/paredit {:mod :paredit}
:kristijanhusak/vim-dadbod-completion {}
:kristijanhusak/vim-dadbod-ui {}
:lukas-reineke/headlines.nvim {:mod :headlines}
; :michaelb/sniprun {:run "bash ./install.sh" :mod :sniprun}
:neovim/nvim-lspconfig {:mod :lspconfig} ; NeoVim lsp config
:norcalli/nvim-colorizer.lua {:mod :colorizer}
:nvim-orgmode/orgmode { :mod :orgmode }
:nvim-telescope/telescope.nvim {:requires [[:nvim-lua/popup.nvim] [:nvim-lua/plenary.nvim]] :mod :telescope}
:nvim-treesitter/nvim-treesitter {:run ":TSUpdate" :mod :treesitter}
:nvim-treesitter/playground {}
:p00f/nvim-ts-rainbow {}
:radenling/vim-dispatch-neovim {} ; Clojure
:skywind3000/asyncrun.vim {} ; :AsyncRun
:tpope/vim-classpath {}
:tpope/vim-dadbod {}
:tpope/vim-dispatch {} ; Conjure support - jack-in with nrepl dependencies
:tpope/vim-fugitive {:mod :fugitive} ; Git
:tpope/vim-git {} ; Git Commit Message
:tpope/vim-pathogen {}
:tpope/vim-rails {}
:tpope/vim-repeat {}
:tpope/vim-surround {}
:tpope/vim-unimpaired {}
:tpope/vim-vinegar {}
:wbthomason/packer.nvim {:mod :packer}
:williamboman/nvim-lsp-installer {} ; NeoVim lsp server installs
; :luochen1990/rainbow {}
; :thecontinium/asyncomplete-conjure.vim {}
}
; :tpope/vim-fireplace {} ; Clojure
; :tpope/vim-sexp-mappings-for-regular-people {}
)
(def- packages {:Olical/aniseed {}
:Olical/conjure {:mod :conjure}
:Olical/fennel.vim {}
:airblade/vim-gitgutter {}
:akinsho/org-bullets.nvim {:mod :orgbullets}
:clojure-vim/vim-jack-in {}
:dhruvasagar/vim-table-mode {}
:folke/lsp-colors.nvim {}
:folke/which-key.nvim {:mod :whichkey}
:hashivim/vim-terraform {}
:hrsh7th/nvim-cmp {:requires [:hrsh7th/cmp-buffer
:hrsh7th/cmp-emoji
:hrsh7th/cmp-nvim-lsp
:hrsh7th/cmp-nvim-lua
:hrsh7th/cmp-path
:hrsh7th/cmp-vsnip
:hrsh7th/vim-vsnip-integ
:L3MON4D3/LuaSnip
:PaterJason/cmp-conjure
:saadparwaiz1/cmp_luasnip]
:mod :cmp}
:hrsh7th/vim-vsnip {}
:hrsh7th/vim-vsnip-integ {}
:Iron-E/nvim-soluarized {}
:jiangmiao/auto-pairs {}
:jose-elias-alvarez/null-ls.nvim {:mod :null-ls
:requires [:nvim-lua/plenary.nvim]}
:junegunn/vim-easy-align {:mod :easyalign}
:kovisoft/paredit {:mod :paredit}
:kristijanhusak/vim-dadbod-completion {}
:kristijanhusak/vim-dadbod-ui {}
:L3MON4D3/LuaSnip {:mod :luasnip}
:lukas-reineke/headlines.nvim {:mod :headlines}
; :michaelb/sniprun {:run "bash ./install.sh" :mod :sniprun}
:neovim/nvim-lspconfig {:mod :lspconfig}
:norcalli/nvim-colorizer.lua {:mod :colorizer}
:nvim-orgmode/orgmode {:mod :orgmode}
:nvim-telescope/telescope.nvim {:requires [[:nvim-lua/popup.nvim]
[:nvim-lua/plenary.nvim]]
:mod :telescope}
:nvim-treesitter/nvim-treesitter {:run ":TSUpdate"
:mod :treesitter}
:nvim-treesitter/playground {}
:p00f/nvim-ts-rainbow {}
:radenling/vim-dispatch-neovim {}
:rafamadriz/friendly-snippets {}
:skywind3000/asyncrun.vim {}
:tpope/vim-classpath {}
:tpope/vim-dadbod {}
:tpope/vim-dispatch {}
:tpope/vim-fugitive {:mod :fugitive}
:tpope/vim-git {}
:tpope/vim-pathogen {}
:tpope/vim-rails {}
:tpope/vim-repeat {}
:tpope/vim-surround {}
:tpope/vim-unimpaired {}
:tpope/vim-vinegar {}
:wbthomason/packer.nvim {:mod :packer}
:williamboman/nvim-lsp-installer {}
; NeoVim lsp server installs
; :luochen1990/rainbow {}
; :thecontinium/asyncomplete-conjure.vim {}
} ; :tpope/vim-fireplace {} ; Clojure
; :tpope/vim-sexp-mappings-for-regular-people {}
)
(use packages)
;; call minpac#add('dense-analysis/ale') " Linting
;; call minpac#add('editorconfig/editorconfig-vim')
;; call minpac#add('elixir-lang/vim-elixir') " Elixir