diff options
| author | Thomas Vanbesien <tvanbesi@proton.me> | 2026-05-04 08:44:50 +0200 |
|---|---|---|
| committer | Thomas Vanbesien <tvanbesi@proton.me> | 2026-05-06 16:43:16 +0200 |
| commit | 34510ebc63ff65d51f6979a86169bfc52de6180c (patch) | |
| tree | 36c8b73c99a3c566ccee888818c60204398991fd /plugin/50-ftdetect.lua | |
| download | nvim-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.lua | 18 |
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, +}) |
