Initial neovim config
Lazy.nvim plugin manager, LSP (rust-analyzer, clangd, ts_ls, zls), treesitter, telescope, bufferline, neo-tree, gitsigns, lazygit, alabaster theme, persistence sessions, nvim-cmp, lualine, which-key. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
plugin/
|
||||||
|
.claude/
|
||||||
23
init.lua
Normal file
23
init.lua
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
-- Bootstrap lazy.nvim
|
||||||
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
|
vim.fn.system({
|
||||||
|
"git",
|
||||||
|
"clone",
|
||||||
|
"--filter=blob:none",
|
||||||
|
"https://github.com/folke/lazy.nvim.git",
|
||||||
|
"--branch=stable",
|
||||||
|
lazypath,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
-- Load core config before plugins
|
||||||
|
require("config.options")
|
||||||
|
require("config.keymaps")
|
||||||
|
require("config.autocmds")
|
||||||
|
|
||||||
|
-- Setup plugins
|
||||||
|
require("lazy").setup("plugins", {
|
||||||
|
change_detection = { notify = false },
|
||||||
|
})
|
||||||
31
lazy-lock.json
Normal file
31
lazy-lock.json
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||||
|
"LuaSnip": { "branch": "master", "commit": "dae4f5aaa3574bd0c2b9dd20fb9542a02c10471c" },
|
||||||
|
"alabaster.nvim": { "branch": "main", "commit": "ae0c5f41c70b576f0678319e57fe47b2b288d2fc" },
|
||||||
|
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
|
||||||
|
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
||||||
|
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
|
||||||
|
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
|
||||||
|
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||||
|
"crates.nvim": { "branch": "main", "commit": "ac9fa498a9edb96dc3056724ff69d5f40b898453" },
|
||||||
|
"gitsigns.nvim": { "branch": "main", "commit": "9f3c6dd7868bcc116e9c1c1929ce063b978fa519" },
|
||||||
|
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
|
||||||
|
"lazygit.nvim": { "branch": "main", "commit": "a04ad0dbc725134edbee3a5eea29290976695357" },
|
||||||
|
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
|
||||||
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "6c4830e37743b060d13c9269394176aea6a0fbc8" },
|
||||||
|
"mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" },
|
||||||
|
"neo-tree.nvim": { "branch": "v3.x", "commit": "f3df514fff2bdd4318127c40470984137f87b62e" },
|
||||||
|
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||||
|
"nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" },
|
||||||
|
"nvim-cmp": { "branch": "main", "commit": "da88697d7f45d16852c6b2769dc52387d1ddc45f" },
|
||||||
|
"nvim-lspconfig": { "branch": "master", "commit": "5a855bcfec7973767a1a472335684bbd71d2fa2b" },
|
||||||
|
"nvim-treesitter": { "branch": "main", "commit": "dc42c209f3820bdfaae0956f15de29689aa6b451" },
|
||||||
|
"nvim-web-devicons": { "branch": "master", "commit": "746ffbb17975ebd6c40142362eee1b0249969c5c" },
|
||||||
|
"persistence.nvim": { "branch": "main", "commit": "b20b2a7887bd39c1a356980b45e03250f3dce49c" },
|
||||||
|
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||||
|
"rustaceanvim": { "branch": "master", "commit": "e9c5aaba16fead831379d5f44617547a90b913c7" },
|
||||||
|
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
|
||||||
|
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||||
|
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
|
||||||
|
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
||||||
|
}
|
||||||
35
lua/config/autocmds.lua
Normal file
35
lua/config/autocmds.lua
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
local augroup = vim.api.nvim_create_augroup
|
||||||
|
local autocmd = vim.api.nvim_create_autocmd
|
||||||
|
|
||||||
|
-- Highlight on yank
|
||||||
|
autocmd("TextYankPost", {
|
||||||
|
group = augroup("highlight_yank", { clear = true }),
|
||||||
|
callback = function()
|
||||||
|
vim.highlight.on_yank({ timeout = 200 })
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Remove trailing whitespace on save
|
||||||
|
autocmd("BufWritePre", {
|
||||||
|
group = augroup("trim_whitespace", { clear = true }),
|
||||||
|
pattern = "*",
|
||||||
|
command = "%s/\\s\\+$//e",
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Restore cursor position
|
||||||
|
autocmd("BufReadPost", {
|
||||||
|
group = augroup("restore_cursor", { clear = true }),
|
||||||
|
callback = function()
|
||||||
|
local mark = vim.api.nvim_buf_get_mark(0, '"')
|
||||||
|
local lcount = vim.api.nvim_buf_line_count(0)
|
||||||
|
if mark[1] > 0 and mark[1] <= lcount then
|
||||||
|
pcall(vim.api.nvim_win_set_cursor, 0, mark)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Auto-resize splits on window resize
|
||||||
|
autocmd("VimResized", {
|
||||||
|
group = augroup("auto_resize", { clear = true }),
|
||||||
|
command = "tabdo wincmd =",
|
||||||
|
})
|
||||||
47
lua/config/keymaps.lua
Normal file
47
lua/config/keymaps.lua
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
vim.g.mapleader = " "
|
||||||
|
vim.g.maplocalleader = " "
|
||||||
|
|
||||||
|
local map = vim.keymap.set
|
||||||
|
|
||||||
|
-- Better window navigation
|
||||||
|
map("n", "<C-h>", "<C-w>h", { desc = "Go to left window" })
|
||||||
|
map("n", "<C-j>", "<C-w>j", { desc = "Go to lower window" })
|
||||||
|
map("n", "<C-k>", "<C-w>k", { desc = "Go to upper window" })
|
||||||
|
map("n", "<C-l>", "<C-w>l", { desc = "Go to right window" })
|
||||||
|
|
||||||
|
-- Resize windows
|
||||||
|
map("n", "<C-Up>", ":resize +2<CR>", { desc = "Increase window height" })
|
||||||
|
map("n", "<C-Down>", ":resize -2<CR>", { desc = "Decrease window height" })
|
||||||
|
map("n", "<C-Left>", ":vertical resize -2<CR>", { desc = "Decrease window width" })
|
||||||
|
map("n", "<C-Right>", ":vertical resize +2<CR>", { desc = "Increase window width" })
|
||||||
|
|
||||||
|
-- Buffers
|
||||||
|
map("n", "<S-l>", ":bnext<CR>", { desc = "Next buffer" })
|
||||||
|
map("n", "<S-h>", ":bprevious<CR>", { desc = "Previous buffer" })
|
||||||
|
map("n", "<leader>bd", ":bdelete<CR>", { desc = "Delete buffer" })
|
||||||
|
|
||||||
|
-- Move lines up/down in visual mode
|
||||||
|
map("v", "J", ":m '>+1<CR>gv=gv", { desc = "Move selection down" })
|
||||||
|
map("v", "K", ":m '<-2<CR>gv=gv", { desc = "Move selection up" })
|
||||||
|
|
||||||
|
-- Keep cursor centered when scrolling
|
||||||
|
map("n", "<C-d>", "<C-d>zz")
|
||||||
|
map("n", "<C-u>", "<C-u>zz")
|
||||||
|
|
||||||
|
-- Keep cursor centered on search results
|
||||||
|
map("n", "n", "nzzzv")
|
||||||
|
map("n", "N", "Nzzzv")
|
||||||
|
|
||||||
|
-- Clear search highlight
|
||||||
|
map("n", "<Esc>", ":nohlsearch<CR>", { desc = "Clear search highlight" })
|
||||||
|
|
||||||
|
-- Better paste (don't override register)
|
||||||
|
map("x", "<leader>p", '"_dP', { desc = "Paste without overwriting register" })
|
||||||
|
|
||||||
|
-- Save file
|
||||||
|
map("n", "<C-s>", ":w<CR>", { desc = "Save file" })
|
||||||
|
|
||||||
|
-- Diagnostic navigation
|
||||||
|
map("n", "[d", vim.diagnostic.goto_prev, { desc = "Previous diagnostic" })
|
||||||
|
map("n", "]d", vim.diagnostic.goto_next, { desc = "Next diagnostic" })
|
||||||
|
map("n", "<leader>e", vim.diagnostic.open_float, { desc = "Show diagnostic" })
|
||||||
49
lua/config/options.lua
Normal file
49
lua/config/options.lua
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
local opt = vim.opt
|
||||||
|
|
||||||
|
-- Line numbers
|
||||||
|
opt.number = true
|
||||||
|
opt.relativenumber = true
|
||||||
|
|
||||||
|
-- Tabs & indentation
|
||||||
|
opt.tabstop = 4
|
||||||
|
opt.shiftwidth = 4
|
||||||
|
opt.expandtab = true
|
||||||
|
opt.smartindent = true
|
||||||
|
|
||||||
|
-- Search
|
||||||
|
opt.ignorecase = true
|
||||||
|
opt.smartcase = true
|
||||||
|
opt.hlsearch = true
|
||||||
|
opt.incsearch = true
|
||||||
|
|
||||||
|
-- Appearance
|
||||||
|
opt.termguicolors = true
|
||||||
|
opt.signcolumn = "yes"
|
||||||
|
opt.cursorline = true
|
||||||
|
opt.scrolloff = 8
|
||||||
|
opt.sidescrolloff = 8
|
||||||
|
|
||||||
|
-- Line wrapping
|
||||||
|
opt.wrap = false
|
||||||
|
|
||||||
|
-- Clipboard
|
||||||
|
opt.clipboard = "unnamedplus"
|
||||||
|
|
||||||
|
-- Split behavior
|
||||||
|
opt.splitright = true
|
||||||
|
opt.splitbelow = true
|
||||||
|
|
||||||
|
-- Undo / swap
|
||||||
|
opt.undofile = true
|
||||||
|
opt.swapfile = false
|
||||||
|
opt.backup = false
|
||||||
|
|
||||||
|
-- Performance
|
||||||
|
opt.updatetime = 250
|
||||||
|
opt.timeoutlen = 300
|
||||||
|
|
||||||
|
-- Completion menu
|
||||||
|
opt.completeopt = "menuone,noselect"
|
||||||
|
|
||||||
|
-- File encoding
|
||||||
|
opt.fileencoding = "utf-8"
|
||||||
19
lua/plugins/bufferline.lua
Normal file
19
lua/plugins/bufferline.lua
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
return {
|
||||||
|
"akinsho/bufferline.nvim",
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
|
lazy = false,
|
||||||
|
opts = {
|
||||||
|
options = {
|
||||||
|
diagnostics = "nvim_lsp",
|
||||||
|
offsets = {
|
||||||
|
{ filetype = "neo-tree", text = "Explorer", separator = true },
|
||||||
|
},
|
||||||
|
show_close_icon = false,
|
||||||
|
separator_style = "thin",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
{ "<leader>bp", "<cmd>BufferLineTogglePin<cr>", desc = "Pin buffer" },
|
||||||
|
{ "<leader>bo", "<cmd>BufferLineCloseOthers<cr>", desc = "Close other buffers" },
|
||||||
|
},
|
||||||
|
}
|
||||||
55
lua/plugins/cmp.lua
Normal file
55
lua/plugins/cmp.lua
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
return {
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
event = "InsertEnter",
|
||||||
|
dependencies = {
|
||||||
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
|
"hrsh7th/cmp-buffer",
|
||||||
|
"hrsh7th/cmp-path",
|
||||||
|
"L3MON4D3/LuaSnip",
|
||||||
|
"saadparwaiz1/cmp_luasnip",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local cmp = require("cmp")
|
||||||
|
local luasnip = require("luasnip")
|
||||||
|
|
||||||
|
cmp.setup({
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
luasnip.lsp_expand(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||||
|
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||||
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
|
["<C-e>"] = cmp.mapping.abort(),
|
||||||
|
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||||
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_next_item()
|
||||||
|
elseif luasnip.expand_or_jumpable() then
|
||||||
|
luasnip.expand_or_jump()
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_prev_item()
|
||||||
|
elseif luasnip.jumpable(-1) then
|
||||||
|
luasnip.jump(-1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
}),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = "nvim_lsp" },
|
||||||
|
{ name = "luasnip" },
|
||||||
|
{ name = "path" },
|
||||||
|
}, {
|
||||||
|
{ name = "buffer" },
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
8
lua/plugins/colorscheme.lua
Normal file
8
lua/plugins/colorscheme.lua
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
return {
|
||||||
|
"p00f/alabaster.nvim",
|
||||||
|
priority = 1000,
|
||||||
|
config = function()
|
||||||
|
vim.o.background = "light"
|
||||||
|
vim.cmd.colorscheme("alabaster")
|
||||||
|
end,
|
||||||
|
}
|
||||||
65
lua/plugins/editor.lua
Normal file
65
lua/plugins/editor.lua
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
return {
|
||||||
|
-- Autopairs
|
||||||
|
{
|
||||||
|
"windwp/nvim-autopairs",
|
||||||
|
event = "InsertEnter",
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Comment toggling
|
||||||
|
{
|
||||||
|
"numToStr/Comment.nvim",
|
||||||
|
keys = {
|
||||||
|
{ "gcc", mode = "n", desc = "Toggle comment" },
|
||||||
|
{ "gc", mode = "v", desc = "Toggle comment" },
|
||||||
|
},
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- TODO comments
|
||||||
|
{
|
||||||
|
"folke/todo-comments.nvim",
|
||||||
|
event = { "BufReadPost", "BufNewFile" },
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
|
opts = {},
|
||||||
|
keys = {
|
||||||
|
{ "<leader>ft", "<cmd>TodoTelescope<cr>", desc = "Find TODOs" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Which-key: shows keybinding hints
|
||||||
|
{
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- File explorer
|
||||||
|
{
|
||||||
|
"nvim-neo-tree/neo-tree.nvim",
|
||||||
|
branch = "v3.x",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"nvim-tree/nvim-web-devicons",
|
||||||
|
"MunifTanjim/nui.nvim",
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
{ "<leader>n", "<cmd>Neotree toggle<cr>", desc = "Toggle file explorer" },
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
filesystem = {
|
||||||
|
filtered_items = {
|
||||||
|
visible = true,
|
||||||
|
hide_dotfiles = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Crates.nvim for Cargo.toml
|
||||||
|
{
|
||||||
|
"saecki/crates.nvim",
|
||||||
|
event = { "BufRead Cargo.toml" },
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
}
|
||||||
28
lua/plugins/git.lua
Normal file
28
lua/plugins/git.lua
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"lewis6991/gitsigns.nvim",
|
||||||
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
|
opts = {
|
||||||
|
on_attach = function(bufnr)
|
||||||
|
local gs = package.loaded.gitsigns
|
||||||
|
local map = function(mode, l, r, desc)
|
||||||
|
vim.keymap.set(mode, l, r, { buffer = bufnr, desc = desc })
|
||||||
|
end
|
||||||
|
|
||||||
|
map("n", "]h", gs.next_hunk, "Next hunk")
|
||||||
|
map("n", "[h", gs.prev_hunk, "Previous hunk")
|
||||||
|
map("n", "<leader>hs", gs.stage_hunk, "Stage hunk")
|
||||||
|
map("n", "<leader>hr", gs.reset_hunk, "Reset hunk")
|
||||||
|
map("n", "<leader>hp", gs.preview_hunk, "Preview hunk")
|
||||||
|
map("n", "<leader>hb", function() gs.blame_line({ full = true }) end, "Blame line")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"kdheepak/lazygit.nvim",
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
|
keys = {
|
||||||
|
{ "<leader>gg", "<cmd>LazyGit<cr>", desc = "LazyGit" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
57
lua/plugins/lsp.lua
Normal file
57
lua/plugins/lsp.lua
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"williamboman/mason-lspconfig.nvim",
|
||||||
|
dependencies = { "williamboman/mason.nvim", "neovim/nvim-lspconfig" },
|
||||||
|
opts = {
|
||||||
|
ensure_installed = {
|
||||||
|
"ts_ls",
|
||||||
|
"clangd",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
dependencies = {
|
||||||
|
"williamboman/mason-lspconfig.nvim",
|
||||||
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
|
|
||||||
|
-- LSP keymaps on attach
|
||||||
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
|
callback = function(ev)
|
||||||
|
local map = function(keys, func, desc)
|
||||||
|
vim.keymap.set("n", keys, func, { buffer = ev.buf, desc = desc })
|
||||||
|
end
|
||||||
|
map("gd", vim.lsp.buf.definition, "Go to definition")
|
||||||
|
map("gD", vim.lsp.buf.declaration, "Go to declaration")
|
||||||
|
map("gr", vim.lsp.buf.references, "Go to references")
|
||||||
|
map("gi", vim.lsp.buf.implementation, "Go to implementation")
|
||||||
|
map("K", vim.lsp.buf.hover, "Hover documentation")
|
||||||
|
map("<leader>ca", vim.lsp.buf.code_action, "Code action")
|
||||||
|
map("<leader>rn", vim.lsp.buf.rename, "Rename symbol")
|
||||||
|
map("<leader>fs", "<cmd>Telescope lsp_document_symbols<cr>", "Document symbols")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Configure servers using vim.lsp.config (Neovim 0.11+)
|
||||||
|
vim.lsp.config("ts_ls", { capabilities = capabilities })
|
||||||
|
vim.lsp.config("clangd", { capabilities = capabilities })
|
||||||
|
vim.lsp.config("zls", { capabilities = capabilities })
|
||||||
|
|
||||||
|
-- Enable servers
|
||||||
|
vim.lsp.enable({ "ts_ls", "clangd", "zls" })
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
-- Rust gets its own dedicated plugin
|
||||||
|
"mrcjkb/rustaceanvim",
|
||||||
|
version = "^5",
|
||||||
|
lazy = false,
|
||||||
|
},
|
||||||
|
}
|
||||||
19
lua/plugins/lualine.lua
Normal file
19
lua/plugins/lualine.lua
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
return {
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
|
opts = {
|
||||||
|
options = {
|
||||||
|
theme = "auto",
|
||||||
|
component_separators = { left = "", right = "" },
|
||||||
|
section_separators = { left = "", right = "" },
|
||||||
|
},
|
||||||
|
sections = {
|
||||||
|
lualine_a = { "mode" },
|
||||||
|
lualine_b = { "branch", "diff", "diagnostics" },
|
||||||
|
lualine_c = { { "filename", path = 1 } },
|
||||||
|
lualine_x = { "encoding", "filetype" },
|
||||||
|
lualine_y = { "progress" },
|
||||||
|
lualine_z = { "location" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
10
lua/plugins/session.lua
Normal file
10
lua/plugins/session.lua
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
return {
|
||||||
|
"folke/persistence.nvim",
|
||||||
|
event = "BufReadPre",
|
||||||
|
opts = {},
|
||||||
|
keys = {
|
||||||
|
{ "<leader>qs", function() require("persistence").load() end, desc = "Restore session" },
|
||||||
|
{ "<leader>ql", function() require("persistence").load({ last = true }) end, desc = "Restore last session" },
|
||||||
|
{ "<leader>qd", function() require("persistence").stop() end, desc = "Stop session saving" },
|
||||||
|
},
|
||||||
|
}
|
||||||
25
lua/plugins/telescope.lua
Normal file
25
lua/plugins/telescope.lua
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
return {
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
branch = "0.1.x",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
{ "<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Find files" },
|
||||||
|
{ "<leader>fg", "<cmd>Telescope live_grep<cr>", desc = "Live grep" },
|
||||||
|
{ "<leader>fb", "<cmd>Telescope buffers<cr>", desc = "Buffers" },
|
||||||
|
{ "<leader>fh", "<cmd>Telescope help_tags<cr>", desc = "Help tags" },
|
||||||
|
{ "<leader>fd", "<cmd>Telescope diagnostics<cr>", desc = "Diagnostics" },
|
||||||
|
{ "<leader>fr", "<cmd>Telescope oldfiles<cr>", desc = "Recent files" },
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local telescope = require("telescope")
|
||||||
|
telescope.setup({
|
||||||
|
defaults = {
|
||||||
|
file_ignore_patterns = { "node_modules", ".git/", "target/" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
telescope.load_extension("fzf")
|
||||||
|
end,
|
||||||
|
}
|
||||||
5
lua/plugins/treesitter.lua
Normal file
5
lua/plugins/treesitter.lua
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
return {
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
build = ":TSUpdate",
|
||||||
|
lazy = false,
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user