Working treesitter, gruvboxmaterial, flash.nvim

This commit is contained in:
2025-12-05 18:37:07 +01:00
parent 35b1e56a95
commit 53a821411f
9 changed files with 124 additions and 87 deletions

View File

@ -28,3 +28,10 @@ vim.opt.updatetime = 50
vim.cmd("highlight Normal ctermbg=NONE")
vim.cmd("highlight NonText ctermbg=NONE")
vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, {
pattern = "*.wgsl",
callback = function()
vim.bo.filetype = "wgsl"
end,
})

View File

@ -1,34 +1,45 @@
return {
{
"ellisonleao/gruvbox.nvim",
priority = 1000,
config = function()
-- Default options:
require("gruvbox").setup({
terminal_colors = true, -- add neovim terminal colors
undercurl = true,
underline = true,
bold = true,
italic = {
strings = true,
emphasis = true,
comments = true,
operators = false,
folds = true,
},
strikethrough = true,
invert_selection = false,
invert_signs = false,
invert_tabline = false,
invert_intend_guides = false,
inverse = true, -- invert background for search, diffs, statuslines and errors
contrast = "hard", -- can be "hard", "soft" or empty string
palette_overrides = {},
overrides = {},
dim_inactive = false,
transparent_mode = false,
})
vim.cmd("colorscheme gruvbox")
end,
},
"sainnhe/gruvbox-material",
lazy = false,
priority = 1000,
config = function()
vim.g.gruvbox_material_enable_italic = true
vim.g.gruvbox_material_background = "medium"
vim.g.gruvbox_material_better_performance = 1
vim.cmd.colorscheme("gruvbox-material")
end
}
-- return {
-- {
-- "ellisonleao/gruvbox.nvim",
-- priority = 1000,
-- config = function()
-- -- Default options:
-- require("gruvbox").setup({
-- terminal_colors = true, -- add neovim terminal colors
-- undercurl = true,
-- underline = true,
-- bold = true,
-- italic = {
-- strings = true,
-- emphasis = true,
-- comments = true,
-- operators = false,
-- folds = true,
-- },
-- strikethrough = true,
-- invert_selection = false,
-- invert_signs = false,
-- invert_tabline = false,
-- invert_intend_guides = false,
-- inverse = true, -- invert background for search, diffs, statuslines and errors
-- contrast = "hard", -- can be "hard", "soft" or empty string
-- palette_overrides = {},
-- overrides = {},
-- dim_inactive = false,
-- transparent_mode = false,
-- })
-- vim.cmd("colorscheme gruvbox")
-- end,
-- },
-- }

21
lua/plugins/flash.lua Normal file
View File

@ -0,0 +1,21 @@
return {
"folke/flash.nvim",
event = "VeryLazy",
---@type Flash.Config
opts = {
modes =
{
search =
{
enabled = true
}
}
},
keys = {
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
{ "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
},
}

View File

@ -94,6 +94,8 @@ return {
vim.keymap.set("n", "<leader>gD", vim.lsp.buf.declaration, opts)
vim.keymap.set("n", "<leader>gd", vim.lsp.buf.definition, opts)
vim.keymap.set("n", "<leader>gi", vim.lsp.buf.implementation, opts)
vim.keymap.set("n", "<leader>a", vim.lsp.buf.code_action, opts)
vim.keymap.set("v", "<leader>a", vim.lsp.buf.code_action, opts)
vim.keymap.set("n", "<leader>f", function()
vim.lsp.buf.format({ async = true })
end, opts)

View File

@ -1 +0,0 @@
return {}

View File

@ -1,3 +1,9 @@
return {
"nvim-treesitter/nvim-treesitter"
}
return {}
-- return {
-- {"nvim-treesitter/nvim-treesitter", lazy = false, branch = "master", build = ":TSUpdate",
-- config = function()
-- local parsers = require "nvim-treesitter.parsers"
-- local parser_config = parsers.get_parser_configs()
-- parser_config.wgsl_bevy.filetype_to_parsername = "wgsl"
-- end}
-- }

View File

@ -1,47 +0,0 @@
return {
"R-nvim/R.nvim",
-- Only required if you also set defaults.lazy = true
lazy = false,
-- R.nvim is still young and we may make some breaking changes from time
-- to time (but also bug fixes all the time). If configuration stability
-- is a high priority for you, pin to the latest minor version, but unpin
-- it and try the latest version before reporting an issue:
-- version = "~0.1.0"
config = function()
-- Create a table with the options to be passed to setup()
---@type RConfigUserOpts
local opts = {
hook = {
on_filetype = function()
vim.api.nvim_buf_set_keymap(0, "n", "<Enter>", "<Plug>RDSendLine", {})
vim.api.nvim_buf_set_keymap(0, "v", "<Enter>", "<Plug>RSendSelection", {})
end,
},
R_args = { "--quiet", "--no-save" },
min_editor_width = 72,
rconsole_width = 78,
objbr_mappings = { -- Object browser keymap
c = "class", -- Call R functions
["<localleader>gg"] = "head({object}, n = 15)", -- Use {object} notation to write arbitrary R code.
v = function()
-- Run lua functions
require("r.browser").toggle_view()
end,
},
disable_cmds = {
"RClearConsole",
"RCustomStart",
"RSPlot",
"RSaveClose",
},
}
-- Check if the environment variable "R_AUTO_START" exists.
-- If using fish shell, you could put in your config.fish:
-- alias r "R_AUTO_START=true nvim"
-- if vim.env.R_AUTO_START == "true" then
opts.auto_start = "on startup"
opts.objbr_auto_start = true
-- end
require("r").setup(opts)
end,
}

View File

@ -19,10 +19,6 @@ return {
},
on_attach = function(client, bufnr)
-- you can also put keymaps in here
vim.keymap.set("n", "<leader>ca", function()
vim.cmd.RustLsp("codeAction") -- supports rust-analyzer's grouping
-- or vim.lsp.buf.codeAction() if you don't want grouping.
end, { silent = true, buffer = bufnr })
vim.keymap.set(
"n",
"<leader>t", -- Override Neovim's built-in hover keymap with rustaceanvim's hover actions

View File

@ -0,0 +1,42 @@
return {
"nvim-treesitter/nvim-treesitter",
lazy = false,
build = ":TSUpdate",
event = { "BufReadPost", "BufNewFile" },
opts = {
ensure_installed = {
"bash",
"c",
"diff",
"html",
"javascript",
"json",
"lua",
"markdown",
"markdown_inline",
"python",
"query",
"regex",
"rust",
"toml",
"vim",
"vimdoc",
"yaml",
"wgsl",
},
sync_install = false,
auto_install = true,
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
indent = { enable = true },
},
config = function(_, opts)
require("nvim-treesitter.configs").setup(opts)
end,
}