Remove null-ls
This commit is contained in:
parent
77b6768742
commit
7ae183d64b
@ -116,10 +116,16 @@
|
||||
`(let [save# (vim.fn.winsaveview)]
|
||||
,(unpack args))))
|
||||
|
||||
;; Returns the keys for table
|
||||
;; Careful, this finds them will a loop every time it is called!
|
||||
(lambda keys! [table]
|
||||
`(icollect [key# _# (pairs ,table)] key#))
|
||||
|
||||
{: bind!
|
||||
: hook!
|
||||
: use!
|
||||
: setup!
|
||||
: module-call!
|
||||
: module-fn!
|
||||
: save-excursion!}
|
||||
: save-excursion!
|
||||
: keys!}
|
||||
|
@ -2,7 +2,8 @@
|
||||
|
||||
(import-macros {: bind! : hook!
|
||||
: use! : setup!
|
||||
: module-call!} :macros)
|
||||
: module-call!
|
||||
: module-fn! } :macros)
|
||||
|
||||
(fn [use]
|
||||
;; Packer
|
||||
@ -46,14 +47,7 @@
|
||||
:config
|
||||
(setup! :lualine
|
||||
:options { :section_separators ""
|
||||
:component_separators "│" }
|
||||
; :sections { :lualine_x [
|
||||
; { 1 #(.. "recording @" (vim.fn.reg_recording))
|
||||
; :cond #(not= (# (vim.fn.reg_recording)) 0) }
|
||||
; :encoding
|
||||
; :fileformat
|
||||
; :filetype ]}
|
||||
))
|
||||
:component_separators "│" }))
|
||||
|
||||
;; bufferline.nvim
|
||||
(use! :akinsho/bufferline.nvim
|
||||
@ -197,23 +191,43 @@
|
||||
:config
|
||||
(module-call! :plugin.lsp :configure))
|
||||
|
||||
(use! :jose-elias-alvarez/null-ls.nvim
|
||||
:after :nvim-lspconfig
|
||||
:config
|
||||
(module-call! :plugin.lsp :setup-null-ls))
|
||||
|
||||
(use! :j-hui/fidget.nvim
|
||||
:after :nvim-lspconfig
|
||||
:config
|
||||
(setup! :fidget))
|
||||
|
||||
;; nvim-jdtls
|
||||
(use! :mfussenegger/nvim-jdtls
|
||||
:ft :java
|
||||
:after :nvim-lspconfig
|
||||
:config
|
||||
(module-call! :plugin.jdtls :configure))
|
||||
|
||||
;; formatter.nvim
|
||||
(use! :mhartington/formatter.nvim
|
||||
:cmd [ :Format :FormatWrite ]
|
||||
:setup
|
||||
(bind! :n :<leader>o "<cmd>Format<cr>")
|
||||
(bind! :v :<leader>o ":Format<cr>")
|
||||
:config
|
||||
(setup! :formatter
|
||||
:logging true
|
||||
:log_level _G.vim.log.levels.WARN
|
||||
:filetype {
|
||||
:c [ (module-fn! :formatter.filetypes.c :astyle) ]
|
||||
:cpp [ (module-fn! :formatter.filetypes.cpp :astyle) ]
|
||||
:cmake [
|
||||
(module-fn! :formatter.filetypes.cmake :cmakeformat) ]
|
||||
:java [ (fn [] {:exe :astyle
|
||||
:stdin true
|
||||
:args [ :--mode=java ]}) ]
|
||||
:sh [ (module-fn! :formatter.filetypes.sh :shfmt) ]
|
||||
:rust [ (module-fn! :formatter.filetypes.rust :rustfmt) ]
|
||||
:tex [ (module-fn! :formatter.filetypes.latex :latexindent) ]
|
||||
:python [ (module-fn! :formatter.filetypes.python :yapf) ]
|
||||
:json [ (module-fn! :formatter.filetypes.json :prettier) ]
|
||||
:html [ (module-fn! :formatter.filetypes.html :prettier) ]
|
||||
:css [ (module-fn! :formatter.filetypes.css :prettier) ]
|
||||
:javascript [ (module-fn! :formatter.filetypes.javascript :prettier) ]
|
||||
:markdown [
|
||||
(module-fn! :formatter.filetypes.markdown :prettier ) ]
|
||||
:fennel [ (fn [] {:exe :fnlfmt
|
||||
:stdin true
|
||||
:args [ "-" ]})]}))
|
||||
|
||||
;; Sync all packages on first launch
|
||||
(if _G.first_launch
|
||||
(module-call! :packer :sync)))
|
||||
|
@ -21,13 +21,8 @@
|
||||
(bind! :n :<leader>rn vim.lsp.buf.rename buf)
|
||||
(bind! :n :<leader>cn vim.lsp.buf.code_action buf)
|
||||
; (bind! :n :gr vim.lsp.buf.references buf)
|
||||
(bind! [ :n :v ] :<leader>o
|
||||
#(vim.lsp.buf.format { :filter
|
||||
;; use null-ls for formatting
|
||||
(fn [client] (or
|
||||
(= client.name :null-ls)
|
||||
(= client.name :rust_analyzer)))
|
||||
:async true }) buf)
|
||||
(when (= client.name :rust_analyzer)
|
||||
(bind! [ :n :v ] :<leader>o #(vim.lsp.buf.format {:async true})))
|
||||
|
||||
;; Use builtin formatexpr
|
||||
(vim.api.nvim_buf_set_option buf :formatexpr "")
|
||||
@ -111,38 +106,4 @@
|
||||
:diagnostics {
|
||||
:globals [ "vim" ] }}})))
|
||||
|
||||
(fn setup-null-ls []
|
||||
(let [builtins (. (require :null-ls) :builtins)]
|
||||
(setup! :null-ls
|
||||
:on_attach (fn [client buf]
|
||||
(bind! [ :n :v ]
|
||||
:<leader>o
|
||||
#(vim.lsp.buf.format
|
||||
{ :filter
|
||||
;; use null-ls for formatting
|
||||
(fn [client]
|
||||
(or
|
||||
(= client.name :null-ls)
|
||||
(= client.name :rust_analyzer)))
|
||||
:async true }) buf)
|
||||
(vim.api.nvim_buf_set_option buf :formatexpr ""))
|
||||
:sources [
|
||||
builtins.formatting.astyle
|
||||
builtins.formatting.prettier
|
||||
builtins.formatting.yapf
|
||||
builtins.formatting.fnlfmt
|
||||
builtins.formatting.shfmt
|
||||
builtins.formatting.cmake_format
|
||||
builtins.formatting.latexindent
|
||||
builtins.formatting.stylua
|
||||
builtins.code_actions.shellcheck
|
||||
(builtins.completion.spell.with { :filetypes [ :text
|
||||
:markdown
|
||||
:tex ]})
|
||||
builtins.diagnostics.cmake_lint
|
||||
;;builtins.diagnostics.codespell
|
||||
;;builtins.diagnostics.shellcheck
|
||||
(builtins.diagnostics.glslc.with
|
||||
{ :extra_args [ "--target-env=opengl" ]})])))
|
||||
|
||||
{: configure : on-attach : get-data-dir : setup-null-ls }
|
||||
{: configure : on-attach : get-data-dir }
|
||||
|
Reference in New Issue
Block a user