aboutsummaryrefslogtreecommitdiff
path: root/config/nvim/ftplugin
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2024-02-25 22:49:55 +0100
committerKarel Kočí <cynerd@email.cz>2024-02-25 23:30:57 +0100
commit1970054228b3a9a3a8fc99af723ee13c147e7747 (patch)
tree2f151b709a06980ecb3c3b96930a6d518a1e15ed /config/nvim/ftplugin
parentfe804beeb41d149cc3e3c714061484e651ba48db (diff)
downloadmyconfigs-1970054228b3a9a3a8fc99af723ee13c147e7747.tar.gz
myconfigs-1970054228b3a9a3a8fc99af723ee13c147e7747.tar.bz2
myconfigs-1970054228b3a9a3a8fc99af723ee13c147e7747.zip
Migrate from vim to nvim
Diffstat (limited to 'config/nvim/ftplugin')
-rw-r--r--config/nvim/ftplugin/c.vim7
-rw-r--r--config/nvim/ftplugin/cpp.vim8
-rw-r--r--config/nvim/ftplugin/json.vim1
-rw-r--r--config/nvim/ftplugin/lua.vim2
-rw-r--r--config/nvim/ftplugin/nix.vim5
-rw-r--r--config/nvim/ftplugin/python.vim2
-rw-r--r--config/nvim/ftplugin/sh.vim2
-rw-r--r--config/nvim/ftplugin/tex.vim1
8 files changed, 28 insertions, 0 deletions
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 <F8> :ALENext<cr>
+nmap <F7> :ALEPrevious<cr>
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 <F8> :ALENext<cr>
+nmap <F7> :ALEPrevious<cr>
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 <F8> :ALENext<cr>
+nmap <F7> :ALEPrevious<cr>
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']