mirror of
https://github.com/stevenproctor/dotfiles.git
synced 2026-01-28 10:09:55 -06:00
Compare commits
4 Commits
04bf501caa
...
2b623f6eee
| Author | SHA1 | Date | |
|---|---|---|---|
| 2b623f6eee | |||
| 07a92bb66c | |||
| d40878f48d | |||
| a23c581746 |
@@ -62,7 +62,7 @@
|
||||
:updatetime 300
|
||||
; per coc.vim for diagnostic messages
|
||||
:signcolumn "auto:1-3"
|
||||
:colorcolumn [80 100]
|
||||
:colorcolumn [81 100]
|
||||
:cmdheight 2
|
||||
; Better display for messages
|
||||
:undodir undo-dir
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
u dotfiles.util
|
||||
nvim aniseed.nvim
|
||||
lsp vim.lsp
|
||||
lspconfig lspconfig
|
||||
nu aniseed.nvim.util
|
||||
cmp_nvim_lsp cmp_nvim_lsp}})
|
||||
|
||||
@@ -17,14 +18,14 @@
|
||||
(nvim.fn.sign_define sign-level
|
||||
{:texthl sign-level :text sign :numhl sign-level})))
|
||||
|
||||
; (define-sign :Error "☢️")
|
||||
; (define-sign :Warn "⚠️")
|
||||
; (define-sign :SignHint "🔎")
|
||||
; (define-sign :Info "ℹ️")
|
||||
(define-sign :Error :X)
|
||||
(define-sign :Warn "!")
|
||||
(define-sign :SignHint "?")
|
||||
(define-sign :Info :i)
|
||||
(define-sign :Error "☢️")
|
||||
(define-sign :Warn "⚠️")
|
||||
(define-sign :SignHint "🔎")
|
||||
(define-sign :Info "ℹ️")
|
||||
; (define-sign :Error :X)
|
||||
; (define-sign :Warn "!")
|
||||
; (define-sign :SignHint "?")
|
||||
; (define-sign :Info :i)
|
||||
|
||||
(def core-nmappings
|
||||
{:gd "lua vim.lsp.buf.definition()"
|
||||
@@ -86,6 +87,8 @@
|
||||
:ua [:unwind-all []]
|
||||
:uw [:unwind-thread []]}})
|
||||
|
||||
(def server-specific-opts {})
|
||||
|
||||
(defn bind-client-mappings [client]
|
||||
(let [client-name (a.get client :name)
|
||||
mappings (a.get client-nmappings client-name)
|
||||
@@ -124,8 +127,16 @@
|
||||
; -- 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."))
|
||||
|
||||
(when-let [lspi (require :nvim-lsp-installer)]
|
||||
(def base-server-opts
|
||||
(let [capabilities (cmp_nvim_lsp.default_capabilities (lsp.protocol.make_client_capabilities))]
|
||||
{: on_attach : capabilities :flags {:debounce_text_changes 150}}))
|
||||
|
||||
(defn default-server-handler [server-name]
|
||||
(let [specific-opts (a.get server-specific-opts server-name {})
|
||||
server (a.get lspconfig server-name)
|
||||
server-opts (a.merge base-server-opts server-opts)]
|
||||
(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)
|
||||
@@ -134,26 +145,10 @@
|
||||
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)
|
||||
|
||||
(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})
|
||||
(u.nnoremap :<leader>li :LspInfo)))
|
||||
|
||||
(comment (let [lspi (require :nvim-lsp-installer)
|
||||
;lspconfig (require :lspconfig)
|
||||
servers (lspi.get_installed_servers)]
|
||||
(each [_ server (pairs servers)]
|
||||
(a.pr server))))
|
||||
|
||||
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
|
||||
{autoload {nvim aniseed.nvim
|
||||
util dotfiles.util
|
||||
telescope telescope}})
|
||||
{autoload {nvim aniseed.nvim util dotfiles.util telescope telescope}})
|
||||
|
||||
(telescope.setup
|
||||
{:defaults
|
||||
{:vimgrep_arguments ["ag" "--nocolor" "--noheading"
|
||||
"--number" "--column" "--nobreak"
|
||||
"--smart-case" "--hidden" "--follow" ; "--skip-vcs-ignores"
|
||||
(def vimgrep_arguments [:ag
|
||||
:--nocolor
|
||||
:--noheading
|
||||
:--number
|
||||
:--column
|
||||
:--nobreak
|
||||
:--smart-case
|
||||
:--hidden
|
||||
; "--skip-vcs-ignores"
|
||||
; "-g" "!.git/"
|
||||
]}
|
||||
:pickers
|
||||
{:buffers {:mappings {:n {:d :delete_buffer}}}}})
|
||||
:--follow])
|
||||
|
||||
(telescope.setup {:defaults {: vimgrep_arguments}
|
||||
:pickers {:buffers {:mappings {:n {:d :delete_buffer}}}}})
|
||||
|
||||
(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 :* "Telescope grep_string")
|
||||
(util.lnnoremap "*" "Telescope grep_string")
|
||||
(util.lnnoremap :fb "Telescope buffers")
|
||||
(util.lnnoremap :fH "Telescope help_tags")
|
||||
(util.lnnoremap :fm "Telescope keymaps")
|
||||
@@ -28,7 +30,6 @@
|
||||
(util.lnnoremap :fC "Telescope command_history")
|
||||
(util.lnnoremap :fq "Telescope quickfix")
|
||||
(util.lnnoremap :fl "Telescope loclist")
|
||||
(util.lnnoremap :fsa "Telescope lsp_code_actions")
|
||||
(util.lnnoremap :fsi "Telescope lsp_implementations")
|
||||
(util.lnnoremap :fsr "Telescope lsp_references")
|
||||
(util.lnnoremap :fsS "Telescope lsp_document_symbols")
|
||||
|
||||
@@ -65,6 +65,8 @@
|
||||
:radenling/vim-dispatch-neovim {}
|
||||
:rafamadriz/friendly-snippets {}
|
||||
:skywind3000/asyncrun.vim {}
|
||||
:tjdevries/sg.nvim {:run "cargo build --workspace"
|
||||
:dependencies [:nvim-lua/plenary.nvim]}
|
||||
:tpope/vim-classpath {}
|
||||
:tpope/vim-dadbod {}
|
||||
:tpope/vim-dispatch {}
|
||||
@@ -77,7 +79,9 @@
|
||||
:tpope/vim-unimpaired {}
|
||||
:tpope/vim-vinegar {}
|
||||
: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
|
||||
; :luochen1990/rainbow {}
|
||||
; :thecontinium/asyncomplete-conjure.vim {}
|
||||
|
||||
Reference in New Issue
Block a user