Neovim mini split for plugins.

This commit is contained in:
Jason Hilder 2026-04-01 08:07:08 +02:00
parent 96c39f8927
commit aa5857eb87
2 changed files with 55 additions and 24 deletions

View File

@ -16,28 +16,21 @@ 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.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.lsp.enable({ "gopls", "gdscript" })
vim.cmd(":colorscheme retrobox")
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 = "master" },
})
require("fzf-lua").setup()
require('nvim-treesitter.configs').setup({highlight = { enable = true }})
vim.cmd(":colorscheme retrobox")
require("plugins")
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", "n"}, "<C-Space>", "<C-x><C-o>")
map("i", "<C-Space>", "<C-x><C-n>")
map("n", '<Esc>', '<Cmd>noh<CR><Esc>')
map("t", "<ESC><ESC>", "<C-\\><C-n>")
map("v", "J", ":m '>+1<CR>gv=gv")
@ -49,21 +42,10 @@ 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>fp", ":lua FzfLua.lsp_document_diagnostics()<CR>")
map("n", "<leader>fa", ":lua FzfLua.lsp_code_actions()<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>1", ":vsplit | vertical resize 95 | terminal<CR>a")
map("n", "<leader>2", ":split | horizontal resize 25 | terminal<CR>a")
map("n", "gd", ":lua vim.lsp.buf.definition()<CR>")
-- [[ GODOT ]]
local cwd = vim.fn.getcwd()
for _, path in ipairs({ cwd, cwd .. '/..' }) do
if vim.uv.fs_stat(path .. '/project.godot') and not vim.uv.fs_stat(path .. '/server.pipe') then
vim.fn.serverstart(path .. '/server.pipe')
break
end
end
map("n", "<leader>r", ":split | resize 25 | terminal godot --path . <CR>a")

View File

@ -0,0 +1,49 @@
vim.pack.add({
{ src = "https://github.com/ibhagwan/fzf-lua" },
{ src = "https://github.com/tribela/transparent.nvim" },
{ src = "https://github.com/nvim-treesitter/nvim-treesitter", version = "master" },
})
-- Required funny setup for cleaning up output in godot projects.
require("fzf-lua").setup({
files = {
cmd = (function()
if vim.fn.findfile("project.godot", vim.fn.getcwd() .. ";") ~= "" then
return "fdfind --type f -e gd -e gdshader -e gdshaderinc -e tres -e tscn -e cfg -e json -e toml -e txt -e md --exclude={.godot,.git}"
else
return "fdfind --exclude={.git,.cache,.xmake,.zig-cache,build,tmp,node_modules,elpa} --type f -H"
end
end)(),
},
})
require("nvim-treesitter.configs").setup({
ensure_installed = {
-- Godot
"gdscript",
"godot_resource",
-- Go
"go",
"gomod",
"gosum",
"gowork",
-- Web (common)
"html",
"css",
"javascript",
"typescript",
-- General
"lua",
"python",
"bash",
"json",
"toml",
"yaml",
"markdown",
"markdown_inline",
"vim",
"vimdoc",
},
highlight = { enable = true },
indent = { enable = true },
})