-- -- 50-ftdetect.lua -- -- * Detects bash files and sets 'filetype'. -- -- 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, })