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
(use! :nvim-treesitter/nvim-treesitter
:requires :p00f/nvim-ts-rainbow
:config #(setup! "nvim-treesitter.configs"
:ensure_installed :all
:sync_install false
:auto_install true
:highlight { :enable true
:additional_vim_regex_highlighting false }
:indent { :enable true }))
:indent { :enable true }
:rainbow { :enable true
:extended_mode true
:max_file_lines nil }))
;; nightfox.nvim (colorscheme)
(use! :EdenEast/nightfox.nvim
@ -140,6 +144,7 @@
{})
(bind! :n :go find-other.find_other_current_buffer))))
;; illuminate (same symbol highlight)
(use! :RRethy/vim-illuminate
:config (fn []
(module-call! :illuminate :configure)
@ -157,6 +162,17 @@
: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
(use! :dcampos/nvim-snippy
:config #(let [map (require :snippy.mapping)]
@ -169,6 +185,7 @@
:hrsh7th/cmp-path
:hrsh7th/cmp-cmdline
:hrsh7th/cmp-nvim-lsp
:HiPhish/nvim-cmp-vlime
{ 1 :ray-x/cmp-treesitter
:after :nvim-cmp }
:dcampos/cmp-snippy ]

View File

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

View File

@ -3,6 +3,11 @@
(import-macros {: bind!} :macros)
(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.definition buf)
(bind! :n :K vim.lsp.buf.hover buf)