diff --git a/README.md b/README.md index da2c4af..f7eb440 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ This repo contains my Neovim config only. You still need Neovim and a few system tools installed. +It is meant to work after a plain git clone plus the bootstrap script. + ## Fastest setup ```bash @@ -23,7 +25,7 @@ sh ~/.config/nvim/install.sh - `git` - `neovim` -- `nodejs` + `npm` (for Mason / `bashls`) +- `nodejs` + `npm` (for Mason / `bashls` / TypeScript / JSON / YAML LSPs) - `ripgrep` - `fd` @@ -70,4 +72,6 @@ sh ~/nvim-config/bootstrap.sh - First run downloads plugins through `lazy.nvim`. - The config lives in `~/.config/nvim`. -- `bashls` is included and should work once `nodejs`/`npm` are installed. +- Out of the box it covers C, C++, Rust, Bash, Lua, JSON, YAML, Markdown, JavaScript, TypeScript, and GLSL. +- Shader extensions like `.vert`, `.frag`, `.comp`, `.geom`, `.rgen`, `.rchit`, `.rmiss`, `.rint`, and `.rcall` are treated as GLSL. +- `nodejs`/`npm` are required so Mason can install the JS/TS/YAML/JSON tooling. diff --git a/init.lua b/init.lua index 865ca51..240c4ac 100644 --- a/init.lua +++ b/init.lua @@ -1,3 +1,4 @@ require("config.options") require("config.keymaps") +require("config.filetypes") require("config.lazy") diff --git a/lua/config/filetypes.lua b/lua/config/filetypes.lua new file mode 100644 index 0000000..2ceae93 --- /dev/null +++ b/lua/config/filetypes.lua @@ -0,0 +1,19 @@ +vim.filetype.add({ + filename = { + [".clang-format"] = "yaml", + [".clang-tidy"] = "yaml", + }, + extension = { + vert = "glsl", + frag = "glsl", + comp = "glsl", + geom = "glsl", + tesc = "glsl", + tese = "glsl", + rgen = "glsl", + rchit = "glsl", + rmiss = "glsl", + rint = "glsl", + rcall = "glsl", + }, +}) diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index a9ec1a5..8b7bd13 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -4,6 +4,11 @@ local ensure_installed = { "rust_analyzer", "bashls", "lua_ls", + "jsonls", + "yamlls", + "marksman", + "ts_ls", + "glsl_analyzer", } return { @@ -32,7 +37,18 @@ return { config = function() local capabilities = require("cmp_nvim_lsp").default_capabilities() vim.lsp.config("*", { capabilities = capabilities }) - vim.lsp.enable({ "pyright", "clangd", "rust_analyzer", "bashls", "lua_ls" }) + vim.lsp.enable({ + "pyright", + "clangd", + "rust_analyzer", + "bashls", + "lua_ls", + "jsonls", + "yamlls", + "marksman", + "ts_ls", + "glsl_analyzer", + }) vim.diagnostic.config({ virtual_text = true, signs = true, diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 7e07fa2..cc20a29 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -5,7 +5,22 @@ return { lazy = false, config = function() require("nvim-treesitter.config").setup({ - ensure_installed = { "c", "cpp", "python", "rust", "bash", "lua", "vim", "vimdoc" }, + ensure_installed = { + "c", + "cpp", + "rust", + "bash", + "lua", + "vim", + "vimdoc", + "json", + "yaml", + "markdown", + "markdown_inline", + "javascript", + "typescript", + "glsl", + }, auto_install = true, highlight = { enable = true }, indent = { enable = true },