neovim conf part 9, the move to snacks, telescope u did well, farewell

This commit is contained in:
RafayAhmad7548 2025-05-13 08:14:17 +05:00
parent bbd1f9f7c1
commit 5d23e188ae
10 changed files with 162 additions and 105 deletions

View file

@ -3,7 +3,7 @@ return {
lazy = false,
---enables autocomplete for opts
---@module "auto-session"
---@module 'auto-session'
---@type AutoSession.Config
opts = {
suppressed_dirs = { '~/', '~/Downloads', '/' },

View file

@ -38,7 +38,7 @@ return {
},
},
{
"sindrets/diffview.nvim",
'sindrets/diffview.nvim',
config = function ()
local actions = require('diffview.config').actions
require('diffview').setup({
@ -57,10 +57,10 @@ return {
end
},
-- {
-- "NeogitOrg/neogit",
-- 'NeogitOrg/neogit',
-- dependencies = {
-- "nvim-lua/plenary.nvim",
-- "nvim-telescope/telescope.nvim",
-- 'nvim-lua/plenary.nvim',
-- 'nvim-telescope/telescope.nvim',
-- },
-- config = function()
-- require('neogit').setup({
@ -73,41 +73,41 @@ return {
-- kind = 'floating',
-- },
-- commit_select_view = {
-- kind = "floating",
-- 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
-- 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",
-- kind = 'floating',
-- },
-- rebase_editor = {
-- kind = "floating",
-- kind = 'floating',
-- },
-- reflog_view = {
-- kind = "floating",
-- kind = 'floating',
-- },
-- merge_editor = {
-- kind = "floating",
-- kind = 'floating',
-- },
-- description_editor = {
-- kind = "floating",
-- kind = 'floating',
-- },
-- tag_editor = {
-- kind = "floating",
-- kind = 'floating',
-- },
-- preview_buffer = {
-- kind = "floating",
-- kind = 'floating',
-- },
-- popup = {
-- kind = "floating",
-- kind = 'floating',
-- },
-- stash = {
-- kind = "floating",
-- kind = 'floating',
-- },
-- refs_view = {
-- kind = "floating",
-- kind = 'floating',
-- },
-- mappings = {
-- status = {

View file

@ -13,23 +13,23 @@ vim.opt.rtp:prepend(lazypath)
-- local keymaps = require('config.pluginmaps')
require('lazy').setup({
-- NOTE: General Editing --
-- INFO: General Editing --
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
{ 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = {} },
-- TODO: i dunno about this one
-- {
-- "folke/noice.nvim",
-- event = "VeryLazy",
-- 'folke/noice.nvim',
-- event = 'VeryLazy',
-- opts = {
-- },
-- dependencies = {
-- -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
-- "MunifTanjim/nui.nvim",
-- -- if you lazy-load any plugin below, make sure to add proper `module='...'` entries
-- 'MunifTanjim/nui.nvim',
-- -- OPTIONAL:
-- -- `nvim-notify` is only needed, if you want to use the notification view.
-- -- If not available, we use `mini` as the fallback
-- "rcarriga/nvim-notify",
-- 'rcarriga/nvim-notify',
-- }
-- },
@ -40,7 +40,7 @@ require('lazy').setup({
require('config.plugins.git'),
require('config.plugins.ui'),
require('config.plugins.telescope'),
-- require('config.plugins.telescope'),
require('config.plugins.blinkcmp'),
require('config.plugins.languages.lsp'),
require('config.plugins.languages.treesitter'),

View file

@ -5,19 +5,19 @@ return {
init = function()
local Snacks = require('snacks')
vim.api.nvim_create_autocmd("User", {
pattern = "SnacksInputRename",
vim.api.nvim_create_autocmd('User', {
pattern = 'SnacksInputRename',
callback = function ()
Snacks.config.input.win.relative = "cursor"
Snacks.config.input.win.relative = 'cursor'
Snacks.config.input.win.col = -1
Snacks.config.input.win.row = -3
Snacks.config.input.win.title_pos = 'left'
end
})
vim.api.nvim_create_autocmd("User", {
pattern = "SnacksInputReset",
vim.api.nvim_create_autocmd('User', {
pattern = 'SnacksInputReset',
callback = function ()
Snacks.config.input.win.relative = "editor"
Snacks.config.input.win.relative = 'editor'
Snacks.config.input.win.col = nil
Snacks.config.input.win.row = 6
Snacks.config.input.win.title_pos = 'center'
@ -60,6 +60,52 @@ return {
quickfile = { enabled = true },
rename = { enabled = true },
picker = {
enabled = true,
matcher = { frecency = true, },
layout = {
cycle = true,
preset = 'telescope',
},
ui_select = true,
win = {
input = {
keys = {
['<Esc>'] = { 'close', mode = 'i' },
['<C-s>'] = { 'edit_split', mode = 'i' },
['<C-v>'] = { 'edit_vsplit', mode = 'i' },
['<c-d>'] = { 'preview_scroll_down', mode = 'i' },
['<c-u>'] = { 'preview_scroll_up', mode = 'i' },
}
}
},
layouts = {
telescope = {
reverse = true,
layout = {
box = 'horizontal',
backdrop = false,
width = 0.8,
height = 0.9,
border = 'none',
{
box = 'vertical',
{ win = 'list', title = ' Results ', title_pos = 'center', border = 'rounded' },
{ win = 'input', height = 1, border = 'rounded', title = '{title} {live} {flags}', title_pos = 'center' },
},
{
win = 'preview',
title = '{preview:Preview}',
width = 0.55,
border = 'rounded',
title_pos = 'center',
},
}
}
}
},
bufdelete = { enabled = false },
debug = { enabled = false },
dim = { enabled = false },
@ -71,7 +117,6 @@ return {
lazygit = { enabled = false },
notifier = { enabled = false },
notify = { enabled = false },
picker = { enabled = false },
profiler = { enabled = false },
scope = { enabled = false },
scratch = { enabled = false },

View file

@ -36,33 +36,33 @@ return {
})
pcall(require('telescope').load_extension, 'fzf')
pcall(require("telescope").load_extension('ui-select'))
pcall(require('telescope').load_extension('ui-select'))
-- NOTE: Mappings --
-- INFO: Mappings --
local builtin = require('telescope.builtin')
-- local builtin = require('telescope.builtin')
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>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 {
winblend = 10,
previewer = false,
})
end, { desc = 'Fuzzily search in current buffer' })
-- 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>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 {
-- winblend = 10,
-- previewer = false,
-- })
-- end, { desc = 'Fuzzily search in current buffer' })
end
}

View file

@ -6,15 +6,15 @@ return {
},
{
'navarasu/onedark.nvim',
config = function ()
require('onedark').setup({
style = 'darker',
code_style = {
comments = 'none'
}
})
require('onedark').load()
'catppuccin/nvim',
name = 'catppuccin',
priority = 1000,
opts = {
flavour = 'mocha',
no_italic = true,
},
config = function()
vim.cmd('colorscheme catppuccin')
end
},
}
}