This commit is contained in:
lucy 2026-03-01 18:53:20 +01:00
commit fd9cc9c38b
10 changed files with 369 additions and 0 deletions

35
lua/config/keymaps.lua Normal file
View file

@ -0,0 +1,35 @@
local map = vim.keymap.set
map("n", "<leader>ff", function()
Snacks.picker.files()
end)
map("n", "<leader>lg", function()
Snacks.picker.grep()
end)
map("n", "<C-f>", function()
require("conform").format({ async = true, lsp_fallback = true })
end)
-- lsp keybinds
map("n", "K", "<cmd> Lspsaga hover_doc<cr>")
map("n", "go", "<cmd> Lspsaga goto_definition<cr>")
map("n", "gr", "<cmd> Lspsaga finder<cr>")
map("n", "<leader>qf", "<cmd> Lspsaga code_action<cr>")
-- bufferline keybinds
map("n", "<A-1>", "<cmd> BufferLineGoToBuffer 1 <cr>")
map("n", "<A-2>", "<cmd> BufferLineGoToBuffer 2 <cr>")
map("n", "<A-3>", "<cmd> BufferLineGoToBuffer 3 <cr>")
map("n", "<A-4>", "<cmd> BufferLineGoToBuffer 4 <cr>")
map("n", "<A-5>", "<cmd> BufferLineGoToBuffer 5 <cr>")
map("n", "<A-6>", "<cmd> BufferLineGoToBuffer 6 <cr>")
map("n", "<A-7>", "<cmd> BufferLineGoToBuffer 7 <cr>")
map("n", "<A-8>", "<cmd> BufferLineGoToBuffer 8 <cr>")
map("n", "<A-9>", "<cmd> BufferLineGoToBuffer 9 <cr>")
map("n", "<A-0>", "<cmd> BufferLineGoToBuffer last <cr>")
map("n", "<leader>w", "<cmd> bdelete! <cr>")
-- util keybinds
map("n", "<leader>t", "<cmd> terminal <cr>")
map("n", "<A-t>", "<cmd>Lspsaga term_toggle<cr>")
map("t", "<esc>", "<c-\\><c-n>")
map("n", "<A-e>", "<cmd>NvimTreeToggle<cr>")

52
lua/config/lazy.lua Normal file
View file

@ -0,0 +1,52 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
-- Make sure to setup `mapleader` and `maplocalleader` before
-- loading lazy.nvim so that mappings are correct.
-- This is also a good place to setup other settings (vim.opt)
local opt = vim.opt
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
opt.number = true
opt.relativenumber = true
opt.cursorline = true
opt.termguicolors = true
opt.winborder = "single"
opt.signcolumn = "yes"
vim.lsp.inlay_hint.enable = true
opt.tabstop = 8
opt.shiftwidth = 8
vim.diagnostic.config({
virtual_text = {
spacing = 2,
source = true,
},
})
-- Setup lazy.nvim
require("lazy").setup({
spec = {
-- import your plugins
{ import = "plugins" },
},
-- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { "base16-catppuccin-mocha" } },
-- automatically check for plugin updates
checker = { enabled = true },
change_detection = { notify = false },
})

2
lua/config/options.lua Normal file
View file

@ -0,0 +1,2 @@
local opt = vim.opt