mirror of
https://github.com/harivansh-afk/nvim.git
synced 2026-04-15 14:03:51 +00:00
clean
This commit is contained in:
parent
ecfa272a40
commit
77c3b62a35
9 changed files with 48 additions and 95 deletions
|
|
@ -52,24 +52,27 @@ return {
|
|||
},
|
||||
},
|
||||
|
||||
-- Supermaven AI completion
|
||||
-- Supermaven inline suggestions (accepted with Tab)
|
||||
{
|
||||
"supermaven-inc/supermaven-nvim",
|
||||
event = "InsertEnter",
|
||||
config = function(_, opts)
|
||||
require("supermaven-nvim").setup(opts)
|
||||
end,
|
||||
opts = {
|
||||
keymaps = {
|
||||
accept_suggestion = "<Tab>",
|
||||
clear_suggestion = "<C-]>",
|
||||
accept_word = "<C-j>",
|
||||
},
|
||||
ignore_filetypes = { "gitcommit", "TelescopePrompt" },
|
||||
disable_keymaps = false,
|
||||
ignore_filetypes = { gitcommit = true },
|
||||
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,3 +1,37 @@
|
|||
local function current_file_location()
|
||||
local root = vim.trim(vim.fn.system("git rev-parse --show-toplevel"))
|
||||
if vim.v.shell_error ~= 0 or root == "" then
|
||||
return nil
|
||||
end
|
||||
|
||||
local path = vim.api.nvim_buf_get_name(0)
|
||||
if path == "" then
|
||||
return nil
|
||||
end
|
||||
|
||||
local prefix = root .. "/"
|
||||
if path:sub(1, #prefix) ~= prefix then
|
||||
return nil
|
||||
end
|
||||
|
||||
local rel = path:sub(#prefix + 1)
|
||||
return ("%s:%d"):format(rel, vim.fn.line("."))
|
||||
end
|
||||
|
||||
local function gh_browse()
|
||||
if vim.fn.executable("gh") ~= 1 then
|
||||
vim.notify("gh CLI not found", vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
|
||||
local loc = current_file_location()
|
||||
if loc then
|
||||
vim.system({ "gh", "browse", loc })
|
||||
return
|
||||
end
|
||||
vim.system({ "gh", "browse" })
|
||||
end
|
||||
|
||||
return {
|
||||
-- Fugitive: The gold standard for Git in Vim
|
||||
{
|
||||
|
|
@ -12,6 +46,7 @@ return {
|
|||
{ "<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" },
|
||||
{ "<leader>go", gh_browse, desc = "Open in GitHub" },
|
||||
},
|
||||
},
|
||||
|
||||
|
|
@ -54,18 +89,6 @@ return {
|
|||
},
|
||||
},
|
||||
|
||||
-- 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",
|
||||
|
|
|
|||
|
|
@ -1,24 +1,3 @@
|
|||
return {
|
||||
{ "neovim/nvim-lspconfig", lazy = false },
|
||||
|
||||
-- Autocompletion
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
dependencies = { "rafamadriz/friendly-snippets" },
|
||||
version = "1.*",
|
||||
event = "InsertEnter",
|
||||
|
||||
---@module 'blink.cmp'
|
||||
---@type blink.cmp.Config
|
||||
opts = {
|
||||
keymap = { preset = "default" },
|
||||
appearance = { nerd_font_variant = "mono" },
|
||||
completion = { documentation = { auto_show = true } },
|
||||
sources = {
|
||||
default = { "lsp", "path", "snippets", "buffer" },
|
||||
},
|
||||
fuzzy = { implementation = "prefer_rust_with_warning" },
|
||||
},
|
||||
opts_extend = { "sources.default" },
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
return {
|
||||
"stevearc/oil.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons", "malewicz1337/oil-git.nvim" },
|
||||
cmd = "Oil",
|
||||
event = 'VeryLazy',
|
||||
keys = {
|
||||
{ "-", "<cmd>Oil<cr>", desc = "Open parent directory" },
|
||||
{ "<leader>e", "<cmd>Oil<cr>", desc = "Open file explorer" },
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("oil").setup(opts)
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
}
|
||||
|
|
@ -32,6 +32,7 @@ return {
|
|||
transparent_mode = true,
|
||||
})
|
||||
vim.cmd.colorscheme("gruvbox")
|
||||
|
||||
end,
|
||||
},
|
||||
|
||||
|
|
@ -120,7 +121,7 @@ return {
|
|||
icon = " ",
|
||||
desc = "File Explorer ",
|
||||
key = "e",
|
||||
action = function() vim.cmd("Neotree toggle") end,
|
||||
action = function() vim.cmd("Oil") end,
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue