mirror of
https://github.com/stevenproctor/dotfiles.git
synced 2026-01-28 11:29:56 -06:00
Compare commits
4 Commits
04bf501caa
...
2b623f6eee
| Author | SHA1 | Date | |
|---|---|---|---|
| 2b623f6eee | |||
| 07a92bb66c | |||
| d40878f48d | |||
| a23c581746 |
@@ -62,7 +62,7 @@
|
|||||||
:updatetime 300
|
:updatetime 300
|
||||||
; per coc.vim for diagnostic messages
|
; per coc.vim for diagnostic messages
|
||||||
:signcolumn "auto:1-3"
|
:signcolumn "auto:1-3"
|
||||||
:colorcolumn [80 100]
|
:colorcolumn [81 100]
|
||||||
:cmdheight 2
|
:cmdheight 2
|
||||||
; Better display for messages
|
; Better display for messages
|
||||||
:undodir undo-dir
|
:undodir undo-dir
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
u dotfiles.util
|
u dotfiles.util
|
||||||
nvim aniseed.nvim
|
nvim aniseed.nvim
|
||||||
lsp vim.lsp
|
lsp vim.lsp
|
||||||
|
lspconfig lspconfig
|
||||||
nu aniseed.nvim.util
|
nu aniseed.nvim.util
|
||||||
cmp_nvim_lsp cmp_nvim_lsp}})
|
cmp_nvim_lsp cmp_nvim_lsp}})
|
||||||
|
|
||||||
@@ -17,14 +18,14 @@
|
|||||||
(nvim.fn.sign_define sign-level
|
(nvim.fn.sign_define sign-level
|
||||||
{:texthl sign-level :text sign :numhl sign-level})))
|
{:texthl 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()"
|
||||||
@@ -86,6 +87,8 @@
|
|||||||
:ua [:unwind-all []]
|
:ua [:unwind-all []]
|
||||||
:uw [:unwind-thread []]}})
|
:uw [:unwind-thread []]}})
|
||||||
|
|
||||||
|
(def server-specific-opts {})
|
||||||
|
|
||||||
(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)
|
||||||
@@ -124,36 +127,28 @@
|
|||||||
; -- 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."))
|
||||||
|
|
||||||
(when-let [lspi (require :nvim-lsp-installer)]
|
(def base-server-opts
|
||||||
(let [capabilities (cmp_nvim_lsp.default_capabilities (lsp.protocol.make_client_capabilities))]
|
(let [capabilities (cmp_nvim_lsp.default_capabilities (lsp.protocol.make_client_capabilities))]
|
||||||
(defn lsp-execute-command [cmd ...]
|
{: on_attach : capabilities :flags {:debounce_text_changes 150}}))
|
||||||
(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)
|
(defn default-server-handler [server-name]
|
||||||
;lspconfig (require :lspconfig)
|
(let [specific-opts (a.get server-specific-opts server-name {})
|
||||||
servers (lspi.get_installed_servers)]
|
server (a.get lspconfig server-name)
|
||||||
(each [_ server (pairs servers)]
|
server-opts (a.merge base-server-opts server-opts)]
|
||||||
(a.pr server))))
|
(server.setup server-opts)))
|
||||||
|
|
||||||
|
(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})))
|
||||||
|
|
||||||
|
(when-let [mason-lspconfig (require :mason-lspconfig)] (mason-lspconfig.setup)
|
||||||
|
(mason-lspconfig.setup_handlers {1 default-server-handler}))
|
||||||
|
|
||||||
|
(u.nnoremap :<leader>li :LspInfo)
|
||||||
|
(nu.fn-bridge :LspExecuteCommand :dotfiles.plugin.lspconfig
|
||||||
|
:lsp-execute-command {:return false})
|
||||||
|
|||||||
6
nvim/.config/nvim/fnl/dotfiles/plugin/mason.fnl
Normal file
6
nvim/.config/nvim/fnl/dotfiles/plugin/mason.fnl
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
(module dotfiles.plugin.mason
|
||||||
|
{autoload {nvim aniseed.nvim mason mason mason-lspconf mason-lspconfig}})
|
||||||
|
|
||||||
|
(mason.setup {:ui {:icons {:package_installed "✓"}}})
|
||||||
|
|
||||||
|
(mason-lspconf.setup {:ensure_installed [:sumneko_lua]})
|
||||||
@@ -1,23 +1,25 @@
|
|||||||
(module dotfiles.plugin.telescope
|
(module dotfiles.plugin.telescope
|
||||||
{autoload {nvim aniseed.nvim
|
{autoload {nvim aniseed.nvim util dotfiles.util telescope telescope}})
|
||||||
util dotfiles.util
|
|
||||||
telescope telescope}})
|
|
||||||
|
|
||||||
(telescope.setup
|
(def vimgrep_arguments [:ag
|
||||||
{:defaults
|
:--nocolor
|
||||||
{:vimgrep_arguments ["ag" "--nocolor" "--noheading"
|
:--noheading
|
||||||
"--number" "--column" "--nobreak"
|
:--number
|
||||||
"--smart-case" "--hidden" "--follow" ; "--skip-vcs-ignores"
|
:--column
|
||||||
|
:--nobreak
|
||||||
|
:--smart-case
|
||||||
|
:--hidden
|
||||||
|
; "--skip-vcs-ignores"
|
||||||
; "-g" "!.git/"
|
; "-g" "!.git/"
|
||||||
]}
|
:--follow])
|
||||||
:pickers
|
|
||||||
{:buffers {:mappings {:n {:d :delete_buffer}}}}})
|
|
||||||
|
|
||||||
|
(telescope.setup {:defaults {: vimgrep_arguments}
|
||||||
|
:pickers {:buffers {:mappings {:n {:d :delete_buffer}}}}})
|
||||||
|
|
||||||
(util.lnnoremap :ff "Telescope git_files hidden=true")
|
(util.lnnoremap :ff "Telescope git_files hidden=true")
|
||||||
(util.lnnoremap :f- "Telescope file_browser")
|
(util.lnnoremap :f- "Telescope find_files")
|
||||||
(util.lnnoremap :fg "Telescope live_grep")
|
(util.lnnoremap :fg "Telescope live_grep")
|
||||||
(util.lnnoremap :* "Telescope grep_string")
|
(util.lnnoremap "*" "Telescope grep_string")
|
||||||
(util.lnnoremap :fb "Telescope buffers")
|
(util.lnnoremap :fb "Telescope buffers")
|
||||||
(util.lnnoremap :fH "Telescope help_tags")
|
(util.lnnoremap :fH "Telescope help_tags")
|
||||||
(util.lnnoremap :fm "Telescope keymaps")
|
(util.lnnoremap :fm "Telescope keymaps")
|
||||||
@@ -28,7 +30,6 @@
|
|||||||
(util.lnnoremap :fC "Telescope command_history")
|
(util.lnnoremap :fC "Telescope command_history")
|
||||||
(util.lnnoremap :fq "Telescope quickfix")
|
(util.lnnoremap :fq "Telescope quickfix")
|
||||||
(util.lnnoremap :fl "Telescope loclist")
|
(util.lnnoremap :fl "Telescope loclist")
|
||||||
(util.lnnoremap :fsa "Telescope lsp_code_actions")
|
|
||||||
(util.lnnoremap :fsi "Telescope lsp_implementations")
|
(util.lnnoremap :fsi "Telescope lsp_implementations")
|
||||||
(util.lnnoremap :fsr "Telescope lsp_references")
|
(util.lnnoremap :fsr "Telescope lsp_references")
|
||||||
(util.lnnoremap :fsS "Telescope lsp_document_symbols")
|
(util.lnnoremap :fsS "Telescope lsp_document_symbols")
|
||||||
|
|||||||
@@ -65,6 +65,8 @@
|
|||||||
:radenling/vim-dispatch-neovim {}
|
:radenling/vim-dispatch-neovim {}
|
||||||
:rafamadriz/friendly-snippets {}
|
:rafamadriz/friendly-snippets {}
|
||||||
:skywind3000/asyncrun.vim {}
|
:skywind3000/asyncrun.vim {}
|
||||||
|
:tjdevries/sg.nvim {:run "cargo build --workspace"
|
||||||
|
:dependencies [:nvim-lua/plenary.nvim]}
|
||||||
:tpope/vim-classpath {}
|
:tpope/vim-classpath {}
|
||||||
:tpope/vim-dadbod {}
|
:tpope/vim-dadbod {}
|
||||||
:tpope/vim-dispatch {}
|
:tpope/vim-dispatch {}
|
||||||
@@ -77,7 +79,9 @@
|
|||||||
: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 {}
|
;; :williamboman/nvim-lsp-installbuilder {}
|
||||||
|
:williamboman/mason.nvim {:mod :mason
|
||||||
|
:requires [:williamboman/mason-lspconfig.nvim]}
|
||||||
; NeoVim lsp server installs
|
; NeoVim lsp server installs
|
||||||
; :luochen1990/rainbow {}
|
; :luochen1990/rainbow {}
|
||||||
; :thecontinium/asyncomplete-conjure.vim {}
|
; :thecontinium/asyncomplete-conjure.vim {}
|
||||||
|
|||||||
Reference in New Issue
Block a user