clean files

This commit is contained in:
RafayAhmad7548 2025-07-26 20:13:37 +05:00
parent dd8482a6fb
commit 30542228ee
82 changed files with 11285 additions and 0 deletions

View file

@ -0,0 +1,38 @@
return {
'rmagatti/auto-session',
lazy = false,
---enables autocomplete for opts
---@module 'auto-session'
---@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,
},
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

@ -0,0 +1,72 @@
return {
'saghen/blink.cmp',
event = 'VimEnter',
version = '1.*',
dependencies = {
{
'L3MON4D3/LuaSnip',
version = '2.*',
build = (function()
if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then
return
end
return 'make install_jsregexp'
end)(),
dependencies = {
-- `friendly-snippets` contains a variety of premade snippets.
-- See the README about individual language/framework/plugin snippets:
-- https://github.com/rafamadriz/friendly-snippets
-- {
-- 'rafamadriz/friendly-snippets',
-- config = function()
-- require('luasnip.loaders.from_vscode').lazy_load()
-- end,
-- },
},
opts = {},
},
'folke/lazydev.nvim',
},
---@module 'blink.cmp'
---@type blink.cmp.Config
opts = {
keymap = {
preset = 'default',
['<Tab>'] = { 'select_and_accept', 'snippet_forward', 'fallback'},
['<S-Tab>'] = { 'snippet_backward', 'fallback'},
['I'] = { 'scroll_documentation_up', 'fallback' },
['K'] = { 'scroll_documentation_down', 'fallback' },
},
appearance = { nerd_font_variant = 'mono' },
completion = {
-- By default, you may press `<c-space>` to show the documentation.
-- Optionally, set `auto_show = true` to show the documentation after a delay.
documentation = { auto_show = false, auto_show_delay_ms = 500 },
},
sources = {
default = { 'lsp', 'path', 'snippets', 'lazydev' },
providers = {
lazydev = { module = 'lazydev.integrations.blink', score_offset = 100 },
},
},
snippets = { preset = 'luasnip' },
-- Blink.cmp includes an optional, recommended rust fuzzy matcher,
-- which automatically downloads a prebuilt binary when enabled.
--
-- By default, we use the Lua implementation instead, but you may enable
-- the rust implementation via `'prefer_rust_with_warning'`
--
-- See :h blink-cmp-config-fuzzy for more information
fuzzy = { implementation = 'lua' },
-- Shows a signature help window while you type arguments for a function
signature = { enabled = true },
},
}

View file

@ -0,0 +1,154 @@
return {
{
'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
},
},
{
'sindrets/diffview.nvim',
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
}
}
})
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

@ -0,0 +1,29 @@
return {
'ThePrimeagen/harpoon',
branch = 'harpoon2',
dependencies = { 'nvim-lua/plenary.nvim' },
config = function()
local harpoon = require('harpoon')
harpoon:setup({
settings = {
save_on_toggle = true,
sync_on_ui_close = true
}
})
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', '<C-l>', function() harpoon:list():select(1) end)
vim.keymap.set('n', '<C-j>', function() harpoon:list():select(2) end)
vim.keymap.set('n', '<Down>', function() harpoon:list():select(3) end)
vim.keymap.set('n', '<Up>', 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)
-- vim.keymap.set('n', '<C-S-N>', function() harpoon:list():next() end)
end
}

View file

@ -0,0 +1,40 @@
-- [[ Install `lazy.nvim` plugin manager ]]
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
if vim.v.shell_error ~= 0 then
error('Error cloning lazy.nvim:\n' .. out)
end
end ---@diagnostic disable-next-line: undefined-field
vim.opt.rtp:prepend(lazypath)
-- local keymaps = require('config.pluginmaps')
require('lazy').setup({
-- INFO: General Editing --
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
{ 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = {} },
-- { 'stevearc/dressing.nvim', opts = {}, },
-- 'ThePrimeagen/vim-be-good',
-- { 'vuciv/golf' },
require('config.plugins.git'),
require('config.plugins.ui'),
-- require('config.plugins.telescope'),
require('config.plugins.blinkcmp'),
require('config.plugins.languages.lsp'),
require('config.plugins.languages.treesitter'),
require('config.plugins.harpoon'),
require('config.plugins.autosession'),
require('config.plugins.snacks'),
require('config.plugins.mini'),
require('config.plugins.languages.molten'),
require('config.plugins.languages.flutter'),
require('config.plugins.languages.markdown'),
})

View file

@ -0,0 +1,13 @@
return {
'nvim-flutter/flutter-tools.nvim',
lazy = false,
dependencies = { 'nvim-lua/plenary.nvim', },
config = function()
require('flutter-tools').setup({
fvm = true,
dev_log = {
open_cmd = 'FloutterLog',
}
})
end,
}

View file

@ -0,0 +1,124 @@
return {
{
-- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
-- used for completion, annotations and signatures of Neovim apis
'folke/lazydev.nvim',
ft = 'lua',
opts = {
library = {
-- Load luvit types when the `vim.uv` word is found
{ path = '${3rd}/luv/library', words = { 'vim%.uv' } },
},
},
},
{ 'williamboman/mason.nvim', opts = {} },
{
'neovim/nvim-lspconfig',
dependencies = {
'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim',
-- Useful status updates for LSP.
{ 'j-hui/fidget.nvim', opts = {} },
'saghen/blink.cmp',
},
config = function()
vim.diagnostic.config {
severity_sort = true,
float = { border = 'rounded', source = 'if_many' },
underline = { severity = vim.diagnostic.severity.ERROR },
signs = vim.g.have_nerd_font and {
text = {
[vim.diagnostic.severity.ERROR] = '󰅚 ',
[vim.diagnostic.severity.WARN] = '󰀪 ',
[vim.diagnostic.severity.INFO] = '󰋽 ',
},
} or {},
virtual_text = {
source = 'if_many',
spacing = 2,
format = function(diagnostic)
local diagnostic_message = {
[vim.diagnostic.severity.ERROR] = diagnostic.message,
[vim.diagnostic.severity.WARN] = diagnostic.message,
[vim.diagnostic.severity.INFO] = diagnostic.message,
[vim.diagnostic.severity.HINT] = diagnostic.message,
}
return diagnostic_message[diagnostic.severity]
end,
},
}
local capabilities = require('blink.cmp').get_lsp_capabilities()
local servers = {
bashls = {},
clangd = {},
rust_analyzer = {},
pyright = {},
emmet_language_server = {},
html = { filetypes = { 'html', 'htmldjango' }, },
cssls = {},
vtsls = {},
prismals = {},
-- kotlin_lsp = {},
-- kotlin_language_server = {
-- init_options = {
-- storagePath = vim.fn.stdpath('cache') .. '/kotlin_language_server', -- Explicit storage path
-- },
-- },
-- -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
--
-- Some languages (like typescript) have entire language plugins that can be useful:
-- https://github.com/pmizio/typescript-tools.nvim
--
-- But for many setups, the LSP (`ts_ls`) will work just fine
-- ts_ls = {},
--
lua_ls = {
-- cmd = { ... },
-- filetypes = { ... },
-- capabilities = {},
settings = {
Lua = {
completion = {
callSnippet = 'Replace',
},
-- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
-- diagnostics = { disable = { 'missing-fields' } },
},
},
},
}
local ensure_installed = vim.tbl_keys(servers or {})
require('mason-lspconfig').setup {
ensure_installed = ensure_installed,
automatic_installation = false,
handlers = {
function(server_name)
local server = servers[server_name] or {}
-- This handles overriding only values explicitly passed
-- by the server configuration above. Useful when disabling
-- certain features of an LSP (for example, turning off formatting for ts_ls)
server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
require('lspconfig')[server_name].setup(server)
end,
}
}
-- WARN: Temoraray workaround because of naming issue i.e. djlsp and django-template-server
require('lspconfig').djlsp.setup({})
end
},
}

View file

@ -0,0 +1,9 @@
return {
"OXY2DEV/markview.nvim",
lazy = false,
opts = {
experimental = {
check_rtp_message = false
}
}
}

View file

@ -0,0 +1,27 @@
return {
{
'3rd/image.nvim',
version = '1.1.0',
build = false, -- so that it doesn't build the rock https://github.com/3rd/image.nvim/issues/91#issuecomment-2453430239
opts = {
backend = 'kitty', -- whatever backend you would like to use
max_width = 100,
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
window_overlap_clear_ft_ignore = { 'cmp_menu', 'cmp_docs', '' },
}
},
{
'benlubas/molten-nvim',
version = '^1.0.0', -- use version <2.0.0 to avoid breaking changes
dependencies = { '3rd/image.nvim' },
build = ':UpdateRemotePlugins',
init = function()
-- these are examples, not defaults. Please see the readme
vim.g.molten_image_provider = 'image.nvim'
end,
}
}

View file

@ -0,0 +1,42 @@
return {
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
opts = {
ensure_installed = {
'bash',
'c',
'cpp',
'diff',
'html',
'css',
'lua',
'luadoc',
'markdown',
'markdown_inline',
'query',
'vim',
'vimdoc',
'rust',
'python',
'htmldjango',
'r',
'dart',
'javascript',
'typescript',
'tsx',
'prisma',
'regex',
'kotlin'
},
auto_install = false,
highlight = { enable = true, },
indent = { enable = true },
},
-- There are additional nvim-treesitter modules that you can use to interact
-- with nvim-treesitter. You should go explore a few and see what interests you:
--
-- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod`
-- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
}

View file

@ -0,0 +1,34 @@
return {
'echasnovski/mini.nvim',
version = '*' ,
config = function()
require('mini.pairs').setup({})
require('mini.ai').setup({
mappings = {
around = 'a',
inside = 'h',
around_next = 'an',
inside_next = 'hn',
around_last = 'al',
inside_last = 'hl',
goto_left = 'g[',
goto_right = 'g]',
},
silent = true,
})
require('mini.surround').setup({
silent = true,
})
require('mini.files').setup({
mappings = {
go_in = 'l',
go_out = 'j',
go_in_plus = 'L',
go_out_plus = 'J',
synchronize = '<C-s>'
}
})
end
}

View file

@ -0,0 +1,135 @@
return {
'folke/snacks.nvim',
priority = 1000,
lazy = false,
init = function()
local Snacks = require('snacks')
vim.api.nvim_create_autocmd('User', {
pattern = 'SnacksInputRename',
callback = function ()
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',
callback = function ()
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'
end
})
end,
---@type snacks.Config
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
bigfile = { enabled = true },
dashboard = {
enabled = true,
preset = {
header = [[
]],
},
sections = {
{ section = 'header' },
{ section = 'startup' },
}
},
indent = {
enabled = true,
animate = { enabled = false },
},
input = {
enabled = true,
win = {},
},
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' },
['<c-h>'] = { 'toggle_hidden', mode = 'i' },
['<c-l>'] = { 'toggle_ignored', 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 },
explorer = { enabled = false },
git = { enabled = false },
gitbrowse = { enabled = false },
image = { enabled = false },
layout = { enabled = false },
lazygit = { enabled = false },
notifier = { enabled = false },
notify = { enabled = false },
profiler = { enabled = false },
scope = { enabled = false },
scratch = { enabled = false },
scroll = { enabled = false },
statuscolumn = { enabled = false },
terminal = { enabled = false },
toggle = { enabled = false },
win = { enabled = false },
words = { enabled = false },
zed = { enabled = false },
},
}

View file

@ -0,0 +1,20 @@
return {
{
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
opts = {}
},
{
'catppuccin/nvim',
name = 'catppuccin',
priority = 1000,
opts = {
flavour = 'mocha',
no_italic = true,
},
config = function()
vim.cmd('colorscheme catppuccin')
end
}
}