neovim conf part 5

This commit is contained in:
RafayAhmad7548 2025-05-02 19:52:18 +05:00
parent d6c19e2e92
commit d8c82c966b
4 changed files with 124 additions and 22 deletions

View file

@ -7,6 +7,21 @@ return {
---@type AutoSession.Config
opts = {
suppressed_dirs = { '~/', '~/Downloads', '/' },
pre_restore_cmds = {
-- might not be necessary, but save current harpoon data when we're about to restore a session
function() require('harpoon'):sync() end,
},
post_restore_cmds = {
function()
-- vim.notify('calling harpoon sync after restore')
local harpoon = require('harpoon')
local hdata = require('harpoon.data')
-- this is the only way i found to force harpoon to reread data from the disk rather
-- than using what's in memory
require('harpoon').data = hdata.Data:new(harpoon.config)
end,
},
}
}

View file

@ -1,23 +1,107 @@
return {
'lewis6991/gitsigns.nvim',
opts = {
signs = {
add = { text = '' },
change = { text = '' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
untracked = { text = '' },
{
'lewis6991/gitsigns.nvim',
opts = {
signs = {
add = { text = '' },
change = { text = '' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
untracked = { text = '' },
},
signs_staged = {
add = { text = '' },
change = { text = '' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
untracked = { text = '' },
},
signs_staged_enable = true,
signcolumn = true,
on_attach = function()
local gitsigns = require('gitsigns')
vim.keymap.set('n', '<leader>gs', gitsigns.stage_hunk, { desc = 'stage hunk' })
vim.keymap.set('n', '<leader>gr', gitsigns.reset_hunk, { desc = 'restore hunk' })
vim.keymap.set('n', '<leader>gS', gitsigns.stage_buffer, { desc = 'stage buffer' })
vim.keymap.set('n', '<leader>gR', gitsigns.stage_hunk, { desc = 'reset buffer' })
vim.keymap.set('n', '<leader>gp', gitsigns.preview_hunk, { desc = 'preview hunk' })
vim.keymap.set('n', '<leader>gb', gitsigns.blame_line, { desc = 'blame line' })
end
},
-- signs_staged = {
-- add = { text = '┃' },
-- change = { text = '┃' },
-- delete = { text = '_' },
-- topdelete = { text = '‾' },
-- changedelete = { text = '~' },
-- untracked = { text = '┆' },
-- },
signs_staged_enable = false,
signcolumn = true
},
{
"sindrets/diffview.nvim",
},
{
"NeogitOrg/neogit",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
},
config = function()
require('neogit').setup({
kind = 'floating',
graph_style = 'kitty',
disable_line_numbers = false,
disable_relative_line_numbers = false,
commit_editor = {
kind = 'floating',
},
commit_select_view = {
kind = "floating",
},
commit_view = {
kind = "floating",
verify_commit = vim.fn.executable("gpg") == 1, -- Can be set to true or false, otherwise we try to find the binary
},
log_view = {
kind = "floating",
},
rebase_editor = {
kind = "floating",
},
reflog_view = {
kind = "floating",
},
merge_editor = {
kind = "floating",
},
description_editor = {
kind = "floating",
},
tag_editor = {
kind = "floating",
},
preview_buffer = {
kind = "floating",
},
popup = {
kind = "floating",
},
stash = {
kind = "floating",
},
refs_view = {
kind = "floating",
},
mappings = {
status = {
['i'] = 'MoveUp',
['k'] = 'MoveDown',
['j'] = false,
},
}
})
vim.keymap.set('n', '<leader>gg', '<cmd>Neogit<CR>', { desc = 'open neogit '})
end
}
}

View file

@ -43,8 +43,8 @@ require('lazy').setup({
require('config.plugins.blinkcmp'),
require('config.plugins.lsp'),
require('config.plugins.treesitter'),
require('config.plugins.autosession'),
require('config.plugins.harpoon'),
require('config.plugins.autosession'),
require('config.plugins.molten'),

View file

@ -36,9 +36,12 @@ return {
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>sf', builtin.find_files, { desc = 'Telescope find files' })
vim.keymap.set('n', '<leader>sf', builtin.find_files, { desc = 'find files' })
vim.keymap.set('n', '<leader>sw', builtin.grep_string, { desc = 'grep string' })
vim.keymap.set('n', '<leader>ss', builtin.lsp_document_symbols, { desc = 'document symbols' })
vim.keymap.set('n', '<leader>sS', builtin.lsp_workspace_symbols, { desc = 'workspace symbols' })
vim.keymap.set('n', '<leader>sp', '<cmd>SessionSearch<CR>', { desc = 'Search Sessions' })
vim.keymap.set('n', '<leader>sp', '<cmd>SessionSearch<CR>', { desc = 'search sessions' })
vim.keymap.set('n', '<leader>/', function()
-- You can pass additional configuration to Telescope to change the theme, layout, etc.