From 3b209dc0f967e469207beea7d6478ebe1e075c76 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sun, 18 Aug 2024 15:23:47 +0200 Subject: nvim: Prefer *.vim to *.lua --- .config/nvim/after/ftdetect/aerc.lua | 24 ------------------------ .config/nvim/after/ftdetect/aerc.vim | 18 ++++++++++++++++++ .config/nvim/after/ftdetect/c.lua | 6 ------ .config/nvim/after/ftdetect/c.vim | 1 + .config/nvim/after/ftdetect/llvm.lua | 6 ------ .config/nvim/after/ftdetect/llvm.vim | 1 + .config/nvim/after/ftdetect/nroff.lua | 6 ------ .config/nvim/after/ftdetect/nroff.vim | 1 + .config/nvim/after/ftdetect/oryx.lua | 6 ------ .config/nvim/after/ftdetect/oryx.vim | 1 + .config/nvim/after/ftdetect/xcompose.lua | 6 ------ .config/nvim/after/ftdetect/xcompose.vim | 1 + 12 files changed, 23 insertions(+), 54 deletions(-) delete mode 100644 .config/nvim/after/ftdetect/aerc.lua create mode 100644 .config/nvim/after/ftdetect/aerc.vim delete mode 100644 .config/nvim/after/ftdetect/c.lua create mode 100644 .config/nvim/after/ftdetect/c.vim delete mode 100644 .config/nvim/after/ftdetect/llvm.lua create mode 100644 .config/nvim/after/ftdetect/llvm.vim delete mode 100644 .config/nvim/after/ftdetect/nroff.lua create mode 100644 .config/nvim/after/ftdetect/nroff.vim delete mode 100644 .config/nvim/after/ftdetect/oryx.lua create mode 100644 .config/nvim/after/ftdetect/oryx.vim delete mode 100644 .config/nvim/after/ftdetect/xcompose.lua create mode 100644 .config/nvim/after/ftdetect/xcompose.vim (limited to '.config/nvim/after/ftdetect') diff --git a/.config/nvim/after/ftdetect/aerc.lua b/.config/nvim/after/ftdetect/aerc.lua deleted file mode 100644 index c430e33..0000000 --- a/.config/nvim/after/ftdetect/aerc.lua +++ /dev/null @@ -1,24 +0,0 @@ -local confhome = vim.fn.getenv('XDG_CONFIG_HOME') -confhome = confhome == vim.NIL and '~/.config/aerc/' or confhome .. '/aerc/' - -vim.api.nvim_create_autocmd({'BufRead', 'BufNewFile'}, { - pattern = { - confhome .. '*.conf', - confhome .. 'stylesets/*', - '/usr/share/aerc/*.conf', - '/usr/share/aerc/stylesets/*', - }, - callback = function() - vim.bo.filetype = 'ini' - end, -}) - -vim.api.nvim_create_autocmd({'BufRead', 'BufNewFile'}, { - pattern = { - confhome .. 'templates/*', - '/usr/share/aerc/templates/*', - }, - callback = function() - vim.bo.filetype = 'gotmpl' - end, -}) diff --git a/.config/nvim/after/ftdetect/aerc.vim b/.config/nvim/after/ftdetect/aerc.vim new file mode 100644 index 0000000..cdd4812 --- /dev/null +++ b/.config/nvim/after/ftdetect/aerc.vim @@ -0,0 +1,18 @@ +let s:cfg = getenv('XDG_CONFIG_HOME') +if s:cfg == v:null + let s:cfg = '~/.config/aerc/' +else + let s:cfg .= '/aerc/' +endif + +let s:ipaths + \ = s:cfg . '*.conf,' + \ . s:cfg . 'stylesets/*,' + \ . '/usr/share/aerc/*.conf,' + \ . '/usr/share/aerc/stylesets/*' +let s:gpaths + \ = s:cfg . 'templates/*,' + \ . '/usr/share/aerc/templates/*' + +execute 'autocmd BufRead,BufNewFile ' . s:ipaths . ' setfiletype ini' +execute 'autocmd BufRead,BufNewFile ' . s:gpaths . ' setfiletype gotmpl' diff --git a/.config/nvim/after/ftdetect/c.lua b/.config/nvim/after/ftdetect/c.lua deleted file mode 100644 index a518a11..0000000 --- a/.config/nvim/after/ftdetect/c.lua +++ /dev/null @@ -1,6 +0,0 @@ -vim.api.nvim_create_autocmd({'BufRead', 'BufNewFile'}, { - pattern = '*.[ch]', - callback = function() - vim.bo.filetype = 'c' - end, -}) diff --git a/.config/nvim/after/ftdetect/c.vim b/.config/nvim/after/ftdetect/c.vim new file mode 100644 index 0000000..4d22e22 --- /dev/null +++ b/.config/nvim/after/ftdetect/c.vim @@ -0,0 +1 @@ +autocmd BufRead,BufNewFile *.[ch] setfiletype c diff --git a/.config/nvim/after/ftdetect/llvm.lua b/.config/nvim/after/ftdetect/llvm.lua deleted file mode 100644 index 6313b3d..0000000 --- a/.config/nvim/after/ftdetect/llvm.lua +++ /dev/null @@ -1,6 +0,0 @@ -vim.api.nvim_create_autocmd({'BufRead', 'BufNewFile'}, { - pattern = '*.ll', - callback = function() - vim.bo.filetype = 'llvm' - end, -}) diff --git a/.config/nvim/after/ftdetect/llvm.vim b/.config/nvim/after/ftdetect/llvm.vim new file mode 100644 index 0000000..421fdd3 --- /dev/null +++ b/.config/nvim/after/ftdetect/llvm.vim @@ -0,0 +1 @@ +autocmd BufRead,BufNewFile *.ll setfiletype llvm diff --git a/.config/nvim/after/ftdetect/nroff.lua b/.config/nvim/after/ftdetect/nroff.lua deleted file mode 100644 index 592f620..0000000 --- a/.config/nvim/after/ftdetect/nroff.lua +++ /dev/null @@ -1,6 +0,0 @@ -vim.api.nvim_create_autocmd({'BufRead', 'BufNewFile'}, { - pattern = '*.[1-7]', - callback = function() - vim.bo.filetype = 'nroff' - end, -}) diff --git a/.config/nvim/after/ftdetect/nroff.vim b/.config/nvim/after/ftdetect/nroff.vim new file mode 100644 index 0000000..b56fb38 --- /dev/null +++ b/.config/nvim/after/ftdetect/nroff.vim @@ -0,0 +1 @@ +autocmd BufRead,BufNewFile *.[1-7] setfiletype nroff diff --git a/.config/nvim/after/ftdetect/oryx.lua b/.config/nvim/after/ftdetect/oryx.lua deleted file mode 100644 index c3647c5..0000000 --- a/.config/nvim/after/ftdetect/oryx.lua +++ /dev/null @@ -1,6 +0,0 @@ -vim.api.nvim_create_autocmd({'BufRead', 'BufNewFile'}, { - pattern = '*.yx', - callback = function() - vim.bo.filetype = 'oryx' - end, -}) diff --git a/.config/nvim/after/ftdetect/oryx.vim b/.config/nvim/after/ftdetect/oryx.vim new file mode 100644 index 0000000..520281d --- /dev/null +++ b/.config/nvim/after/ftdetect/oryx.vim @@ -0,0 +1 @@ +autocmd BufRead,BufNewFile *.yx setfiletype oryx diff --git a/.config/nvim/after/ftdetect/xcompose.lua b/.config/nvim/after/ftdetect/xcompose.lua deleted file mode 100644 index 81e6c4a..0000000 --- a/.config/nvim/after/ftdetect/xcompose.lua +++ /dev/null @@ -1,6 +0,0 @@ -vim.api.nvim_create_autocmd({'BufRead', 'BufNewFile'}, { - pattern = 'xcompose', - callback = function() - vim.bo.filetype = 'xcompose' - end -}) diff --git a/.config/nvim/after/ftdetect/xcompose.vim b/.config/nvim/after/ftdetect/xcompose.vim new file mode 100644 index 0000000..16a56b7 --- /dev/null +++ b/.config/nvim/after/ftdetect/xcompose.vim @@ -0,0 +1 @@ +autocmd BufRead,BufNewFile xcompose setfiletype xcompose -- cgit v1.2.3