Updates for nvim v0.12

This commit is contained in:
2026-04-10 06:47:51 +02:00
parent c62617cf3c
commit 8f1e635b23
3 changed files with 33 additions and 71 deletions

View File

@@ -1,4 +1,5 @@
vim.g.mapleader = " "
vim.g.termguicolors = true
vim.o.path = "**"
vim.o.nu = true
vim.o.cursorline = true
@@ -16,30 +17,54 @@ vim.o.list = true
vim.o.splitright = true
vim.o.splitbelow = true
vim.o.winborder = 'rounded'
vim.o.undodir = os.getenv("HOME") .. "/.cache/nvim/undodir"
vim.g.gutentags_cache_dir = os.getenv("HOME") .. "/.cache/nvim/tags"
vim.opt.clipboard = "unnamedplus"
vim.o.completeopt = 'menuone,noselect'
vim.o.undodir = os.getenv("HOME") .. "/.cache/nvim/undodir"
vim.env.PATH = vim.env.PATH .. ":" .. os.getenv("HOME") .. "/.local/share/fnm/aliases/default/bin"
vim.api.nvim_create_autocmd("BufEnter", { pattern = "term://*", callback = function() vim.cmd("startinsert") end })
vim.cmd(":colorscheme retrobox")
pcall(require, "plugins")
vim.api.nvim_create_autocmd("BufEnter", { pattern = "term://*", callback = function() vim.cmd("startinsert") end })
vim.lsp.enable({ "gopls", "gdscript" })
vim.pack.add({
{ src = "https://github.com/ibhagwan/fzf-lua" },
{ src = "https://github.com/tribela/transparent.nvim" },
{ src = "https://github.com/neovim/nvim-lspconfig" },
{ src = "https://github.com/nvim-treesitter/nvim-treesitter", version = "main" },
{ src="https://github.com/folke/trouble.nvim" }
})
require("fzf-lua").setup()
require("trouble").setup()
vim.api.nvim_create_autocmd('FileType', {
pattern = '*',
callback = function()
pcall(vim.treesitter.start)
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
end,
})
local map = vim.keymap.set
map({"t", "n"}, "<C-h>", "<C-\\><C-n><C-w><C-h>")
map({"t", "n"}, "<C-j>", "<C-\\><C-n><C-w><C-j>")
map({"t", "n"}, "<C-k>", "<C-\\><C-n><C-w><C-k>")
map({"t", "n"}, "<C-l>", "<C-\\><C-n><C-w><C-l>")
map("i", "<C-Space>", "<C-x><C-n>")
map({"i", "n"}, "<C- >", "<C-x><C-o>")
map("n", '<Esc>', '<Cmd>noh<CR><Esc>')
map("t", "<ESC><ESC>", "<C-\\><C-n>")
map("v", "J", ":m '>+1<CR>gv=gv")
map("v", "K", ":m '<-2<CR>gv=gv")
map("v", "<S-Tab>", "<gv")
map("v", "<Tab>" , ">gv")
map("n", "gd", ":lua vim.lsp.buf.definition()<CR>")
map("n", "<leader>p", "<cmd>b#<CR>")
map("n", "<leader>e", ":Ex<CR>")
map("n", "<leader>c", ":bd<CR>")
map("n", "<leader>ff", ":lua FzfLua.files()<CR>")
map("n", "<leader>fo", ":lua FzfLua.buffers()<CR>")
map("n", "<leader>sp", ":lua FzfLua.grep_project()<CR>")
map("n", "<leader>sf", ":lua FzfLua.grep_curbuf()<CR>")
map("n", "<leader>sw", ":lua FzfLua.grep_cword()<CR>")
map("n", "<leader>sh", ":lua FzfLua.help_tags()<CR>")
map("n", "<leader>pa", ":lua FzfLua.lsp_code_actions()<CR>")
map('n', '<leader>pp', ":Trouble diagnostics toggle<CR>")
map("n", "<leader>1", ":vsplit | vertical resize 95 | terminal<CR>a")
map("n", "<leader>2", ":split | horizontal resize 25 | terminal<CR>a")
map("n", "<leader>r", ":split | resize 25 | terminal godot --path . <CR>a")