feat: add broader language support
This commit is contained in:
parent
912846b235
commit
8fe6f6d02f
5 changed files with 59 additions and 4 deletions
|
|
@ -3,6 +3,8 @@
|
||||||
This repo contains my Neovim config only.
|
This repo contains my Neovim config only.
|
||||||
You still need Neovim and a few system tools installed.
|
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
|
## Fastest setup
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|
@ -23,7 +25,7 @@ sh ~/.config/nvim/install.sh
|
||||||
|
|
||||||
- `git`
|
- `git`
|
||||||
- `neovim`
|
- `neovim`
|
||||||
- `nodejs` + `npm` (for Mason / `bashls`)
|
- `nodejs` + `npm` (for Mason / `bashls` / TypeScript / JSON / YAML LSPs)
|
||||||
- `ripgrep`
|
- `ripgrep`
|
||||||
- `fd`
|
- `fd`
|
||||||
|
|
||||||
|
|
@ -70,4 +72,6 @@ sh ~/nvim-config/bootstrap.sh
|
||||||
|
|
||||||
- First run downloads plugins through `lazy.nvim`.
|
- First run downloads plugins through `lazy.nvim`.
|
||||||
- The config lives in `~/.config/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.
|
||||||
|
|
|
||||||
1
init.lua
1
init.lua
|
|
@ -1,3 +1,4 @@
|
||||||
require("config.options")
|
require("config.options")
|
||||||
require("config.keymaps")
|
require("config.keymaps")
|
||||||
|
require("config.filetypes")
|
||||||
require("config.lazy")
|
require("config.lazy")
|
||||||
|
|
|
||||||
19
lua/config/filetypes.lua
Normal file
19
lua/config/filetypes.lua
Normal file
|
|
@ -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",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
@ -4,6 +4,11 @@ local ensure_installed = {
|
||||||
"rust_analyzer",
|
"rust_analyzer",
|
||||||
"bashls",
|
"bashls",
|
||||||
"lua_ls",
|
"lua_ls",
|
||||||
|
"jsonls",
|
||||||
|
"yamlls",
|
||||||
|
"marksman",
|
||||||
|
"ts_ls",
|
||||||
|
"glsl_analyzer",
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
@ -32,7 +37,18 @@ return {
|
||||||
config = function()
|
config = function()
|
||||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
vim.lsp.config("*", { capabilities = 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({
|
vim.diagnostic.config({
|
||||||
virtual_text = true,
|
virtual_text = true,
|
||||||
signs = true,
|
signs = true,
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,22 @@ return {
|
||||||
lazy = false,
|
lazy = false,
|
||||||
config = function()
|
config = function()
|
||||||
require("nvim-treesitter.config").setup({
|
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,
|
auto_install = true,
|
||||||
highlight = { enable = true },
|
highlight = { enable = true },
|
||||||
indent = { enable = true },
|
indent = { enable = true },
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue