Real config files from my Neovim setup. Catppuccin Mocha, lazy.nvim, the usual suspects.
return {
"catppuccin/nvim",
name = "catppuccin",
priority = 1000,
config = function()
vim.cmd.colorscheme("catppuccin-mocha")
end,
}
-- LSP keymaps (attach to every LSP client)
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(args)
local opts = { buffer = args.buf }
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts)
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts)
vim.keymap.set("n", "<leader>f", function() vim.lsp.buf.format({ async = true }) end, opts)
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts)
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts)
vim.keymap.set("n", "<leader>e", vim.diagnostic.open_float, opts)
end,
})
-- Rust run/test menus (via rustaceanvim)
vim.keymap.set("n", "<F5>", "<cmd>RustLsp runnables<cr>", { desc = "Rust runnables" })
vim.keymap.set("n", "<F6>", "<cmd>RustLsp testables<cr>", { desc = "Rust testables" })
local capabilities = require("blink.cmp").get_lsp_capabilities()
-- Python: basedpyright (type checking, completions, go-to-def)
vim.lsp.config("basedpyright", {
cmd = { "basedpyright-langserver", "--stdio" },
root_markers = { "pyproject.toml", "setup.py", "setup.cfg", "requirements.txt", ".git" },
filetypes = { "python" },
capabilities = capabilities,
settings = {
basedpyright = {
disableOrganizeImports = true,
analysis = {
autoSearchPaths = true,
useLibraryCodeForTypes = true,
diagnosticMode = "openFilesOnly",
},
},
},
})
-- Python: ruff (linting + formatting)
vim.lsp.config("ruff", {
cmd = { "ruff", "server" },
root_markers = { "pyproject.toml", "ruff.toml", ".ruff.toml", ".git" },
filetypes = { "python" },
capabilities = capabilities,
})
vim.lsp.enable({ "basedpyright", "ruff" })
return {
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
event = "VeryLazy",
opts = function()
local noice_ok, noice = pcall(require, "noice")
return {
options = {
theme = "catppuccin",
section_separators = { left = "", right = "" },
component_separators = { left = "", right = "" },
},
sections = {
lualine_a = { "mode" },
lualine_b = { "branch", "diff", "diagnostics" },
lualine_c = { { "filename", path = 1 } },
lualine_x = {
noice_ok and {
function() return noice.api.status.command.get() end,
cond = function() return noice.api.status.command.has() end,
} or nil,
"filetype",
},
lualine_y = { "progress" },
lualine_z = { "location" },
},
}
end,
}
return {
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
"nvim-tree/nvim-web-devicons",
},
lazy = false,
keys = {
{ "<leader>t", "<cmd>Neotree focus<cr>", desc = "Focus file tree" },
{ "<leader>T", "<cmd>Neotree toggle<cr>", desc = "Toggle file tree" },
},
config = function(_, opts)
require("neo-tree").setup(opts)
vim.cmd("Neotree show")
end,
opts = {
filesystem = {
follow_current_file = { enabled = true },
filtered_items = { visible = true },
},
},
}
vim.g.mapleader = " "
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.signcolumn = "yes"
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.opt.termguicolors = true
vim.opt.updatetime = 250
vim.opt.undofile = true
vim.opt.clipboard = "unnamedplus"
vim.opt.exrc = true
return {
"nvim-telescope/telescope.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
keys = {
{ "<leader>p", "<cmd>Telescope find_files<cr>", desc = "Find files" },
{ "<leader>g", "<cmd>Telescope live_grep<cr>", desc = "Live grep" },
{ "<leader>b", "<cmd>Telescope buffers<cr>", desc = "Buffers" },
{ "<leader>s", "<cmd>Telescope lsp_document_symbols<cr>", desc = "Symbols" },
},
}