neovim part 6

This commit is contained in:
RafayAhmad7548 2025-05-05 22:56:56 +05:00
parent d8c82c966b
commit 97482df1a5
14 changed files with 258 additions and 194 deletions

View file

@ -7,6 +7,16 @@ return {
---@type AutoSession.Config
opts = {
suppressed_dirs = { '~/', '~/Downloads', '/' },
pre_save_cmds = {
function()
local bufs = vim.api.nvim_list_bufs()
for _, buf in ipairs(bufs) do
if vim.bo[buf].buftype == 'terminal' then
vim.api.nvim_buf_delete(buf, { force = true, unload = false })
end
end
end
},
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,

View file

@ -39,69 +39,116 @@ return {
},
{
"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',
config = function ()
local actions = require('diffview.config').actions
require('diffview').setup({
keymaps = {
disable_defaults = true,
file_panel = {
['i'] = '<Up>',
['k'] = '<Down>',
['j'] = false,
},
['<Space>'] = function () actions.toggle_stage_entry() end
}
}
})
vim.keymap.set('n', '<leader>gg', '<cmd>Neogit<CR>', { desc = 'open neogit '})
end
}
},
-- {
-- "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
-- }
-- {
-- 'tpope/vim-fugitive',
-- }
-- {
-- 'sindrets/diffview.nvim',
-- dependencies = { 'nvim-tree/nvim-web-devicons' },
-- -- lazy, only load diffview by these commands
-- cmd = {
-- 'DiffviewFileHistory', 'DiffviewOpen', 'DiffviewToggleFiles', 'DiffviewFocusFiles', 'DiffviewRefresh'
-- }
-- },
-- {
-- 'SuperBo/fugit2.nvim',
-- build = false,
-- opts = {
-- width = 100,
-- },
-- dependencies = {
-- 'MunifTanjim/nui.nvim',
-- 'nvim-tree/nvim-web-devicons',
-- 'nvim-lua/plenary.nvim',
-- -- {
-- -- 'chrisgrieser/nvim-tinygit', -- optional: for Github PR view
-- -- dependencies = { 'stevearc/dressing.nvim' }
-- -- },
-- },
-- cmd = { 'Fugit2', 'Fugit2Diff', 'Fugit2Graph' },
-- keys = {
-- { '<leader>F', mode = 'n', '<cmd>Fugit2<cr>' }
-- }
-- },
}

View file

@ -16,10 +16,10 @@ return {
vim.keymap.set('n', '<leader>a', function() harpoon:list():add() end)
vim.keymap.set('n', '<C-h>', function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
vim.keymap.set('n', '<A-1>', function() harpoon:list():select(1) end)
vim.keymap.set('n', '<A-2>', function() harpoon:list():select(2) end)
vim.keymap.set('n', '<A-3>', function() harpoon:list():select(3) end)
vim.keymap.set('n', '<A-q>', function() harpoon:list():select(4) end)
vim.keymap.set('n', '<C-l>', function() harpoon:list():select(1) end)
vim.keymap.set('n', '<C-j>', function() harpoon:list():select(2) end)
vim.keymap.set('n', '<C-f>', function() harpoon:list():select(3) end)
vim.keymap.set('n', '<C-g>', function() harpoon:list():select(4) end)
-- -- Toggle previous & next buffers stored within Harpoon list
-- vim.keymap.set('n', '<C-S-P>', function() harpoon:list():prev() end)

View file

@ -41,12 +41,13 @@ require('lazy').setup({
require('config.plugins.ui'),
require('config.plugins.telescope'),
require('config.plugins.blinkcmp'),
require('config.plugins.lsp'),
require('config.plugins.treesitter'),
require('config.plugins.languages.lsp'),
require('config.plugins.languages.treesitter'),
require('config.plugins.harpoon'),
require('config.plugins.autosession'),
require('config.plugins.molten'),
require('config.plugins.languages.molten'),
require('config.plugins.languages.flutter'),
-- NOTE: maybe revisit this later

View file

@ -0,0 +1,11 @@
return {
'nvim-flutter/flutter-tools.nvim',
lazy = false,
dependencies = {
'nvim-lua/plenary.nvim',
'stevearc/dressing.nvim', -- optional for vim.ui.select
},
config = function()
require('flutter-tools').setup({})
end,
}

View file

@ -6,7 +6,7 @@ return {
opts = {
backend = 'kitty', -- whatever backend you would like to use
max_width = 100,
max_height = 12,
max_height = 20,
max_height_window_percentage = math.huge,
max_width_window_percentage = math.huge,
window_overlap_clear_enabled = true, -- toggles images when windows are overlapped
@ -22,7 +22,6 @@ return {
init = function()
-- these are examples, not defaults. Please see the readme
vim.g.molten_image_provider = 'image.nvim'
vim.g.molten_output_win_max_height = 20
end,
}
}

View file

@ -3,7 +3,7 @@ return {
build = ':TSUpdate',
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
opts = {
ensure_installed = { 'bash', 'c', 'diff', 'html', 'css', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc', 'rust', 'python', 'htmldjango', 'r' },
ensure_installed = { 'bash', 'c', 'diff', 'html', 'css', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc', 'rust', 'python', 'htmldjango', 'r', 'dart' },
auto_install = false,
highlight = {
enable = true,

View file

@ -41,8 +41,15 @@ return {
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>st', '<cmd>TodoTelescope<CR>', { desc = 'search todos' })
vim.keymap.set('n', '<leader>sp', '<cmd>SessionSearch<CR>', { desc = 'search sessions' })
vim.keymap.set('n', '<leader>sh', function ()
builtin.help_tags({
previewer = false
})
end, { desc = 'help' })
vim.keymap.set('n', '<leader>/', function()
-- You can pass additional configuration to Telescope to change the theme, layout, etc.
builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {