From 1970054228b3a9a3a8fc99af723ee13c147e7747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 25 Feb 2024 22:49:55 +0100 Subject: Migrate from vim to nvim --- config/nvim/ftplugin/c.vim | 7 +++++++ config/nvim/ftplugin/cpp.vim | 8 ++++++++ config/nvim/ftplugin/json.vim | 1 + config/nvim/ftplugin/lua.vim | 2 ++ config/nvim/ftplugin/nix.vim | 5 +++++ config/nvim/ftplugin/python.vim | 2 ++ config/nvim/ftplugin/sh.vim | 2 ++ config/nvim/ftplugin/tex.vim | 1 + 8 files changed, 28 insertions(+) create mode 100644 config/nvim/ftplugin/c.vim create mode 100644 config/nvim/ftplugin/cpp.vim create mode 100644 config/nvim/ftplugin/json.vim create mode 100644 config/nvim/ftplugin/lua.vim create mode 100644 config/nvim/ftplugin/nix.vim create mode 100644 config/nvim/ftplugin/python.vim create mode 100644 config/nvim/ftplugin/sh.vim create mode 100644 config/nvim/ftplugin/tex.vim (limited to 'config/nvim/ftplugin') diff --git a/config/nvim/ftplugin/c.vim b/config/nvim/ftplugin/c.vim new file mode 100644 index 0000000..3769d80 --- /dev/null +++ b/config/nvim/ftplugin/c.vim @@ -0,0 +1,7 @@ +let b:ale_linters = ['cppcheck', 'flawfinder'] +let b:ale_fixers = ['clang-format', 'remove_trailing_lines', 'trim_whitespace'] +let g:ale_c_parse_compile_commands = 1 +let g:ale_c_clangd_options = '--header-insertion=never' + +nmap :ALENext +nmap :ALEPrevious diff --git a/config/nvim/ftplugin/cpp.vim b/config/nvim/ftplugin/cpp.vim new file mode 100644 index 0000000..89944ea --- /dev/null +++ b/config/nvim/ftplugin/cpp.vim @@ -0,0 +1,8 @@ +" This is for C but vim defines *.h as cpp type so here we have it +let b:ale_linters = ['ccls', 'cppcheck', 'flawfinder'] +let b:ale_fixers = ['clang-format', 'remove_trailing_lines', 'trim_whitespace'] +let g:ale_cpp_ccls_init_options = {'cache': {'directory': '/tmp/ccls/cache'}} +let g:ale_cpp_parse_compile_commands = 1 + +nmap :ALENext +nmap :ALEPrevious diff --git a/config/nvim/ftplugin/json.vim b/config/nvim/ftplugin/json.vim new file mode 100644 index 0000000..829a37e --- /dev/null +++ b/config/nvim/ftplugin/json.vim @@ -0,0 +1 @@ +let b:ale_fixers = ['jq'] diff --git a/config/nvim/ftplugin/lua.vim b/config/nvim/ftplugin/lua.vim new file mode 100644 index 0000000..733962a --- /dev/null +++ b/config/nvim/ftplugin/lua.vim @@ -0,0 +1,2 @@ +let b:ale_linters = ['luacheck', 'selene', 'luac'] +let b:ale_fixers = ['stylua', 'remove_trailing_lines', 'trim_whitespace'] diff --git a/config/nvim/ftplugin/nix.vim b/config/nvim/ftplugin/nix.vim new file mode 100644 index 0000000..48be358 --- /dev/null +++ b/config/nvim/ftplugin/nix.vim @@ -0,0 +1,5 @@ +let b:ale_linters = ['nix', 'statix'] +let b:ale_fixers = ['alejandra', 'remove_trailing_lines', 'trim_whitespace'] + +nmap :ALENext +nmap :ALEPrevious diff --git a/config/nvim/ftplugin/python.vim b/config/nvim/ftplugin/python.vim new file mode 100644 index 0000000..94b035a --- /dev/null +++ b/config/nvim/ftplugin/python.vim @@ -0,0 +1,2 @@ +let b:ale_linters = ['pylint', 'mypy', 'pydocstyle'] +let b:ale_fixers = ['isort', 'black', 'remove_trailing_lines', 'trim_whitespace'] diff --git a/config/nvim/ftplugin/sh.vim b/config/nvim/ftplugin/sh.vim new file mode 100644 index 0000000..8cc42e2 --- /dev/null +++ b/config/nvim/ftplugin/sh.vim @@ -0,0 +1,2 @@ +let b:ale_linters = ['shell', 'shellcheck'] +let b:ale_fixers = ['shfmt', 'trim_whitespace', 'remove_trailing_lines'] diff --git a/config/nvim/ftplugin/tex.vim b/config/nvim/ftplugin/tex.vim new file mode 100644 index 0000000..5eb1926 --- /dev/null +++ b/config/nvim/ftplugin/tex.vim @@ -0,0 +1 @@ +let b:ale_linters = ['lacheck'] -- cgit v1.2.3