summaryrefslogtreecommitdiffstats
path: root/plugin/50-ftdetect.lua
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-05-04 08:44:50 +0200
committerThomas Vanbesien <tvanbesi@proton.me>2026-05-06 16:43:16 +0200
commit34510ebc63ff65d51f6979a86169bfc52de6180c (patch)
tree36c8b73c99a3c566ccee888818c60204398991fd /plugin/50-ftdetect.lua
downloadnvim-config-34510ebc63ff65d51f6979a86169bfc52de6180c.tar.gz
nvim-config-34510ebc63ff65d51f6979a86169bfc52de6180c.zip
feat: initial setup
- `dotfiles` (this project's CLI) - foot configuration - tmux configuration - bash configuration - nvim (as a git submodule) + configuration - ranger configuration - fzf configuration - KDE global shortcuts - Other miscellaneous dependencies
Diffstat (limited to 'plugin/50-ftdetect.lua')
-rw-r--r--plugin/50-ftdetect.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/plugin/50-ftdetect.lua b/plugin/50-ftdetect.lua
new file mode 100644
index 0000000..49fc6d6
--- /dev/null
+++ b/plugin/50-ftdetect.lua
@@ -0,0 +1,18 @@
+--
+-- Filetype detection plugin
+--
+
+-- Detect bash files
+vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
+ desc = "Detect bash file",
+ group = vim.g.dotfiles.augroup,
+ pattern = "*",
+ callback = function()
+ if
+ string.find(vim.api.nvim_buf_get_name(0), "%.bash$")
+ or string.find(vim.api.nvim_buf_get_lines(0, 0, 1, false)[1] or "", "^#!/usr/bin/bash")
+ then
+ vim.bo.filetype = "bash"
+ end
+ end,
+})