From cb106c186fd59b00d103d43662b80ec679eef3db Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Wed, 13 Jul 2022 19:42:30 -0700 Subject: [PATCH] remove lint, just use efm --- .gitmodules | 3 -- .../share/nvim/site/pack/kejadlen/start/lint | 1 - nvim/fnl/ale.fnl | 4 ++- nvim/fnl/init.fnl | 36 ++++++++++--------- 4 files changed, 23 insertions(+), 21 deletions(-) delete mode 160000 .local/share/nvim/site/pack/kejadlen/start/lint diff --git a/.gitmodules b/.gitmodules index 2868626..979a732 100644 --- a/.gitmodules +++ b/.gitmodules @@ -174,9 +174,6 @@ [submodule ".local/share/nvim/site/pack/kejadlen/start/tabular"] path = .local/share/nvim/site/pack/kejadlen/start/tabular 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"] path = .local/share/nvim/site/pack/kejadlen/start/treesitter url = https://github.com/nvim-treesitter/nvim-treesitter.git diff --git a/.local/share/nvim/site/pack/kejadlen/start/lint b/.local/share/nvim/site/pack/kejadlen/start/lint deleted file mode 160000 index 5249977..0000000 --- a/.local/share/nvim/site/pack/kejadlen/start/lint +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5249977a585c3c17d94afdc8f0255a689d3a0057 diff --git a/nvim/fnl/ale.fnl b/nvim/fnl/ale.fnl index 524f607..f9bc85a 100644 --- a/nvim/fnl/ale.fnl +++ b/nvim/fnl/ale.fnl @@ -1,9 +1,11 @@ (set vim.g.omnifunc "ale#completion#OmniFunc") (set vim.g.ale_fix_on_save 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 "(ale_go_to_definition)" {:noremap true}) (vim.keymap.set :n :gr "(ale_find_references)" {:noremap true}) (vim.keymap.set :n :K "(ale_hover)" {:noremap true}) (vim.keymap.set :n : "(ale_previous_wrap)" {:silent true}) (vim.keymap.set :n : "(ale_next_wrap)" {:silent true}) + diff --git a/nvim/fnl/init.fnl b/nvim/fnl/init.fnl index e54af73..b6ec004 100644 --- a/nvim/fnl/init.fnl +++ b/nvim/fnl/init.fnl @@ -87,16 +87,6 @@ (tset palette f :middle [[:NONE :NONE :NONE :NONE]])) (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 ;; (vim.lsp.set_log_level :debug) @@ -133,18 +123,31 @@ (vim.keymap.set :n :gr vim.lsp.buf.references bufopts) (vim.keymap.set :n :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 :init_options {:documentFormatting true :hover true :documentSymbol true :codeAction true :completion true} - :settings {:languages {:javascript [{:formatCommand "prettier --stdin-filepath ${INPUT}" - :formatStdin true}] - :typescript [{:formatCommand "prettier --stdin-filepath ${INPUT}" - :formatStdin true}]}} - :filetypes [:javascript :typescript]}) + :settings {:languages {:javascript [prettier] + :typescript [prettier] + :typescriptreact [prettier] + : fennel}} + :filetypes [:javascript + :typescript + :typescriptreact + :fennel]}) ((. rust_analyzer :setup) {:on_attach on-attach :settings {:rust-analyzer {:checkOnSave {:command :clippy}}}}) ((. tsserver :setup) {:on_attach (fn [client bufnr] @@ -183,3 +186,4 @@ ;; Load all of the helptags now, after plugins have been loaded. ;; All messages and errors will be ignored. (vim.api.nvim_command "silent! helptags ALL") +