mirror of
https://github.com/harivansh-afk/dots.git
synced 2026-04-15 10:05:15 +00:00
submodule
This commit is contained in:
parent
4b1f50d4e1
commit
e01a0004c1
28 changed files with 4 additions and 1057 deletions
1
nvim/.config/nvim
Submodule
1
nvim/.config/nvim
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 861c56911077b076b9cafdbff4f250f98e80c2f8
|
||||
|
|
@ -1 +0,0 @@
|
|||
vim.keymap.set("n", "<Tab>", "=", { buffer = true, remap = true })
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
vim.opt_local.expandtab = false
|
||||
vim.opt_local.tabstop = 4
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
vim.opt_local.tabstop = 4
|
||||
vim.opt_local.shiftwidth = 4
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
vim.opt_local.wrap = true
|
||||
vim.opt_local.textwidth = 80
|
||||
vim.opt_local.conceallevel = 2
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
vim.opt_local.makeprg = "python %"
|
||||
vim.opt_local.colorcolumn = "88"
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
vim.opt_local.makeprg = "cargo run"
|
||||
vim.opt_local.colorcolumn = "100"
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
local lsp_config = require("config.lsp")
|
||||
|
||||
vim.lsp.config("*", {
|
||||
capabilities = lsp_config.capabilities(),
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
|
||||
callback = function(ev)
|
||||
local client = vim.lsp.get_client_by_id(ev.data.client_id)
|
||||
if client then
|
||||
lsp_config.on_attach(client, ev.buf)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
for _, server in ipairs({
|
||||
"lua_ls",
|
||||
"pyright",
|
||||
"ts_ls",
|
||||
"rust_analyzer",
|
||||
"gopls",
|
||||
"clangd",
|
||||
"bashls",
|
||||
"jsonls",
|
||||
"html",
|
||||
"cssls",
|
||||
}) do
|
||||
local ok, config = pcall(require, "lsp." .. server)
|
||||
if ok then
|
||||
vim.lsp.config(server, config)
|
||||
end
|
||||
vim.lsp.enable(server)
|
||||
end
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
-- Set leader keys before lazy
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = ","
|
||||
|
||||
-- Global mapping helpers
|
||||
_G.map = function(mode, lhs, rhs, opts)
|
||||
opts = opts or {}
|
||||
opts.silent = opts.silent ~= false
|
||||
vim.keymap.set(mode, lhs, rhs, opts)
|
||||
end
|
||||
|
||||
_G.bmap = function(buf, mode, lhs, rhs, opts)
|
||||
opts = opts or {}
|
||||
opts.buffer = buf
|
||||
opts.silent = opts.silent ~= false
|
||||
vim.keymap.set(mode, lhs, rhs, opts)
|
||||
end
|
||||
|
||||
-- Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.uv.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 plugins
|
||||
require("lazy").setup("plugins", {
|
||||
defaults = { lazy = true },
|
||||
performance = {
|
||||
rtp = {
|
||||
disabled_plugins = {
|
||||
"gzip",
|
||||
"matchit",
|
||||
"matchparen",
|
||||
"netrwPlugin",
|
||||
"tarPlugin",
|
||||
"tohtml",
|
||||
"zipPlugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
{
|
||||
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||
"dashboard-nvim": { "branch": "master", "commit": "0775e567b6c0be96d01a61795f7b64c1758262f6" },
|
||||
"diffs.nvim": { "branch": "main", "commit": "3d640c207bf21c671bac717a532e2ff9b5cf91d9" },
|
||||
"flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" },
|
||||
"fzf-lua": { "branch": "main", "commit": "5921997472574fca3880b62949eb8679dc6f5afc" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "9f3c6dd7868bcc116e9c1c1929ce063b978fa519" },
|
||||
"gruvbox.nvim": { "branch": "main", "commit": "561126520034a1dac2f78ab063db025d12555998" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "21c2a84ce368e99b18f52ab348c4c02c32c02fcf" },
|
||||
"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-lspconfig": { "branch": "master", "commit": "44acfe887d4056f704ccc4f17513ed41c9e2b2e6" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"nvim-treesitter-textobjects": { "branch": "main", "commit": "a0e182ae21fda68c59d1f36c9ed45600aef50311" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "746ffbb17975ebd6c40142362eee1b0249969c5c" },
|
||||
"oil.nvim": { "branch": "master", "commit": "f55b25e493a7df76371cfadd0ded5004cb9cd48a" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||
"snacks.nvim": { "branch": "main", "commit": "fe7cfe9800a182274d0f868a74b7263b8c0c020b" },
|
||||
"supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
||||
}
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
-- Shared LSP utilities
|
||||
local M = {}
|
||||
|
||||
-- Set up buffer-local keymaps when LSP attaches
|
||||
function M.on_attach(client, bufnr)
|
||||
local opts = { buffer = bufnr, silent = true }
|
||||
|
||||
-- Navigation
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, vim.tbl_extend("force", opts, { desc = "Go to definition" }))
|
||||
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, vim.tbl_extend("force", opts, { desc = "Go to declaration" }))
|
||||
vim.keymap.set("n", "<C-]>", vim.lsp.buf.definition, vim.tbl_extend("force", opts, { desc = "Go to definition" }))
|
||||
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, vim.tbl_extend("force", opts, { desc = "Go to implementation" }))
|
||||
vim.keymap.set("n", "gr", vim.lsp.buf.references, vim.tbl_extend("force", opts, { desc = "Go to references" }))
|
||||
|
||||
-- Documentation
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, vim.tbl_extend("force", opts, { desc = "Hover documentation" }))
|
||||
|
||||
-- Refactoring
|
||||
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, vim.tbl_extend("force", opts, { desc = "Rename symbol" }))
|
||||
vim.keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, vim.tbl_extend("force", opts, { desc = "Code action" }))
|
||||
|
||||
-- Formatting
|
||||
vim.keymap.set("n", "<leader>f", function()
|
||||
vim.lsp.buf.format({ async = true })
|
||||
end, vim.tbl_extend("force", opts, { desc = "Format buffer" }))
|
||||
end
|
||||
|
||||
-- Return default capabilities for LSP servers
|
||||
function M.capabilities()
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
|
||||
-- If nvim-cmp is available, extend capabilities
|
||||
local ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
|
||||
if ok then
|
||||
capabilities = vim.tbl_deep_extend("force", capabilities, cmp_nvim_lsp.default_capabilities())
|
||||
end
|
||||
|
||||
return capabilities
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
@ -1,139 +0,0 @@
|
|||
-- Minimal custom statusline
|
||||
local M = {}
|
||||
|
||||
-- Mode mapping
|
||||
local mode_map = {
|
||||
n = "NORMAL",
|
||||
no = "N-PENDING",
|
||||
nov = "N-PENDING",
|
||||
noV = "N-PENDING",
|
||||
["no\22"] = "N-PENDING",
|
||||
niI = "NORMAL",
|
||||
niR = "NORMAL",
|
||||
niV = "NORMAL",
|
||||
nt = "NORMAL",
|
||||
ntT = "NORMAL",
|
||||
v = "VISUAL",
|
||||
vs = "VISUAL",
|
||||
V = "V-LINE",
|
||||
Vs = "V-LINE",
|
||||
["\22"] = "V-BLOCK",
|
||||
["\22s"] = "V-BLOCK",
|
||||
s = "SELECT",
|
||||
S = "S-LINE",
|
||||
["\19"] = "S-BLOCK",
|
||||
i = "INSERT",
|
||||
ic = "INSERT",
|
||||
ix = "INSERT",
|
||||
R = "REPLACE",
|
||||
Rc = "REPLACE",
|
||||
Rx = "REPLACE",
|
||||
Rv = "V-REPLACE",
|
||||
Rvc = "V-REPLACE",
|
||||
Rvx = "V-REPLACE",
|
||||
c = "COMMAND",
|
||||
cv = "EX",
|
||||
ce = "EX",
|
||||
r = "REPLACE",
|
||||
rm = "MORE",
|
||||
["r?"] = "CONFIRM",
|
||||
["!"] = "SHELL",
|
||||
t = "TERMINAL",
|
||||
}
|
||||
|
||||
-- Get current mode indicator
|
||||
local function get_mode()
|
||||
local mode = vim.api.nvim_get_mode().mode
|
||||
return mode_map[mode] or mode
|
||||
end
|
||||
|
||||
-- Get git branch from gitsigns
|
||||
local function get_git_branch()
|
||||
local branch = vim.b.gitsigns_head
|
||||
if branch and branch ~= "" then
|
||||
return " " .. branch
|
||||
end
|
||||
return ""
|
||||
end
|
||||
|
||||
-- Get filename with modified indicator
|
||||
local function get_filename()
|
||||
local filename = vim.fn.expand("%:t")
|
||||
if filename == "" then
|
||||
filename = "[No Name]"
|
||||
end
|
||||
|
||||
local modified = vim.bo.modified and " [+]" or ""
|
||||
local readonly = vim.bo.readonly and " [RO]" or ""
|
||||
|
||||
return filename .. modified .. readonly
|
||||
end
|
||||
|
||||
-- Get file path (relative to cwd)
|
||||
local function get_filepath()
|
||||
local filepath = vim.fn.expand("%:~:.")
|
||||
if filepath == "" then
|
||||
return ""
|
||||
end
|
||||
return filepath
|
||||
end
|
||||
|
||||
-- Get current position
|
||||
local function get_position()
|
||||
local line = vim.fn.line(".")
|
||||
local col = vim.fn.col(".")
|
||||
local total = vim.fn.line("$")
|
||||
return string.format("%d:%d/%d", line, col, total)
|
||||
end
|
||||
|
||||
-- Get filetype
|
||||
local function get_filetype()
|
||||
local ft = vim.bo.filetype
|
||||
if ft == "" then
|
||||
return ""
|
||||
end
|
||||
return ft
|
||||
end
|
||||
|
||||
-- Build the statusline
|
||||
function M.statusline()
|
||||
local parts = {}
|
||||
|
||||
-- Left side
|
||||
table.insert(parts, " " .. get_mode() .. " ")
|
||||
table.insert(parts, get_git_branch())
|
||||
|
||||
local filepath = get_filepath()
|
||||
if filepath ~= "" then
|
||||
table.insert(parts, " " .. filepath)
|
||||
end
|
||||
|
||||
-- Modified indicator
|
||||
if vim.bo.modified then
|
||||
table.insert(parts, " [+]")
|
||||
end
|
||||
|
||||
-- Separator
|
||||
table.insert(parts, "%=")
|
||||
|
||||
-- Right side
|
||||
local ft = get_filetype()
|
||||
if ft ~= "" then
|
||||
table.insert(parts, ft .. " ")
|
||||
end
|
||||
|
||||
table.insert(parts, get_position() .. " ")
|
||||
|
||||
return table.concat(parts, "")
|
||||
end
|
||||
|
||||
-- Setup function to configure the statusline
|
||||
function M.setup()
|
||||
-- Use the %!v:lua.require() pattern
|
||||
vim.o.statusline = "%!v:lua.require('config.statusline').statusline()"
|
||||
|
||||
-- Ensure statusline is always shown
|
||||
vim.o.laststatus = 2
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
-- Lua language server configuration
|
||||
return {
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = { "vim" },
|
||||
},
|
||||
runtime = {
|
||||
version = "LuaJIT",
|
||||
},
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
library = {
|
||||
vim.env.VIMRUNTIME,
|
||||
},
|
||||
},
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
hint = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
-- Pyright (Python) language server configuration
|
||||
return {
|
||||
settings = {
|
||||
python = {
|
||||
analysis = {
|
||||
typeCheckingMode = "basic",
|
||||
autoSearchPaths = true,
|
||||
useLibraryCodeForTypes = true,
|
||||
diagnosticMode = "workspace",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
-- Rust Analyzer configuration with clippy integration
|
||||
return {
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
checkOnSave = {
|
||||
command = "clippy",
|
||||
},
|
||||
cargo = {
|
||||
allFeatures = true,
|
||||
},
|
||||
procMacro = {
|
||||
enable = true,
|
||||
},
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
},
|
||||
inlayHints = {
|
||||
bindingModeHints = { enable = true },
|
||||
chainingHints = { enable = true },
|
||||
closingBraceHints = { enable = true },
|
||||
closureReturnTypeHints = { enable = "always" },
|
||||
lifetimeElisionHints = { enable = "always" },
|
||||
parameterHints = { enable = true },
|
||||
typeHints = { enable = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
-- TypeScript language server configuration
|
||||
return {
|
||||
settings = {
|
||||
typescript = {
|
||||
inlayHints = {
|
||||
includeInlayParameterNameHints = "all",
|
||||
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
|
||||
includeInlayFunctionParameterTypeHints = true,
|
||||
includeInlayVariableTypeHints = true,
|
||||
includeInlayPropertyDeclarationTypeHints = true,
|
||||
includeInlayFunctionLikeReturnTypeHints = true,
|
||||
includeInlayEnumMemberValueHints = true,
|
||||
},
|
||||
},
|
||||
javascript = {
|
||||
inlayHints = {
|
||||
includeInlayParameterNameHints = "all",
|
||||
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
|
||||
includeInlayFunctionParameterTypeHints = true,
|
||||
includeInlayVariableTypeHints = true,
|
||||
includeInlayPropertyDeclarationTypeHints = true,
|
||||
includeInlayFunctionLikeReturnTypeHints = true,
|
||||
includeInlayEnumMemberValueHints = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
return {
|
||||
-- Autopairs
|
||||
{
|
||||
"windwp/nvim-autopairs",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
require("nvim-autopairs").setup({})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Comment.nvim
|
||||
{
|
||||
"numToStr/Comment.nvim",
|
||||
keys = {
|
||||
{ "gcc", mode = "n", desc = "Comment toggle current line" },
|
||||
{ "gc", mode = { "n", "o" }, desc = "Comment toggle linewise" },
|
||||
{ "gc", mode = "x", desc = "Comment toggle linewise (visual)" },
|
||||
{ "gbc", mode = "n", desc = "Comment toggle current block" },
|
||||
{ "gb", mode = { "n", "o" }, desc = "Comment toggle blockwise" },
|
||||
{ "gb", mode = "x", desc = "Comment toggle blockwise (visual)" },
|
||||
},
|
||||
config = function()
|
||||
require("Comment").setup()
|
||||
end,
|
||||
},
|
||||
|
||||
-- Flash.nvim for navigation
|
||||
{
|
||||
"folke/flash.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
modes = {
|
||||
search = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
|
||||
{ "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
|
||||
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
|
||||
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
|
||||
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
|
||||
},
|
||||
},
|
||||
|
||||
-- Supermaven AI completion
|
||||
{
|
||||
"supermaven-inc/supermaven-nvim",
|
||||
event = "InsertEnter",
|
||||
opts = {
|
||||
keymaps = {
|
||||
accept_suggestion = "<Tab>",
|
||||
clear_suggestion = "<C-]>",
|
||||
accept_word = "<C-j>",
|
||||
},
|
||||
ignore_filetypes = { "gitcommit", "TelescopePrompt" },
|
||||
color = {
|
||||
suggestion_color = vim.api.nvim_get_hl(0, { name = "Comment" }).fg,
|
||||
cterm = 244,
|
||||
},
|
||||
log_level = "info",
|
||||
disable_inline_completion = false,
|
||||
disable_keymaps = false,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
return {
|
||||
"ibhagwan/fzf-lua",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
cmd = "FzfLua",
|
||||
keys = {
|
||||
-- Main keybinds
|
||||
{
|
||||
"<C-f>",
|
||||
function()
|
||||
local fzf = require("fzf-lua")
|
||||
local git_dir = vim.fn.system("git rev-parse --git-dir 2>/dev/null"):gsub("\n", "")
|
||||
if vim.v.shell_error == 0 and git_dir ~= "" then
|
||||
fzf.git_files()
|
||||
else
|
||||
fzf.files()
|
||||
end
|
||||
end,
|
||||
desc = "Find files",
|
||||
},
|
||||
{ "<C-g>", function() require("fzf-lua").live_grep() end, desc = "Live grep" },
|
||||
|
||||
-- Leader keybinds
|
||||
{ "<leader>ff", function() require("fzf-lua").files() end, desc = "Files" },
|
||||
{ "<leader>fg", function() require("fzf-lua").live_grep() end, desc = "Live grep" },
|
||||
{ "<leader>fb", function() require("fzf-lua").buffers() end, desc = "Buffers" },
|
||||
{ "<leader>fh", function() require("fzf-lua").help_tags() end, desc = "Help tags" },
|
||||
{ "<leader>fr", function() require("fzf-lua").resume() end, desc = "Resume last search" },
|
||||
{ "<leader>fo", function() require("fzf-lua").oldfiles() end, desc = "Recent files" },
|
||||
{ "<leader>fc", function() require("fzf-lua").commands() end, desc = "Commands" },
|
||||
{ "<leader>fk", function() require("fzf-lua").keymaps() end, desc = "Keymaps" },
|
||||
{ "<leader>f/", function() require("fzf-lua").search_history() end, desc = "Search history" },
|
||||
{ "<leader>f:", function() require("fzf-lua").command_history() end, desc = "Command history" },
|
||||
{ "<leader>fe", function() require("fzf-lua").files({ cwd = "~/.config" }) end, desc = "Config files" },
|
||||
-- Quickfix/loclist
|
||||
{ "gq", function() require("fzf-lua").quickfix() end, desc = "Quickfix" },
|
||||
{ "gl", function() require("fzf-lua").loclist() end, desc = "Loclist" },
|
||||
-- Git
|
||||
{ "<leader>GB", function() require("fzf-lua").git_branches() end, desc = "Git branches" },
|
||||
{ "<leader>Gc", function() require("fzf-lua").git_commits() end, desc = "Git commits" },
|
||||
{ "<leader>Gs", function() require("fzf-lua").git_status() end, desc = "Git status" },
|
||||
},
|
||||
opts = {
|
||||
"default-title",
|
||||
winopts = {
|
||||
border = "single",
|
||||
preview = {
|
||||
layout = "vertical",
|
||||
vertical = "down:50%",
|
||||
},
|
||||
},
|
||||
fzf_opts = {
|
||||
["--layout"] = "reverse",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
return {
|
||||
-- Fugitive: The gold standard for Git in Vim
|
||||
{
|
||||
"tpope/vim-fugitive",
|
||||
cmd = { "Git", "G", "Gread", "Gwrite", "Gdiffsplit", "Gvdiffsplit", "Gblame" },
|
||||
keys = {
|
||||
{ "<leader>gg", "<cmd>Git<cr><cmd>only<cr>", desc = "Git status (fullscreen)" },
|
||||
{ "<leader>gc", "<cmd>Git commit<cr>", desc = "Git commit" },
|
||||
{ "<leader>gp", "<cmd>Git push<cr>", desc = "Git push" },
|
||||
{ "<leader>gl", "<cmd>Git pull<cr>", desc = "Git pull" },
|
||||
{ "<leader>gb", "<cmd>Git blame<cr>", desc = "Git blame" },
|
||||
{ "<leader>gd", "<cmd>Gvdiffsplit<cr>", desc = "Git diff vertical" },
|
||||
{ "<leader>gr", "<cmd>Gread<cr>", desc = "Git checkout file" },
|
||||
{ "<leader>gw", "<cmd>Gwrite<cr>", desc = "Git add file" },
|
||||
},
|
||||
},
|
||||
|
||||
-- Gitsigns: Git info in the gutter
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
opts = {
|
||||
signs = {
|
||||
add = { text = "│" },
|
||||
change = { text = "│" },
|
||||
delete = { text = "_" },
|
||||
topdelete = { text = "‾" },
|
||||
changedelete = { text = "│" },
|
||||
},
|
||||
signs_staged = {
|
||||
add = { text = "┃" },
|
||||
change = { text = "┃" },
|
||||
delete = { text = "_" },
|
||||
topdelete = { text = "‾" },
|
||||
changedelete = { text = "┃" },
|
||||
},
|
||||
signs_staged_enable = true,
|
||||
signcolumn = true,
|
||||
numhl = false,
|
||||
linehl = false, -- disabled - let colorscheme handle
|
||||
word_diff = false,
|
||||
current_line_blame = false,
|
||||
current_line_blame_opts = {
|
||||
delay = 500,
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{ "]g", "<cmd>Gitsigns next_hunk<cr>", desc = "Next hunk" },
|
||||
{ "[g", "<cmd>Gitsigns prev_hunk<cr>", desc = "Prev hunk" },
|
||||
{ "<leader>ghs", "<cmd>Gitsigns stage_hunk<cr>", desc = "Stage hunk" },
|
||||
{ "<leader>ghr", "<cmd>Gitsigns reset_hunk<cr>", desc = "Reset hunk" },
|
||||
{ "<leader>ghp", "<cmd>Gitsigns preview_hunk<cr>", desc = "Preview hunk" },
|
||||
{ "<leader>gB", "<cmd>Gitsigns toggle_current_line_blame<cr>", desc = "Toggle line blame" },
|
||||
},
|
||||
},
|
||||
|
||||
-- Snacks: GitHub integration (browse, issues, PRs)
|
||||
{
|
||||
"folke/snacks.nvim",
|
||||
lazy = false,
|
||||
opts = {
|
||||
gitbrowse = {},
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>go", function() Snacks.gitbrowse() end, desc = "Open in GitHub" },
|
||||
},
|
||||
},
|
||||
|
||||
-- Diffs.nvim: Better diff highlighting
|
||||
{
|
||||
"barrettruth/diffs.nvim",
|
||||
ft = { "git", "fugitive", "diff" },
|
||||
config = function()
|
||||
vim.g.diffs = {
|
||||
hide_prefix = true,
|
||||
highlights = {
|
||||
gutter = true,
|
||||
blend_alpha = 0.4,
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
return {
|
||||
{ "neovim/nvim-lspconfig", lazy = false },
|
||||
{ "williamboman/mason.nvim", lazy = false, opts = {} },
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
lazy = false,
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"lua_ls",
|
||||
"pyright",
|
||||
"rust_analyzer",
|
||||
"gopls",
|
||||
"clangd",
|
||||
"bashls",
|
||||
"jsonls",
|
||||
"html",
|
||||
"cssls",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
return {
|
||||
"stevearc/oil.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
lazy = false,
|
||||
keys = {
|
||||
{ "-", "<cmd>Oil<cr>", desc = "Open parent directory" },
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("oil").setup(opts)
|
||||
vim.api.nvim_create_autocmd("BufEnter", {
|
||||
pattern = "oil://*",
|
||||
callback = function()
|
||||
local dir = require("oil").get_current_dir()
|
||||
if dir then
|
||||
vim.cmd.lcd(dir)
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
opts = {
|
||||
default_file_explorer = true, -- nvim . opens oil
|
||||
columns = { "icon" },
|
||||
view_options = {
|
||||
show_hidden = true,
|
||||
},
|
||||
keymaps = {
|
||||
["g?"] = "actions.show_help",
|
||||
["<CR>"] = "actions.select",
|
||||
["<C-v>"] = "actions.select_vsplit",
|
||||
["<C-x>"] = "actions.select_split",
|
||||
["<C-p>"] = "actions.preview",
|
||||
["<C-c>"] = "actions.close",
|
||||
["-"] = "actions.parent",
|
||||
["g."] = "actions.toggle_hidden",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
return {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
cmd = "Neotree",
|
||||
keys = {
|
||||
{ "<C-e>", "<cmd>Neotree toggle<cr>", desc = "Toggle file explorer" },
|
||||
{ "<leader>e", "<cmd>Neotree toggle<cr>", desc = "Toggle file explorer" },
|
||||
{ "<BS>", "<cmd>Neotree toggle<cr>", desc = "Toggle file explorer" },
|
||||
{ "<leader>gs", "<cmd>Neotree git_status left<cr>", desc = "Git status tree" },
|
||||
},
|
||||
config = function()
|
||||
require("neo-tree").setup({
|
||||
close_if_last_window = true,
|
||||
window = {
|
||||
width = 30,
|
||||
mappings = {
|
||||
["<space>"] = "none",
|
||||
},
|
||||
},
|
||||
-- Source selector at top (just Files, no Git tab)
|
||||
source_selector = {
|
||||
winbar = false,
|
||||
},
|
||||
filesystem = {
|
||||
follow_current_file = {
|
||||
enabled = true,
|
||||
leave_dirs_open = false,
|
||||
},
|
||||
filtered_items = {
|
||||
visible = true,
|
||||
hide_dotfiles = false,
|
||||
hide_gitignored = false,
|
||||
hide_hidden = false,
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
return {
|
||||
-- Treesitter for syntax highlighting and code understanding
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
},
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = {
|
||||
"lua",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"query",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"tsx",
|
||||
"python",
|
||||
"html",
|
||||
"css",
|
||||
"json",
|
||||
"yaml",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"bash",
|
||||
"regex",
|
||||
},
|
||||
auto_install = true,
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true,
|
||||
keymaps = {
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ic"] = "@class.inner",
|
||||
["aa"] = "@parameter.outer",
|
||||
["ia"] = "@parameter.inner",
|
||||
["ai"] = "@conditional.outer",
|
||||
["ii"] = "@conditional.inner",
|
||||
["al"] = "@loop.outer",
|
||||
["il"] = "@loop.inner",
|
||||
["ab"] = "@block.outer",
|
||||
["ib"] = "@block.inner",
|
||||
},
|
||||
},
|
||||
move = {
|
||||
enable = true,
|
||||
set_jumps = true,
|
||||
goto_next_start = {
|
||||
["]f"] = "@function.outer",
|
||||
["]c"] = "@class.outer",
|
||||
["]a"] = "@parameter.inner",
|
||||
},
|
||||
goto_next_end = {
|
||||
["]F"] = "@function.outer",
|
||||
["]C"] = "@class.outer",
|
||||
},
|
||||
goto_previous_start = {
|
||||
["[f"] = "@function.outer",
|
||||
["[c"] = "@class.outer",
|
||||
["[a"] = "@parameter.inner",
|
||||
},
|
||||
goto_previous_end = {
|
||||
["[F"] = "@function.outer",
|
||||
["[C"] = "@class.outer",
|
||||
},
|
||||
},
|
||||
swap = {
|
||||
enable = true,
|
||||
swap_next = {
|
||||
["<leader>sn"] = "@parameter.inner",
|
||||
},
|
||||
swap_previous = {
|
||||
["<leader>sp"] = "@parameter.inner",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
@ -1,155 +0,0 @@
|
|||
return {
|
||||
-- Gruvbox colorscheme
|
||||
{
|
||||
"ellisonleao/gruvbox.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
require("gruvbox").setup({
|
||||
terminal_colors = true,
|
||||
undercurl = true,
|
||||
underline = false,
|
||||
bold = true,
|
||||
italic = {
|
||||
strings = false,
|
||||
emphasis = false,
|
||||
comments = true,
|
||||
operators = false,
|
||||
folds = false,
|
||||
},
|
||||
strikethrough = true,
|
||||
invert_selection = false,
|
||||
invert_signs = false,
|
||||
invert_tabline = false,
|
||||
invert_intend_guides = false,
|
||||
inverse = true,
|
||||
contrast = "hard",
|
||||
palette_overrides = {},
|
||||
overrides = {},
|
||||
dim_inactive = false,
|
||||
transparent_mode = true,
|
||||
})
|
||||
vim.cmd.colorscheme("gruvbox")
|
||||
end,
|
||||
},
|
||||
|
||||
-- Lualine statusline
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
lazy = false,
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
theme = "gruvbox",
|
||||
icons_enabled = false,
|
||||
component_separators = "",
|
||||
section_separators = "",
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "branch", "diff" },
|
||||
lualine_c = { { "filename", path = 1 } },
|
||||
lualine_x = { "diagnostics" },
|
||||
lualine_y = { "filetype" },
|
||||
lualine_z = { "location" },
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Dashboard
|
||||
{
|
||||
"nvimdev/dashboard-nvim",
|
||||
event = "VimEnter",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
local header_art = {
|
||||
" ██▒ █▓ ██▓ ███▄ ▄███▓",
|
||||
"▓██░ █▒▓██▒▓██▒▀█▀ ██▒",
|
||||
" ▓██ █▒░▒██▒▓██ ▓██░",
|
||||
" ▒██ █░░░██░▒██ ▒██ ",
|
||||
" ▒▀█░ ░██░▒██▒ ░██▒",
|
||||
" ░ ▐░ ░▓ ░ ▒░ ░ ░",
|
||||
" ░ ░░ ▒ ░░ ░ ░",
|
||||
" ░░ ▒ ░░ ░ ",
|
||||
" ░ ░ ░ ",
|
||||
" ░ ",
|
||||
}
|
||||
local center_items = 6
|
||||
local content_height = #header_art + 2 + (center_items * 2)
|
||||
local win_height = vim.fn.winheight(0)
|
||||
local padding = math.max(0, math.floor((win_height - content_height) / 2))
|
||||
|
||||
local header = {}
|
||||
for _ = 1, padding do
|
||||
table.insert(header, "")
|
||||
end
|
||||
for _, line in ipairs(header_art) do
|
||||
table.insert(header, line)
|
||||
end
|
||||
table.insert(header, "")
|
||||
table.insert(header, "")
|
||||
|
||||
require("dashboard").setup({
|
||||
theme = "doom",
|
||||
config = {
|
||||
header = header,
|
||||
center = {
|
||||
{
|
||||
icon = " ",
|
||||
desc = "Find File ",
|
||||
key = "f",
|
||||
action = function() require("fzf-lua").files() end,
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
desc = "Recent Files ",
|
||||
key = "r",
|
||||
action = function() require("fzf-lua").oldfiles() end,
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
desc = "Find Text ",
|
||||
key = "g",
|
||||
action = function() require("fzf-lua").live_grep() end,
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
desc = "File Explorer ",
|
||||
key = "e",
|
||||
action = function() vim.cmd("Neotree toggle") end,
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
desc = "Quit ",
|
||||
key = "q",
|
||||
action = function() vim.cmd("quit") end,
|
||||
},
|
||||
},
|
||||
footer = {},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Which-key for keybinding hints
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
win = {
|
||||
border = { "┏", "━", "┓", "┃", "┛", "━", "┗", "┃" },
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>?",
|
||||
function()
|
||||
require("which-key").show({ global = false })
|
||||
end,
|
||||
desc = "Buffer Local Keymaps (which-key)",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
-- Autocommands
|
||||
local api = vim.api
|
||||
local augroup = api.nvim_create_augroup("UserAutocmds", { clear = true })
|
||||
|
||||
-- Highlight on yank
|
||||
api.nvim_create_autocmd("TextYankPost", {
|
||||
group = augroup,
|
||||
callback = function()
|
||||
vim.highlight.on_yank({ higroup = "Visual", timeout = 200 })
|
||||
end,
|
||||
desc = "Highlight text on yank",
|
||||
})
|
||||
|
||||
-- Restore cursor position on file open
|
||||
api.nvim_create_autocmd("BufReadPost", {
|
||||
group = augroup,
|
||||
callback = function()
|
||||
local mark = api.nvim_buf_get_mark(0, '"')
|
||||
local line_count = api.nvim_buf_line_count(0)
|
||||
if mark[1] > 0 and mark[1] <= line_count then
|
||||
pcall(api.nvim_win_set_cursor, 0, mark)
|
||||
end
|
||||
end,
|
||||
desc = "Restore cursor position",
|
||||
})
|
||||
|
||||
-- Auto-resize splits on VimResized
|
||||
api.nvim_create_autocmd("VimResized", {
|
||||
group = augroup,
|
||||
callback = function()
|
||||
local current_tab = vim.fn.tabpagenr()
|
||||
vim.cmd("tabdo wincmd =")
|
||||
vim.cmd("tabnext " .. current_tab)
|
||||
end,
|
||||
desc = "Auto-resize splits",
|
||||
})
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
-- Keymaps using global map() helper
|
||||
|
||||
-- File operations
|
||||
map("n", "<leader>w", "<cmd>w<cr>", { desc = "Save file" })
|
||||
map("n", "<leader>q", "<cmd>q<cr>", { desc = "Quit" })
|
||||
|
||||
-- Buffer navigation
|
||||
map("n", "<Tab>", "<cmd>bnext<cr>", { desc = "Next buffer" })
|
||||
map("n", "<S-Tab>", "<cmd>bprev<cr>", { desc = "Previous buffer" })
|
||||
map("n", "<leader>x", "<cmd>bdelete<cr>", { desc = "Close buffer" })
|
||||
map("n", "<leader>b", "<cmd>enew<cr>", { desc = "New buffer" })
|
||||
|
||||
-- Window navigation
|
||||
map("n", "<C-h>", "<C-w>h", { desc = "Move to left window" })
|
||||
map("n", "<C-j>", "<C-w>j", { desc = "Move to lower window" })
|
||||
map("n", "<C-k>", "<C-w>k", { desc = "Move to upper window" })
|
||||
map("n", "<C-l>", "<C-w>l", { desc = "Move to right window" })
|
||||
|
||||
-- Better defaults
|
||||
map("n", "J", "mzJ`z", { desc = "Join lines keeping cursor position" })
|
||||
map("x", "x", '"_x', { desc = "Delete char without yanking" })
|
||||
map("x", "p", '"_dP', { desc = "Paste without yanking replaced text" })
|
||||
map("n", "<Esc>", "<cmd>nohlsearch<cr>", { desc = "Clear search highlight" })
|
||||
|
||||
-- Terminal
|
||||
map("t", "<Esc>", "<C-\\><C-n>", { desc = "Exit terminal mode" })
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
-- Vim options
|
||||
local o, opt = vim.o, vim.opt
|
||||
|
||||
-- Line numbers
|
||||
o.number = true
|
||||
o.relativenumber = true
|
||||
|
||||
-- Indentation
|
||||
o.tabstop = 2
|
||||
o.shiftwidth = 2
|
||||
o.expandtab = true
|
||||
o.smartindent = true
|
||||
o.breakindent = true
|
||||
|
||||
-- Search
|
||||
o.ignorecase = true
|
||||
o.smartcase = true
|
||||
o.hlsearch = false
|
||||
o.incsearch = true
|
||||
|
||||
-- UI
|
||||
o.termguicolors = true
|
||||
o.cursorline = true
|
||||
o.scrolloff = 8
|
||||
o.signcolumn = "yes"
|
||||
o.wrap = false
|
||||
o.showmode = false
|
||||
o.laststatus = 3
|
||||
o.cmdheight = 0
|
||||
|
||||
opt.fillchars = { vert = "│", fold = "─", foldsep = "│", diff = "─" }
|
||||
opt.shortmess:append("S")
|
||||
|
||||
-- Splits
|
||||
o.splitbelow = true
|
||||
o.splitright = true
|
||||
|
||||
-- Files
|
||||
o.swapfile = false
|
||||
o.backup = false
|
||||
o.undofile = true
|
||||
o.undodir = vim.fn.stdpath("data") .. "/undo"
|
||||
|
||||
-- Misc
|
||||
o.updatetime = 250
|
||||
o.mouse = "a"
|
||||
o.clipboard = "unnamedplus"
|
||||
Loading…
Add table
Add a link
Reference in a new issue