Add vlime

This commit is contained in:
Alexander Rosenberg 2022-12-07 03:39:47 -08:00
parent 01fe92398a
commit c39aa3ddfd
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730
3 changed files with 100 additions and 71 deletions

View File

@ -14,13 +14,17 @@
;; Treesitter ;; Treesitter
(use! :nvim-treesitter/nvim-treesitter (use! :nvim-treesitter/nvim-treesitter
:requires :p00f/nvim-ts-rainbow
:config #(setup! "nvim-treesitter.configs" :config #(setup! "nvim-treesitter.configs"
:ensure_installed :all :ensure_installed :all
:sync_install false :sync_install false
:auto_install true :auto_install true
:highlight { :enable true :highlight { :enable true
:additional_vim_regex_highlighting false } :additional_vim_regex_highlighting false }
:indent { :enable true })) :indent { :enable true }
:rainbow { :enable true
:extended_mode true
:max_file_lines nil }))
;; nightfox.nvim (colorscheme) ;; nightfox.nvim (colorscheme)
(use! :EdenEast/nightfox.nvim (use! :EdenEast/nightfox.nvim
@ -140,6 +144,7 @@
{}) {})
(bind! :n :go find-other.find_other_current_buffer)))) (bind! :n :go find-other.find_other_current_buffer))))
;; illuminate (same symbol highlight)
(use! :RRethy/vim-illuminate (use! :RRethy/vim-illuminate
:config (fn [] :config (fn []
(module-call! :illuminate :configure) (module-call! :illuminate :configure)
@ -157,6 +162,17 @@
:IlluminatedWordText :IlluminatedWordText
{})))) {}))))
;; vlime (lisp environment)
(use! :vlime/vlime
:config (fn []
(set vim.g.vlime_cl_impl :my_sbcl)
(set vim.g.vlime_address [ "127.0.0.1" 52842 ])
(vim.cmd "function! VlimeBuildServerCommandFor_my_sbcl(vlime_loader, vlime_eval)
return [ \"/usr/bin/sbcl\",
\\ \"--load\", a:vlime_loader,
\\ \"--eval\", \"(vlime:main :port 52842)\" ]
endfunction")))
;; Snippy ;; Snippy
(use! :dcampos/nvim-snippy (use! :dcampos/nvim-snippy
:config #(let [map (require :snippy.mapping)] :config #(let [map (require :snippy.mapping)]
@ -169,6 +185,7 @@
:hrsh7th/cmp-path :hrsh7th/cmp-path
:hrsh7th/cmp-cmdline :hrsh7th/cmp-cmdline
:hrsh7th/cmp-nvim-lsp :hrsh7th/cmp-nvim-lsp
:HiPhish/nvim-cmp-vlime
{ 1 :ray-x/cmp-treesitter { 1 :ray-x/cmp-treesitter
:after :nvim-cmp } :after :nvim-cmp }
:dcampos/cmp-snippy ] :dcampos/cmp-snippy ]

View File

@ -4,77 +4,84 @@
{ :configure #(let [cmp (require :cmp) { :configure #(let [cmp (require :cmp)
compare (require :cmp.config.compare)] compare (require :cmp.config.compare)]
(cmp.setup (cmp.setup
{ :snippet { { :snippet {
:expand #(module-call! :snippy :expand_snippet $1.body) } :expand #(module-call! :snippy :expand_snippet $1.body) }
:mapping { :mapping {
:<C-b> (cmp.mapping (cmp.mapping.scroll_docs -4) :<C-b> (cmp.mapping (cmp.mapping.scroll_docs -4)
[ :i :c ]) [ :i :c ])
:<C-f> (cmp.mapping (cmp.mapping.scroll_docs 4) :<C-f> (cmp.mapping (cmp.mapping.scroll_docs 4)
[ :i :c ]) [ :i :c ])
:<C-space> (cmp.mapping (cmp.mapping.complete) :<C-space> (cmp.mapping (cmp.mapping.complete)
[ :i :c ]) [ :i :c ])
:<C-e> (cmp.mapping (cmp.mapping.abort) :<C-e> (cmp.mapping (cmp.mapping.abort)
[ :i :c ]) [ :i :c ])
:<CR> (cmp.mapping :<CR> (cmp.mapping
(cmp.mapping.confirm { :select false }) (cmp.mapping.confirm { :select false })
[ :i :c ])
:<C-j> (cmp.mapping
(cmp.mapping.select_next_item
{ :behavior cmp.SelectBehavior.Select })
[ :i :c ]) [ :i :c ])
:<C-k> (cmp.mapping :<C-j> (cmp.mapping
(cmp.mapping.select_prev_item (cmp.mapping.select_next_item
{ :behavior cmp.SelectBehavior.Select }) { :behavior cmp.SelectBehavior.Select })
[ :i :c ]) [ :i :c ])
:<C-n> (cmp.mapping :<C-k> (cmp.mapping
(cmp.mapping.select_next_item (cmp.mapping.select_prev_item
{ :behavior cmp.SelectBehavior.Select }) { :behavior cmp.SelectBehavior.Select })
[ :i :c ]) [ :i :c ])
:<C-p> (cmp.mapping :<C-n> (cmp.mapping
(cmp.mapping.select_prev_item (cmp.mapping.select_next_item
{ :behavior cmp.SelectBehavior.Select }) { :behavior cmp.SelectBehavior.Select })
[ :i :c ]) [ :i :c ])
:<down> (cmp.mapping :<C-p> (cmp.mapping
(cmp.mapping.select_next_item (cmp.mapping.select_prev_item
{ :behavior cmp.SelectBehavior.Select }) { :behavior cmp.SelectBehavior.Select })
[ :i :c ]) [ :i :c ])
:<up> (cmp.mapping :<down> (cmp.mapping
(cmp.mapping.select_prev_item (cmp.mapping.select_next_item
{ :behavior cmp.SelectBehavior.Select }) { :behavior cmp.SelectBehavior.Select })
[ :i :c ]) } [ :i :c ])
:formatting { :<up> (cmp.mapping
:format (fn [entry vim_item] (cmp.mapping.select_prev_item
(tset vim_item :menu { :behavior cmp.SelectBehavior.Select })
(. { :nvim_lsp "[LSP]" [ :i :c ]) }
:treesitter "[TS]" :formatting {
:snippy "[Snippy]" :format (fn [entry vim_item]
:buffer "[Buffer]" (tset vim_item :menu
:path "[Path]" } (. { :nvim_lsp "[LSP]"
entry.source.name)) :treesitter "[TS]"
vim_item) :snippy "[Snippy]"
} :buffer "[Buffer]"
:sources [{ :name "nvim_lsp" :priority 2 :group 1 } :path "[Path]"
{ :name "snippy" :priority 2 :group 2 } :vlime "[Vlime]" }
{ :name "treesitter" :priority 1 :group 3 } entry.source.name))
{ :name "buffer" :priority 0 :group 3 } vim_item)
{ :name "path" :priority 0 :group 4 }] }
:view { :sources [{ :name "snippy" :priority 2 :group 1 }
:entries { :name "custom" :selection_order "near_cursor" }} { :name "treesitter" :priority 1 :group 2 }
:sorting { { :name "buffer" :priority 0 :group 3 }
:priority_weight 2 { :name "path" :priority 0 :group 4 }]
:comparators [ :view {
compare.score :entries { :name "custom" :selection_order "near_cursor" }}
compare.locality :sorting {
compare.recently_used :priority_weight 2
compare.offset :comparators [
compare.order compare.score
; compare.scopes compare.locality
; compare.exact compare.recently_used
; compare.sort_text compare.offset
; compare.kind compare.order
; compare.length ; compare.scopes
]}}) ; compare.exact
; compare.sort_text
; compare.kind
; compare.length
]}})
(cmp.setup.filetype [ :lisp ]
{ :option { :fuzzy false }
:sources
[{ :name "vlime" :priority 2 :group 1 }
{ :name "snippy" :priority 2 :group 2 }
{ :name "buffer" :priority 0 :group 3 }
{ :name "path" :priority 0 :group 4 }]})
(cmp.setup.cmdline "/" (cmp.setup.cmdline "/"
{ :mapping (cmp.mapping.preset.cmdline) { :mapping (cmp.mapping.preset.cmdline)
:sources (cmp.config.sources :sources (cmp.config.sources

View File

@ -3,6 +3,11 @@
(import-macros {: bind!} :macros) (import-macros {: bind!} :macros)
(fn on-attach [_ buf] (fn on-attach [_ buf]
((. (. (require :cmp) :setup) :buffer) {
:sources [{ :name "nvim_lsp" :priority 1 :group 1 }
{ :name "snippy" :priority 1 :group 2 }
{ :name "buffer" :priority 0 :group 3 }
{ :name "path" :priority 0 :group 4 }]})
(bind! :n :gD vim.lsp.buf.declaration buf) (bind! :n :gD vim.lsp.buf.declaration buf)
(bind! :n :gd vim.lsp.buf.definition buf) (bind! :n :gd vim.lsp.buf.definition buf)
(bind! :n :K vim.lsp.buf.hover buf) (bind! :n :K vim.lsp.buf.hover buf)