Compare commits

...

41 Commits

Author SHA1 Message Date
1829789ed0 support solarized8 too 2022-10-19 18:15:18 -05:00
f8c419314b Source Aniseed config, not init.lua 2022-10-18 20:08:09 -05:00
b504520573 Misc package updates
plus lots of fnlfmt updates
2022-10-17 15:47:01 -05:00
44c4e29ebd add null-ls language server 2022-10-11 10:37:04 -05:00
b08bb34014 Turn of mouse that was added in neovim 0.8.0 2022-10-11 10:33:53 -05:00
7aee69c6cc Start some cleanup on contextual Paredit 2022-10-11 08:21:39 -05:00
00f9835648 Paredit in org/markdown/asciidoc lisp code blocks 2022-10-10 20:20:30 -05:00
ada07b55ef Git Config - pull.ff only 2022-10-10 08:08:17 -05:00
1d0c8f99c0 Add which-key.nvim plugin 2022-10-10 08:08:17 -05:00
40e12613f3 NeoVim limit emoji completion suggestion count 2022-10-09 21:16:28 -05:00
9aed0652fd Add cmp-path pluging 2022-10-09 21:12:46 -05:00
ceac258332 Current filetype under cursor 2022-10-09 19:57:38 -05:00
da12dab7f0 Update global gitconfig settings 2022-10-06 16:00:55 -05:00
b580f52a16 bump tmux history to 15000 2022-10-06 16:00:26 -05:00
aa59abdc63 update fugitive key mapping 2022-10-06 15:59:58 -05:00
3bb3989d39 Let git pull rebase be taken care of by gitconfig 2022-10-03 13:56:39 -05:00
2ea5230362 Global GitConfig with local if present 2022-10-03 13:51:11 -05:00
Proctor
022744ff0d Fix Fugitive key mapping for push 2022-10-03 12:58:57 -05:00
Proctor
76feada900 Fix module load ordering 2022-10-03 12:56:11 -05:00
Proctor
563b26b4c2 More orgmode related plugins 2022-10-03 11:48:19 -05:00
Proctor
a64a75a550 Some Treesitter config refactoring 2022-10-03 11:47:41 -05:00
Proctor
6b95c42f3d Start fugitive custom keys 2022-10-03 11:47:41 -05:00
Proctor
267192615f Fix colorizing 2022-10-03 11:24:13 -05:00
Proctor
139181de24 Add vim-table-mode plugin 2022-09-26 07:43:44 -05:00
Proctor
c304417d6c Update nvim-cmp sources 2022-09-26 07:43:44 -05:00
953cb4414b Ensure all nvim-treesitter parsers aret installed 2022-09-24 12:57:54 -05:00
005efec7f6 Comment out old solarized8 color scheme 2022-09-24 12:39:54 -05:00
f434ee8946 tmux terminal color settings 2022-09-22 19:16:25 -05:00
Proctor
d3d37c51c9 Small fnl formatting fix 2022-09-22 08:42:40 -05:00
Proctor
8c98d8cfd7 Add cmp-emoji for emoji autocomplete support again 2022-09-22 08:36:32 -05:00
Proctor
6e7f3533aa Add nvim-orgmode plugin 2022-09-22 08:36:06 -05:00
Proctor
86ce07739a Update tmux history limit 2022-09-22 08:35:02 -05:00
Proctor
2d1d92d8a9 Fix some mappings and grepprg args 2022-08-25 08:30:33 -05:00
Proctor
e09e7cf7a5 Add bindings for Clojure LSP refactorings 2022-08-15 10:24:18 -05:00
Proctor
aa91648164 Change keybiding for toggle-conceal 2022-08-15 10:23:47 -05:00
Proctor
e4ac85922e Don't source old Vimfiles 2022-08-09 17:55:26 -05:00
Proctor
629463b335 Format and fix colorcolumn 2022-07-19 19:33:33 -05:00
954340c183 Fix grepprg args for ag command 2022-07-16 13:58:30 -05:00
Proctor
86d29e0624 re-enable conceals for clojure and fennel 2022-07-15 14:47:42 -05:00
Proctor
1b5e02d9b8 add colorcolumn at line 80 2022-07-15 14:47:20 -05:00
Proctor
10c0d5b9e0 Fix listchars showing 2022-07-15 11:00:02 -05:00
21 changed files with 500 additions and 282 deletions

29
git/.gitconfig Normal file
View File

@@ -0,0 +1,29 @@
# This is Git's per-user configuration file.
[user]
email = steven.proctor@gmail.com
name = Proctor
[core]
editor = nvim
excludesFile = ~/.gitignore.global
[init]
defaultBranch = main
[alias] ; Command aliases for the git[1] command wrapper
last = cat-file commit HEAD
[branch]
autoSetupRebase = always
[merge]
ff = only
[push]
autoSetupRemote = true
[rerere]
enabled = true
[remote]
pushDefault = origin
;; This is last, take in any other local file overrides
[include]
path = ~/.gitconfig.local ; find ".gitconfig.local" in your `$HOME` directory
[pull]
ff = only

View File

@@ -21,6 +21,8 @@
:false :⊥ :false :⊥
;; and ;; and
;; or ;; or
;; if-not
;; when-not
;; (not ;; (not
;; None | ∅ ;; None | ∅
;; true, false | , ⊥ (top and bottom from logic) ;; true, false | , ⊥ (top and bottom from logic)
@@ -46,16 +48,18 @@
(set nvim.wo.conceallevel 2) (set nvim.wo.conceallevel 2)
(set nvim.wo.conceallevel 0))) (set nvim.wo.conceallevel 0)))
;(setup-conceals)
;(toggle-conceal)
;(if true true false) ;(if true true false)
(nu.fn-bridge :ToggleConceal :dotfiles.conceal :toggle-conceal {:return false}) (nu.fn-bridge :ToggleConceal :dotfiles.conceal :toggle-conceal {:return false})
(nu.fn-bridge :SetupConceals :dotfiles.conceal :setup-conceals {:return false}) (nu.fn-bridge :SetupConceals :dotfiles.conceal :setup-conceals {:return false})
(u.nnoremap :<leader>ct "call ToggleConceal()") (u.nnoremap :<leader>tc "call ToggleConceal()")
(def pretty-filetypes [:fennel (def pretty-filetypes [:fennel
:clojure]) :clojure])
; (each [_ ftype (pairs pretty-filetypes)] (each [_ ftype (pairs pretty-filetypes)]
; (nvim.ex.autocmd :FileType ftype :call "SetupConceals()")) (nvim.ex.autocmd :FileType ftype :call "SetupConceals()"))
;

View File

@@ -19,8 +19,7 @@
(if (not (a.empty? glob)) (if (not (a.empty? glob))
(nvim.ex.source filename)))) (nvim.ex.source filename))))
(a.map safe-source ["~/.vimrc" "~/.vimrc.local"]) ; (a.map safe-source ["~/.vimrc" "~/.vimrc.local"])
(def- backup-dir (.. (nvim.fn.glob "$HOME") "/.vim/backup")) (def- backup-dir (.. (nvim.fn.glob "$HOME") "/.vim/backup"))
(def- undo-dir (.. (nvim.fn.glob "$HOME") "/.vim/backup")) (def- undo-dir (.. (nvim.fn.glob "$HOME") "/.vim/backup"))
@@ -51,36 +50,38 @@
(def- val-based-opts (def- val-based-opts
{ {
; :t_Co 256 ; :t_Co 256
:laststatus 2 :laststatus 2
:encoding "utf-8" :encoding "utf-8"
:history 500 :history 500
:redrawtime 5000 :redrawtime 5000
:scrolloff 3 :scrolloff 3
:guifont "Hasklig" :guifont "Hasklig"
:background "dark" :background "dark"
:backupdir backup-dir :backupdir backup-dir
:directory backup-dir ;Don't clutter my dirs up with swp and tmp files :directory backup-dir ;Don't clutter my dirs up with swp and tmp files
:grepprg "ag" ; Use Silver Searcher instead of grep :grepprg "ag --vimgrep" ; Use Silver Searcher instead of grep
:tags "tags" :tags "tags"
:updatetime 300 ; per coc.vim for diagnostic messages :updatetime 300 ; per coc.vim for diagnostic messages
:signcolumn "auto:1-3" :signcolumn "auto:1-3"
:cmdheight 2 ; Better display for messages :colorcolumn [80 100]
:undodir undo-dir :cmdheight 2 ; Better display for messages
:undolevels 1000 :undodir undo-dir
:undoreload 10000 :undolevels 1000
:foldmethod "expr" :undoreload 10000
:foldexpr "nvim_treesitter#foldexpr()" :foldmethod "expr"
:foldlevelstart 100 :foldexpr "nvim_treesitter#foldexpr()"
:foldlevel 99 :foldlevelstart 100
:tabstop 2 :foldlevel 99
:shiftwidth 2 :tabstop 2
:softtabstop 2 :shiftwidth 2
:list true :softtabstop 2
:listchars "tab:➥\\ ,trail:·" :mouse ""
:backspace "indent,eol,start" ;allow backspacing over everything in insert mode :list true
:wildmode "list:longest,list:full" :listchars "tab:➥\\ ,trail:·,"
:wrap false :backspace "indent,eol,start" ;allow backspacing over everything in insert mode
:wildmode "list:longest,list:full"
:wrap false
}) })
(defn- set-opt (defn- set-opt
@@ -96,13 +97,15 @@
(a.map-indexed set-opt val-based-opts) (a.map-indexed set-opt val-based-opts)
(nvim.ex.syntax "on") (nvim.ex.syntax "on")
(nvim.ex.colorscheme :soluarized) ;; (nvim.ex.colorscheme :soluarized)
(nvim.ex.colorscheme :solarized8)
;; (nvim.ex.autocmd "vimenter" "*" "++nested" "colorscheme" "soluarized")
(nvim.ex.autocmd "vimenter" "*" "++nested" "colorscheme" "solarized8") (nvim.ex.autocmd "vimenter" "*" "++nested" "colorscheme" "solarized8")
;(nvim.ex.autocmd "vimenter" "*" "luafile" "treesitter.lua") ;(nvim.ex.autocmd "vimenter" "*" "luafile" "treesitter.lua")
; ;
; (nvim.fn.glob "~/.vimrc.local") ; (nvim.fn.glob "~/.vimrc.local")
(defn make-fennel-scratch (defn make-fennel-scratch

View File

@@ -5,11 +5,12 @@
{nvim aniseed.nvim}}) {nvim aniseed.nvim}})
(require :dotfiles.plugins)
(require :dotfiles.core) (require :dotfiles.core)
(require :dotfiles.plugins)
(require :dotfiles.mapping) (require :dotfiles.mapping)
(require :dotfiles.conceal) (require :dotfiles.conceal)
(require :dotfiles.zoom-toggle) (require :dotfiles.zoom-toggle)
;(nvim.ex.source "~/.vimrc") ;(nvim.ex.source "~/.vimrc")
(a.println "(re)loaded")

View File

@@ -1,39 +1,46 @@
(module dotfiles.mapping (module dotfiles.mapping
{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}})
(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>") (defn aniseed-reload []
(noremap :n "<leader>!" ":call AniseedCompile()<CR>") (each [k _ (ipairs package.loaded)]
(when (string.match k "^dotfiles%..+")
(tset package.loaded k nil)))
((. (require :aniseed.env) :init) {:module :dotfiles.init :compile true}))
(vim.keymap.set :n "<leader>`" aniseed-reload)
; (noremap :n "<leader>`" ":source ~/.config/nvim/init.lua<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
@@ -54,8 +61,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,42 +1,39 @@
(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" {:name :nvim_lua}
:conjure "conj" {:name :luasnip}
:nvim_lsp "lsp"}) {:name :vsnip}
{:name :conjure}
(def- cmp-srcs {:name :buffer}
[{:name :nvim_lsp} {:name :orgmode}
{:name :vsnip} {:name :emoji :max_item_count 8}])
{:name :conjure}
{:name :buffer}])
;; 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
item)} entry.source.name)
""))
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)
:<C-b> (cmp.mapping.scroll_docs (- 4)) :<C-b> (cmp.mapping.scroll_docs (- 4))
:<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

@@ -1,13 +1,13 @@
(module dotfiles.plugin.colorizer (module dotfiles.plugin.colorizer
{autoload {colorizer colorizer}}) {autoload {colorizer colorizer}})
(colorizer.setup {"*" {}} (colorizer.setup [:*]
{:RGB true ; #RGB hex codes, like #F00 {:RGB true ; #RGB hex codes, like #F00
:RRGGBB true ; #RRGGBB hex codes, like #00FF00 :RRGGBB true ; #RRGGBB hex codes, like #00FF00
:names true ; "Name" codes like Blue :names true ; "Name" codes like Blue
:RRGGBBAA true ; #RRGGBBAA hex codes :RRGGBBAA true ; #RRGGBBAA hex codes
:rgb_fn true ; CSS rgb() and rgba() functions :rgb_fn true ; CSS rgb() and rgba() functions
:hsl_fn true ; CSS hsl() and hsla() functions :hsl_fn true ; CSS hsl() and hsla() functions
:css true ; Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB :css true ; Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
:css_fn true ; Enable all CSS *functions*: rgb_fn, hsl_fn :css_fn true ; Enable all CSS *functions*: rgb_fn, hsl_fn
}) })

View File

@@ -25,6 +25,7 @@
:nvim_lsp true :nvim_lsp true
:nvim_lua true :nvim_lua true
:conjure true :conjure true
:orgmode true
:vsnip true :vsnip true
:vim_dadbod_completion true}}))) :vim_dadbod_completion true}})))

View File

@@ -6,6 +6,7 @@
; (set nvim.g.conjure#eval#result_register "*") ; (set nvim.g.conjure#eval#result_register "*")
; (set nvim.g.conjure#log#botright true) ; (set nvim.g.conjure#log#botright true)
(set nvim.g.conjure#mapping#doc_word "gk") (set nvim.g.conjure#mapping#doc_word "gk")
(set nvim.g.conjure#client#clojure#nrepl#mapping#session_clone :sC)
(set nvim.g.conjure#extract#tree_sitter#enabled true) (set nvim.g.conjure#extract#tree_sitter#enabled true)
(conjure-config.assoc-in [:filetypes] (a.concat (conjure-config.filetypes) [:markdown] )) (conjure-config.assoc-in [:filetypes] (a.concat (conjure-config.filetypes) [:markdown] ))

View File

@@ -0,0 +1,9 @@
(module dotfiles.plugin.fugitive
{autoload {nvim aniseed.nvim
nu aniseed.nvim.util
core aniseed.core
util dotfiles.util}})
(nvim.ex.autocmd :FileType :fugitive :nmap :<buffer> :<leader>gp ":Git pull<CR>")
;; Determine load time of fugitive
(nvim.ex.autocmd :FileType :fugitive :nmap :<buffer> :<leader>gP ":Git push<CR>" )

View File

@@ -0,0 +1,2 @@
(module dotfiles.plugin.headlines
{autoload {headlines headlines}})

View File

@@ -1,134 +1,158 @@
(module dotfiles.plugin.lspconfig (module dotfiles.plugin.lspconfig
{autoload {autoload {a aniseed.core
{a aniseed.core u dotfiles.util
u dotfiles.util nvim aniseed.nvim
nvim aniseed.nvim lsp vim.lsp
nu aniseed.nvim.util nu aniseed.nvim.util
} cmp_nvim_lsp cmp_nvim_lsp}})
})
(defn bufmap [mode from to] (defn bufmap [mode from to] (u.noremap mode from to {:local? true}))
(u.noremap mode from to {:local? true}))
(defn nbufmap [from to] (defn nbufmap [from to] (bufmap :n from to))
(bufmap :n from to))
(defn xbufmap [from to]
(bufmap :x from to))
(defn xbufmap [from to] (bufmap :x from to))
(defn define-sign [level sign] (defn define-sign [level sign]
(let [sign-level (.. "DiagnosticSign" level)] (let [sign-level (.. :DiagnosticSign level)]
(nvim.fn.sign_define sign-level (nvim.fn.sign_define sign-level
{:texthl sign-level {:texthl sign-level :text sign :numhl sign-level})))
:text sign
:numhl sign-level})))
; (define-sign :Error "☢️") ; (define-sign :Error "☢️")
; (define-sign :Warn "⚠️") ; (define-sign :Warn "⚠️")
; (define-sign :SignHint "🔎") ; (define-sign :SignHint "🔎")
; (define-sign :Info "") ; (define-sign :Info "")
(define-sign :Error "X") (define-sign :Error :X)
(define-sign :Warn "!") (define-sign :Warn "!")
(define-sign :SignHint "?") (define-sign :SignHint "?")
(define-sign :Info "i") (define-sign :Info :i)
(def core-nmappings (def core-nmappings
{ {:gd "lua vim.lsp.buf.definition()"
:gd "lua vim.lsp.buf.definition()" :gD "lua vim.lsp.buf.declaration()"
:gD "lua vim.lsp.buf.declaration()" :gi "lua vim.lsp.buf.implementation()"
:gi "lua vim.lsp.buf.implementation()" :gr "lua vim.lsp.buf.references()"
:gr "lua vim.lsp.buf.references()" :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()" ;; TODO: think of new mapping; conficts with org mode
:<leader>oc "lua vim.lsp.buf.outgoing_calls()" ;; :<leader>oc "lua vim.lsp.buf.outgoing_calls()"
:<leader>sld "lua vim.diagnostic.open_float(nil, {source = 'always'})" :<leader>sld "lua vim.diagnostic.open_float(nil, {source = 'always'})"
:<leader>rn "lua vim.lsp.buf.rename()" :<leader>rn "lua vim.lsp.buf.rename()"
:<leader>fa "lua vim.lsp.buf.formatting_sync()" :<leader>fa "lua vim.lsp.buf.format()"})
})
(def client-nmappings (def client-nmappings
{:clojure_lsp {:clojure_lsp {:<leader>cn "call LspExecuteCommand('clean-ns')"
{ :<leader>ref "call LspExecuteCommand('extract-function', input('Function name: '))"
:<leader>cn "call LspExecuteCommand('clean-ns')" :<leader>id "call LspExecuteCommand('inline-symbol')"
:<leader>ref "call LspExecuteCommand('extract-function', input('Function name: '))" :<leader>il "call LspExecuteCommand('introduce-let', input('Binding name: '))"
:<leader>id "call LspExecuteCommand('inline-symbol')" :<leader>m2l "call LspExecuteCommand('move-to-let', input('Binding name: '))"}})
:<leader>il "call LspExecuteCommand('introduce-let', input('Binding name: '))"
:<leader>m2l "call LspExecuteCommand('move-to-let', input('Binding name: '))"
}
})
(def client-command-lnmappings
{:clojure_lsp {:ai [:add-import-to-namespace
["input('Namespace name: ')"]]
:am [:add-missing-libspec []]
:as [:add-require-suggestion
["input('Namespace name: ')"
"input('Namespace as: ')"
"input('Namespace name: ')"]]
:cc [:cycle-coll []]
:cn [:clean-ns []]
:cp [:cycle-privacy []]
:ct [:create-test []]
:df [:drag-forward []]
:db [:drag-backward []]
:df [:drag-forward []]
:dk [:destructure-keys []]
:ed [:extract-to-def ["input('Definition name: ')"]]
:ef [:extract-function ["input('Function name: ')"]]
:el [:expand-let []]
:fe [:create-function []]
:il [:introduce-let ["input('Binding name: ')"]]
:is [:inline-symbol []]
:ma [:resolve-macro-as []]
:mf [:move-form ["input('File name: ')"]]
:ml [:move-to-let ["input('Binding name: ')"]]
:pf [:promote-fn ["input('Function name: ')"]]
:sc [:change-collection ["input('Collection type: ')"]]
:sm [:sort-map []]
:tf [:thread-first-all []]
:tF [:thread-first []]
:tl [:thread-last-all []]
:tL [:thread-last []]
:ua [:unwind-all []]
:uw [:unwind-thread []]}})
(defn bind-client-mappings [client] (defn bind-client-mappings [client]
(let [client-name (a.get client :name) (let [client-name (a.get client :name)
mappings (a.get client-nmappings client-name)] mappings (a.get client-nmappings client-name)
(when mappings command-lnmappings (a.get client-command-lnmappings client-name)]
(each [mapping cmd (pairs mappings)] (when mappings
(nbufmap mapping cmd))))) (each [mapping cmd (pairs mappings)]
(nbufmap mapping cmd)))
(when command-lnmappings
(each [lnmapping command-mapping (pairs command-lnmappings)]
(let [lsp-cmd (a.first command-mapping)
opts-str (accumulate [s "" i opt (ipairs (a.second command-mapping))]
(.. s ", " opt))
mapping (.. :<leader> lnmapping)
cmd (.. "call LspExecuteCommand('" lsp-cmd "'" opts-str ")")]
(nbufmap mapping cmd))))))
(defn on_attach [client bufnr] (defn on_attach [client bufnr]
(each [mapping cmd (pairs core-nmappings)] (each [mapping cmd (pairs core-nmappings)]
(nbufmap mapping cmd)) (nbufmap mapping cmd)) ; x mode mappings
(xbufmap :<leader>fa "lua vim.lsp.buf.format()")
; -- buf_set_keymap('n', 'gs', '<Cmd>lua vim.lsp.buf.document_symbol()<CR>', opts)
; -- buf_set_keymap('n', 'gS', '<Cmd>lua vim.lsp.buf.workspace_symbol()<CR>', opts)
; -- buf_set_keymap('n', 'gt', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
; -- buf_set_keymap('n', '<leader>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
; -- buf_set_keymap('n', '<leader>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
; -- buf_set_keymap('n', '<leader>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
; -- buf_set_keymap('n', '<leader>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
; -- buf_set_keymap('n', '<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")
(bind-client-mappings client)
(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."))
; x mode mappings (when-let [lspi (require :nvim-lsp-installer)]
(xbufmap :<leader>fa "lua vim.lsp.buf.formatting_sync()") (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)))
; -- buf_set_keymap('n', 'gs', '<Cmd>lua vim.lsp.buf.document_symbol()<CR>', opts) (comment (let [lspi (require :nvim-lsp-installer)
; -- buf_set_keymap('n', 'gS', '<Cmd>lua vim.lsp.buf.workspace_symbol()<CR>', opts) ;lspconfig (require :lspconfig)
; -- buf_set_keymap('n', 'gt', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts) servers (lspi.get_installed_servers)]
; -- buf_set_keymap('n', '<leader>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts) (each [_ server (pairs servers)]
; -- buf_set_keymap('n', '<leader>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts) (a.pr server))))
; -- buf_set_keymap('n', '<leader>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
; -- buf_set_keymap('n', '<leader>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
; -- buf_set_keymap('n', '<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")
(bind-client-mappings client)
(nvim.ex.autocmd :BufWritePre :<buffer> :lua "vim.lsp.buf.formatting_sync()")
; (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 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")))

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

@@ -0,0 +1,13 @@
(module dotfiles.plugin.null-ls
{autoload {nvim aniseed.nvim
a aniseed.core
nu aniseed.nvim.util
null-ls null-ls
lspconfig dotfiles.plugin.lspconfig}})
(def null-ls-server-options
{:sources [null-ls.builtins.formatting.stylua
null-ls.builtins.formatting.fnlfmt]
:on_attach lspconfig.on_attach})
(null-ls.setup null-ls-server-options)

View File

@@ -0,0 +1,3 @@
(module dotfiles.plugin.orgbullets
{autoload {org-bullets org-bullets}})

View File

@@ -0,0 +1,8 @@
(module dotfiles.plugin.orgmode
{autoload {orgmode orgmode}})
(orgmode.setup_ts_grammar)
(orgmode.setup
{:org_agenda_files ["~/Dropbox/org/*" "~/my-orgs/**/*"]
:org_default_notes_file "~/Dropbox/org/refile.org" })

View File

@@ -0,0 +1,76 @@
(module dotfiles.plugin.paredit
{autoload {nvim aniseed.nvim
a aniseed.core
nu aniseed.nvim.util
paredit paredit
ts-parsers nvim-treesitter.parsers
ts-utils nvim-treesitter.ts_utils
languagetree vim.treesitter.languagetree
}})
(defn list-member? [xs x]
(a.some #(= x $1) (a.vals xs)))
(defn bool->int [bool]
(if bool 1 0))
(defn language-at-cursor []
(let [parser (ts-parsers.get_parser)
current-node (ts-utils.get_node_at_cursor)
range (if current-node
[(current-node:range)])
lang (if range
(languagetree.language_for_range parser range))]
(if lang
(lang:lang))))
(defn parser-language []
(let [parser (ts-parsers.get_parser)]
(when parser
(parser:lang))))
(def- paredit-langs
[
:clojure
:fennel
:hy
:janet
:julia
:lfe
:lisp
:racket
:scheme
:shen
])
(def- paredit-host-langs
[
:org
:markdown
:asciidoc
])
(defn- host-lang-in? [langs]
(list-member? langs (parser-language)))
(defn paredit-lang? [lang]
(list-member? paredit-langs lang))
(defn TreeSitterLangParedit []
(when (host-lang-in? paredit-host-langs)
(when-let [cursor-lang (language-at-cursor)]
(->> cursor-lang
(paredit-lang?)
(bool->int)
(set nvim.g.paredit_mode))
(nvim.fn.PareditInitBuffer))))
; (nvim.del_augroup_by_name "BabeliteParedit")
; (nvim.get_autocmds {:group "BabeliteParedit"})
(let [group (nvim.create_augroup "BabeliteParedit" {:clear true})]
(nvim.create_autocmd ["CursorHold" "CursorMoved"]
{:group group
;:pattern ["*.org" "*.md"]
:callback TreeSitterLangParedit}))

View File

@@ -1,9 +1,15 @@
(module dotfiles.plugin.treesitter (module dotfiles.plugin.treesitter
{autoload {treesitter nvim-treesitter.configs}}) {autoload {treesitter nvim-treesitter
ts_utils nvim-treesitter.ts_utils
treesitter-configs nvim-treesitter.configs}})
(treesitter.setup (treesitter-configs.setup
{:highlight {:enable true {:highlight {:enable true
:additional_vim_regex_highlighting false} ;; :additional_vim_regex_highlighting false
:additional_vim_regex_highlighting [:org]
}
:ensure_installed :all ; [:org]
:rainbow {:enable true :rainbow {:enable true
:extended_mode true ; Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean :extended_mode true ; Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean
@@ -19,3 +25,5 @@
] ; table of hex strings ] ; table of hex strings
} }
}) })
; lua print(require('nvim-treesitter.parsers').get_parser():language_for_range({ require('nvim-treesitter.ts_utils').get_node_at_cursor():range() }):lang())

View File

@@ -0,0 +1,5 @@
(module dotfiles.plugin.whichkey
{autoload {which-key which-key}})
(which-key.setup {})

View File

@@ -1,87 +1,93 @@
(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 :akinsho/org-bullets.nvim {:mod :orgbullets}
:Olical/fennel.vim {} ; Fennel :clojure-vim/vim-jack-in {}
:airblade/vim-gitgutter {} ; Git :dhruvasagar/vim-table-mode {}
:airblade/vim-gitgutter {} ; Git :folke/lsp-colors.nvim {}
:clojure-vim/vim-jack-in {} ; Conjure support - jack-in with nrepl dependencies :folke/which-key.nvim {:mod :whichkey}
:folke/lsp-colors.nvim {} :hashivim/vim-terraform {}
:hashivim/vim-terraform {} ; Terraform :hrsh7th/nvim-cmp {:requires [:hrsh7th/cmp-buffer
:hrsh7th/nvim-cmp {:requires [:hrsh7th/cmp-buffer :hrsh7th/cmp-emoji
:hrsh7th/cmp-nvim-lsp :hrsh7th/cmp-nvim-lsp
:hrsh7th/cmp-vsnip :hrsh7th/cmp-nvim-lua
:hrsh7th/vim-vsnip-integ :hrsh7th/cmp-path
:PaterJason/cmp-conjure] :hrsh7th/cmp-vsnip
:mod :cmp} ; autocomplete :hrsh7th/vim-vsnip-integ
:hrsh7th/vim-vsnip {} :L3MON4D3/LuaSnip
:hrsh7th/vim-vsnip-integ {} :PaterJason/cmp-conjure
:Iron-E/nvim-soluarized {} :saadparwaiz1/cmp_luasnip]
:jiangmiao/auto-pairs {} ; backets, parens, and quotes in pairs :mod :cmp}
:junegunn/vim-easy-align {:mod :easyalign} :hrsh7th/vim-vsnip {}
:kovisoft/paredit {} :hrsh7th/vim-vsnip-integ {}
:kristijanhusak/vim-dadbod-completion {} :Iron-E/nvim-soluarized {}
:kristijanhusak/vim-dadbod-ui {} :jiangmiao/auto-pairs {}
:neovim/nvim-lspconfig {:mod :lspconfig} ; NeoVim lsp config :jose-elias-alvarez/null-ls.nvim {:mod :null-ls
:norcalli/nvim-colorizer.lua {:mode :colorizer} :requires [:nvim-lua/plenary.nvim]}
:nvim-telescope/telescope.nvim {:requires [[:nvim-lua/popup.nvim] [:nvim-lua/plenary.nvim]] :mod :telescope} :junegunn/vim-easy-align {:mod :easyalign}
:nvim-treesitter/nvim-treesitter {:run ":TSUpdate" :mod :treesitter} :kovisoft/paredit {:mod :paredit}
:p00f/nvim-ts-rainbow {} :kristijanhusak/vim-dadbod-completion {}
:radenling/vim-dispatch-neovim {} ; Clojure :kristijanhusak/vim-dadbod-ui {}
:skywind3000/asyncrun.vim {} ; :AsyncRun :L3MON4D3/LuaSnip {:mod :luasnip}
:tpope/vim-classpath {} :lifepillar/vim-solarized8 {}
:tpope/vim-dadbod {} :lukas-reineke/headlines.nvim {:mod :headlines}
:tpope/vim-dispatch {} ; Conjure support - jack-in with nrepl dependencies ; :michaelb/sniprun {:run "bash ./install.sh" :mod :sniprun}
:tpope/vim-fugitive {} ; Git :neovim/nvim-lspconfig {:mod :lspconfig}
:tpope/vim-git {} ; Git Commit Message :norcalli/nvim-colorizer.lua {:mod :colorizer}
:tpope/vim-pathogen {} :nvim-orgmode/orgmode {:mod :orgmode}
:tpope/vim-rails {} :nvim-telescope/telescope.nvim {:requires [[:nvim-lua/popup.nvim]
:tpope/vim-repeat {} [:nvim-lua/plenary.nvim]]
:tpope/vim-surround {} :mod :telescope}
:tpope/vim-unimpaired {} :nvim-treesitter/nvim-treesitter {:run ":TSUpdate"
:tpope/vim-vinegar {} :mod :treesitter}
:wbthomason/packer.nvim {:mod :packer} :nvim-treesitter/playground {}
:williamboman/nvim-lsp-installer {} ; NeoVim lsp server installs :p00f/nvim-ts-rainbow {}
:radenling/vim-dispatch-neovim {}
; :luochen1990/rainbow {} :rafamadriz/friendly-snippets {}
; :thecontinium/asyncomplete-conjure.vim {} :skywind3000/asyncrun.vim {}
} :tpope/vim-classpath {}
:tpope/vim-dadbod {}
; :tpope/vim-fireplace {} ; Clojure :tpope/vim-dispatch {}
; :tpope/vim-sexp-mappings-for-regular-people {} :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) (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

View File

@@ -33,8 +33,8 @@ setw -g mouse off
# set -g default-terminal "xterm-256:color" # set -g default-terminal "xterm-256:color"
# set -g default-terminal "${TERM}" # set -g default-terminal "${TERM}"
set -s default-terminal "tmux-256color" set -g default-terminal "tmux-256color"
set -g history-limit 6000 set -g history-limit 15000
set -g window-status-style dim set -g window-status-style dim
set -g window-status-current-style bright set -g window-status-current-style bright
@@ -46,8 +46,9 @@ set -g status-right '#(~/dotfiles/bin/tmux_battery_charge_indicator.sh) #[bg=whi
set -g update-environment "DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY" set -g update-environment "DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY"
set-environment -g 'SSH_AUTH_SOCK' ~/.ssh/ssh_auth_sock set-environment -g 'SSH_AUTH_SOCK' ~/.ssh/ssh_auth_sock
# set -as terminal-overrides ',xterm-257color:RGB' # set -as terminal-overrides ',xterm-256color:RGB'
set -as terminal-features ',xterm-256color:RGB' set -as terminal-features ',tmux-256color:RGB'
set-option -sa terminal-overrides ',tmux-256color:RGB'
# Undercurl # Undercurl
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support