remove lint, just use efm

pull/2/head
Alpha Chen 2 years ago
parent 12667ea2b5
commit cb106c186f

3
.gitmodules vendored

@ -174,9 +174,6 @@
[submodule ".local/share/nvim/site/pack/kejadlen/start/tabular"] [submodule ".local/share/nvim/site/pack/kejadlen/start/tabular"]
path = .local/share/nvim/site/pack/kejadlen/start/tabular path = .local/share/nvim/site/pack/kejadlen/start/tabular
url = https://github.com/godlygeek/tabular.git url = https://github.com/godlygeek/tabular.git
[submodule ".local/share/nvim/site/pack/kejadlen/start/lint"]
path = .local/share/nvim/site/pack/kejadlen/start/lint
url = https://github.com/mfussenegger/nvim-lint.git
[submodule ".local/share/nvim/site/pack/kejadlen/start/treesitter"] [submodule ".local/share/nvim/site/pack/kejadlen/start/treesitter"]
path = .local/share/nvim/site/pack/kejadlen/start/treesitter path = .local/share/nvim/site/pack/kejadlen/start/treesitter
url = https://github.com/nvim-treesitter/nvim-treesitter.git url = https://github.com/nvim-treesitter/nvim-treesitter.git

@ -1 +0,0 @@
Subproject commit 5249977a585c3c17d94afdc8f0255a689d3a0057

@ -1,9 +1,11 @@
(set vim.g.omnifunc "ale#completion#OmniFunc") (set vim.g.omnifunc "ale#completion#OmniFunc")
(set vim.g.ale_fix_on_save 1) (set vim.g.ale_fix_on_save 1)
(set vim.g.ale_floating_preview 1) (set vim.g.ale_floating_preview 1)
(set vim.g.ale_floating_window_border [:│ :─ :╭ :╮ :╯ :╰ :│ :─]) (set vim.g.ale_floating_window_border
["│" "─" "╭" "╮" "╯" "╰" "│" "─"])
(vim.keymap.set :n :gd "<Plug>(ale_go_to_definition)" {:noremap true}) (vim.keymap.set :n :gd "<Plug>(ale_go_to_definition)" {:noremap true})
(vim.keymap.set :n :gr "<Plug>(ale_find_references)" {:noremap true}) (vim.keymap.set :n :gr "<Plug>(ale_find_references)" {:noremap true})
(vim.keymap.set :n :K "<Plug>(ale_hover)" {:noremap true}) (vim.keymap.set :n :K "<Plug>(ale_hover)" {:noremap true})
(vim.keymap.set :n :<C-k> "<Plug>(ale_previous_wrap)" {:silent true}) (vim.keymap.set :n :<C-k> "<Plug>(ale_previous_wrap)" {:silent true})
(vim.keymap.set :n :<C-j> "<Plug>(ale_next_wrap)" {:silent true}) (vim.keymap.set :n :<C-j> "<Plug>(ale_next_wrap)" {:silent true})

@ -87,16 +87,6 @@
(tset palette f :middle [[:NONE :NONE :NONE :NONE]])) (tset palette f :middle [[:NONE :NONE :NONE :NONE]]))
(tset vim.g palette-key palette)) (tset vim.g palette-key palette))
;;; lint
(let [lint (require :lint)
{: linters :linters_by_ft linters-by-ft :try_lint try-lint} lint
{:fennel fennel-linter} linters
{: nvim_create_autocmd} vim.api]
(tset linters-by-ft :fennel [:fennel])
(tset fennel-linter :globals [:vim :hs :spoon]) ; hack for neovim and hammerspoon
(nvim_create_autocmd :BufWritePost {:callback #(try-lint)}))
;;; lspconfig ;;; lspconfig
;; (vim.lsp.set_log_level :debug) ;; (vim.lsp.set_log_level :debug)
@ -133,18 +123,31 @@
(vim.keymap.set :n :gr vim.lsp.buf.references bufopts) (vim.keymap.set :n :gr vim.lsp.buf.references bufopts)
(vim.keymap.set :n :<leader>lf vim.lsp.buf.formatting bufopts))) (vim.keymap.set :n :<leader>lf vim.lsp.buf.formatting bufopts)))
(let [{: efm : rust_analyzer : tsserver} (require :lspconfig)] (let [{: efm : rust_analyzer : tsserver} (require :lspconfig)
fmt (fn [formatCommand formatStdin]
{: formatCommand : formatStdin})
lint (fn [lintCommand lintFormats lintStdin]
{: lintCommand : lintFormats : lintStdin})
prettier (fmt "prettier --stdin-filepath ${INPUT}" true)
;; https://github.com/alexaandru/nvim-config/blob/master/fnl/config/efm.fnl
fennelFmt (fmt "fnlfmt /dev/stdin" true)
fennelLint (lint "fennel --globals vim,hs,spoon --raw-errors $(realpath --relative-to . ${INPUT}) 2>&1"
["%f:%l: %m"] true)
fennel [fennelFmt fennelLint]]
((. efm :setup) {:on_attach on-attach ((. efm :setup) {:on_attach on-attach
:init_options {:documentFormatting true :init_options {:documentFormatting true
:hover true :hover true
:documentSymbol true :documentSymbol true
:codeAction true :codeAction true
:completion true} :completion true}
:settings {:languages {:javascript [{:formatCommand "prettier --stdin-filepath ${INPUT}" :settings {:languages {:javascript [prettier]
:formatStdin true}] :typescript [prettier]
:typescript [{:formatCommand "prettier --stdin-filepath ${INPUT}" :typescriptreact [prettier]
:formatStdin true}]}} : fennel}}
:filetypes [:javascript :typescript]}) :filetypes [:javascript
:typescript
:typescriptreact
:fennel]})
((. rust_analyzer :setup) {:on_attach on-attach ((. rust_analyzer :setup) {:on_attach on-attach
:settings {:rust-analyzer {:checkOnSave {:command :clippy}}}}) :settings {:rust-analyzer {:checkOnSave {:command :clippy}}}})
((. tsserver :setup) {:on_attach (fn [client bufnr] ((. tsserver :setup) {:on_attach (fn [client bufnr]
@ -183,3 +186,4 @@
;; Load all of the helptags now, after plugins have been loaded. ;; Load all of the helptags now, after plugins have been loaded.
;; All messages and errors will be ignored. ;; All messages and errors will be ignored.
(vim.api.nvim_command "silent! helptags ALL") (vim.api.nvim_command "silent! helptags ALL")

Loading…
Cancel
Save