mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 16:41:43 +05:30
NVIM
- Plugin file names changed - Plugins reorged into files more logically
This commit is contained in:
@@ -74,15 +74,15 @@ return {
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
keys = {
|
||||
{
|
||||
"<tab>",
|
||||
function()
|
||||
return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or "<tab>"
|
||||
end,
|
||||
expr = true,
|
||||
silent = true,
|
||||
mode = "i",
|
||||
},
|
||||
-- {
|
||||
-- "<tab>",
|
||||
-- function()
|
||||
-- return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or "<tab>"
|
||||
-- end,
|
||||
-- expr = true,
|
||||
-- silent = true,
|
||||
-- mode = "i",
|
||||
-- },
|
||||
{
|
||||
"<tab>",
|
||||
function()
|
||||
@@ -1,4 +1,6 @@
|
||||
return {
|
||||
{ "tpope/vim-repeat" },
|
||||
|
||||
-- Better surround than tpope/vim-surround
|
||||
{
|
||||
"kylechui/nvim-surround",
|
||||
@@ -28,6 +30,54 @@ return {
|
||||
opts = {},
|
||||
},
|
||||
|
||||
-- indent guides for Neovim
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
opts = {
|
||||
indent = { char = "│", tab_char = "│" },
|
||||
scope = { enabled = false },
|
||||
exclude = {
|
||||
filetypes = {
|
||||
"help",
|
||||
"alpha",
|
||||
"dashboard",
|
||||
"neo-tree",
|
||||
"Trouble",
|
||||
"trouble",
|
||||
"lazy",
|
||||
"mason",
|
||||
"notify",
|
||||
"toggleterm",
|
||||
"lazyterm",
|
||||
},
|
||||
},
|
||||
},
|
||||
main = "ibl",
|
||||
},
|
||||
|
||||
-- Highlights the current level of indentation, and animates the highlighting.
|
||||
{
|
||||
"echasnovski/mini.indentscope",
|
||||
opts = { symbol = "│", options = { try_as_border = true } },
|
||||
init = function()
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = {
|
||||
"help",
|
||||
"neo-tree",
|
||||
"Trouble",
|
||||
"trouble",
|
||||
"lazy",
|
||||
"mason",
|
||||
"notify",
|
||||
"toggleterm",
|
||||
},
|
||||
callback = function()
|
||||
vim.b.miniindentscope_disable = true
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Finds and lists all of the TODO, HACK, BUG, etc comment
|
||||
{
|
||||
"folke/todo-comments.nvim",
|
||||
@@ -1,10 +1,9 @@
|
||||
return {
|
||||
|
||||
{ "tpope/vim-fugitive" },
|
||||
--{ "tpope/vim-rhubarb" }, --If fugitive.vim is the Git, rhubarb.vim is the Hub.
|
||||
|
||||
-- Adds git related signs to the gutter, as well as utilities for managing changes
|
||||
{
|
||||
-- Adds git related signs to the gutter, as well as utilities for managing changes
|
||||
"lewis6991/gitsigns.nvim",
|
||||
opts = {
|
||||
-- See `:help gitsigns.txt`
|
||||
@@ -1,10 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"projekt0n/github-nvim-theme",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
vim.cmd("colorscheme github_dark_dimmed")
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -1,4 +1,47 @@
|
||||
return {
|
||||
{ "easymotion/vim-easymotion" },
|
||||
{ "unblevable/quick-scope" },
|
||||
|
||||
-- Automatically highlights other instances of the word under cursor
|
||||
{
|
||||
"RRethy/vim-illuminate",
|
||||
lazy = false,
|
||||
opts = {
|
||||
delay = 200,
|
||||
large_file_cutoff = 2000,
|
||||
large_file_override = {
|
||||
providers = { "lsp" },
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
-- Copied from LazyNvim
|
||||
require("illuminate").configure(opts)
|
||||
|
||||
local function map(key, dir, buffer)
|
||||
vim.keymap.set("n", key, function()
|
||||
require("illuminate")["goto_" .. dir .. "_reference"](false)
|
||||
end, { desc = dir:sub(1, 1):upper() .. dir:sub(2) .. " Reference", buffer = buffer })
|
||||
end
|
||||
|
||||
map("]]", "next")
|
||||
map("[[", "prev")
|
||||
|
||||
-- also set it after loading ftplugins, since a lot overwrite [[ and ]]
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
callback = function()
|
||||
local buffer = vim.api.nvim_get_current_buf()
|
||||
map("]]", "next", buffer)
|
||||
map("[[", "prev", buffer)
|
||||
end,
|
||||
})
|
||||
end,
|
||||
keys = {
|
||||
{ "]]", desc = "Next Reference" },
|
||||
{ "[[", desc = "Prev Reference" },
|
||||
},
|
||||
},
|
||||
|
||||
-- Treesitter
|
||||
{
|
||||
-- nvim-treesitter provides parsers for individual languages
|
||||
-- Output of these parses are fed to the NVIM's native treesitter(vim.treesitter)
|
||||
@@ -29,8 +72,7 @@ return {
|
||||
if name:find("goto") == 1 then
|
||||
move[name] = function(q, ...)
|
||||
if vim.wo.diff then
|
||||
local config = configs.get_module("textobjects.move")
|
||||
[name] ---@type table<string,string>
|
||||
local config = configs.get_module("textobjects.move")[name] ---@type table<string,string>
|
||||
for key, query in pairs(config or {}) do
|
||||
if q == query and key:find("[%]%[][cC]") then
|
||||
vim.cmd("normal! " .. key)
|
||||
@@ -1,4 +1,96 @@
|
||||
return {
|
||||
-- File Explorer
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
keys = {
|
||||
{ "<leader>e", ":Neotree filesystem toggle<CR>", desc = "Open NeoTree [E]plorer at Git root", remap = true },
|
||||
|
||||
{
|
||||
"<leader>be",
|
||||
function()
|
||||
require("neo-tree.command").execute({ source = "buffers", toggle = true })
|
||||
end,
|
||||
desc = "NeoTree: Open [B]buffer [E]xplorer",
|
||||
},
|
||||
},
|
||||
deactivate = function()
|
||||
vim.cmd([[Neotree close]])
|
||||
end,
|
||||
init = function()
|
||||
if vim.fn.argc(-1) == 1 then
|
||||
local stat = vim.loop.fs_stat(vim.fn.argv(0))
|
||||
if stat and stat.type == "directory" then
|
||||
require("neo-tree")
|
||||
end
|
||||
end
|
||||
end,
|
||||
opts = {
|
||||
enable_git_status = true,
|
||||
filesystem = {
|
||||
bind_to_cwd = true,
|
||||
follow_current_file = {
|
||||
enabled = true, -- Highlight the current buffer
|
||||
leave_dirs_open = false,
|
||||
},
|
||||
use_libuv_file_watcher = true, -- Sync file system changes
|
||||
filtered_items = {
|
||||
visible = true,
|
||||
show_hidden_count = true,
|
||||
hide_dotfile = false,
|
||||
hide_gitignore = false,
|
||||
},
|
||||
},
|
||||
window = {
|
||||
position = "left",
|
||||
width = 30, -- Saner window size
|
||||
mappings = {
|
||||
["s"] = "open_split", -- horizontal split
|
||||
["v"] = "open_vsplit", -- vertical split
|
||||
["Y"] = function(state) -- Copy file's path to + register
|
||||
local node = state.tree:get_node()
|
||||
local path = node:get_id()
|
||||
vim.fn.setreg("+", path, "c")
|
||||
end,
|
||||
},
|
||||
},
|
||||
default_component_configs = {
|
||||
indent = {
|
||||
indent_size = 2, -- Compact tree display
|
||||
with_expanders = true, -- if nil and file nesting is enabled, will enable expanders
|
||||
expander_collapsed = "",
|
||||
expander_expanded = "",
|
||||
expander_highlight = "NeoTreeExpander",
|
||||
},
|
||||
},
|
||||
sources = { "filesystem", "buffers", "git_status", "document_symbols" },
|
||||
open_files_do_not_replace_types = { "terminal", "Trouble", "trouble", "qf", "Outline" },
|
||||
},
|
||||
config = function(_, opts)
|
||||
local config = require("config.util")
|
||||
|
||||
local function on_move(data)
|
||||
config.on_rename(data.source, data.destination)
|
||||
end
|
||||
|
||||
local events = require("neo-tree.events")
|
||||
opts.event_handlers = opts.event_handlers or {}
|
||||
vim.list_extend(opts.event_handlers, {
|
||||
{ event = events.FILE_MOVED, handler = on_move },
|
||||
{ event = events.FILE_RENAMED, handler = on_move },
|
||||
})
|
||||
require("neo-tree").setup(opts)
|
||||
vim.api.nvim_create_autocmd("TermClose", {
|
||||
pattern = "*lazygit",
|
||||
callback = function()
|
||||
if package.loaded["neo-tree.sources.git_status"] then
|
||||
require("neo-tree.sources.git_status").refresh()
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Fuzzy Finder (files, lsp, etc)
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
@@ -1,203 +1,23 @@
|
||||
return {
|
||||
-- icons
|
||||
{ "nvim-tree/nvim-web-devicons" },
|
||||
|
||||
-- ui components
|
||||
{ "MunifTanjim/nui.nvim" },
|
||||
|
||||
-- Better vim.ui
|
||||
{ "stevearc/dressing.nvim" },
|
||||
|
||||
{ "tpope/vim-repeat" },
|
||||
{ "easymotion/vim-easymotion" },
|
||||
{ "machakann/vim-highlightedyank" },
|
||||
{ "unblevable/quick-scope" },
|
||||
|
||||
-- Changes the Nvim root to git root
|
||||
-- colorscheme
|
||||
{
|
||||
"airblade/vim-rooter",
|
||||
config = function()
|
||||
vim.g.rooter_cd_cmd = "tcd" -- Use tcd command to change the root
|
||||
end,
|
||||
},
|
||||
|
||||
-- indent guides for Neovim
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
opts = {
|
||||
indent = { char = "│", tab_char = "│" },
|
||||
scope = { enabled = false },
|
||||
exclude = {
|
||||
filetypes = {
|
||||
"help",
|
||||
"alpha",
|
||||
"dashboard",
|
||||
"neo-tree",
|
||||
"Trouble",
|
||||
"trouble",
|
||||
"lazy",
|
||||
"mason",
|
||||
"notify",
|
||||
"toggleterm",
|
||||
"lazyterm",
|
||||
},
|
||||
},
|
||||
},
|
||||
main = "ibl",
|
||||
},
|
||||
|
||||
-- Highlights the current level of indentation, and animates the highlighting.
|
||||
{
|
||||
"echasnovski/mini.indentscope",
|
||||
opts = { symbol = "│", options = { try_as_border = true } },
|
||||
init = function()
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = {
|
||||
"help",
|
||||
"neo-tree",
|
||||
"Trouble",
|
||||
"trouble",
|
||||
"lazy",
|
||||
"mason",
|
||||
"notify",
|
||||
"toggleterm",
|
||||
},
|
||||
callback = function()
|
||||
vim.b.miniindentscope_disable = true
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- File Explorer
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
keys = {
|
||||
{ "<leader>e", ":Neotree filesystem toggle<CR>", desc = "Open NeoTree [E]plorer at Git root", remap = true },
|
||||
|
||||
{
|
||||
"<leader>be",
|
||||
function()
|
||||
require("neo-tree.command").execute({ source = "buffers", toggle = true })
|
||||
end,
|
||||
desc = "NeoTree: Open [B]buffer [E]xplorer",
|
||||
},
|
||||
},
|
||||
deactivate = function()
|
||||
vim.cmd([[Neotree close]])
|
||||
end,
|
||||
init = function()
|
||||
if vim.fn.argc(-1) == 1 then
|
||||
local stat = vim.loop.fs_stat(vim.fn.argv(0))
|
||||
if stat and stat.type == "directory" then
|
||||
require("neo-tree")
|
||||
end
|
||||
end
|
||||
end,
|
||||
opts = {
|
||||
enable_git_status = true,
|
||||
filesystem = {
|
||||
bind_to_cwd = true,
|
||||
follow_current_file = {
|
||||
enabled = true, -- Highlight the current buffer
|
||||
leave_dirs_open = false,
|
||||
},
|
||||
use_libuv_file_watcher = true, -- Sync file system changes
|
||||
filtered_items = {
|
||||
visible = true,
|
||||
show_hidden_count = true,
|
||||
hide_dotfile = false,
|
||||
hide_gitignore = false,
|
||||
},
|
||||
},
|
||||
window = {
|
||||
position = "left",
|
||||
width = 30, -- Saner window size
|
||||
mappings = {
|
||||
["s"] = "open_split", -- horizontal split
|
||||
["v"] = "open_vsplit", -- vertical split
|
||||
["Y"] = function(state) -- Copy file's path to + register
|
||||
local node = state.tree:get_node()
|
||||
local path = node:get_id()
|
||||
vim.fn.setreg("+", path, "c")
|
||||
end,
|
||||
},
|
||||
},
|
||||
default_component_configs = {
|
||||
indent = {
|
||||
indent_size = 2, -- Compact tree display
|
||||
with_expanders = true, -- if nil and file nesting is enabled, will enable expanders
|
||||
expander_collapsed = "",
|
||||
expander_expanded = "",
|
||||
expander_highlight = "NeoTreeExpander",
|
||||
},
|
||||
},
|
||||
sources = { "filesystem", "buffers", "git_status", "document_symbols" },
|
||||
open_files_do_not_replace_types = { "terminal", "Trouble", "trouble", "qf", "Outline" },
|
||||
},
|
||||
config = function(_, opts)
|
||||
local config = require("config.util")
|
||||
|
||||
local function on_move(data)
|
||||
config.on_rename(data.source, data.destination)
|
||||
end
|
||||
|
||||
local events = require("neo-tree.events")
|
||||
opts.event_handlers = opts.event_handlers or {}
|
||||
vim.list_extend(opts.event_handlers, {
|
||||
{ event = events.FILE_MOVED, handler = on_move },
|
||||
{ event = events.FILE_RENAMED, handler = on_move },
|
||||
})
|
||||
require("neo-tree").setup(opts)
|
||||
vim.api.nvim_create_autocmd("TermClose", {
|
||||
pattern = "*lazygit",
|
||||
callback = function()
|
||||
if package.loaded["neo-tree.sources.git_status"] then
|
||||
require("neo-tree.sources.git_status").refresh()
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Automatically highlights other instances of the word under cursor
|
||||
{
|
||||
"RRethy/vim-illuminate",
|
||||
"projekt0n/github-nvim-theme",
|
||||
lazy = false,
|
||||
opts = {
|
||||
delay = 200,
|
||||
large_file_cutoff = 2000,
|
||||
large_file_override = {
|
||||
providers = { "lsp" },
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
-- Copied from LazyNvim
|
||||
require("illuminate").configure(opts)
|
||||
|
||||
local function map(key, dir, buffer)
|
||||
vim.keymap.set("n", key, function()
|
||||
require("illuminate")["goto_" .. dir .. "_reference"](false)
|
||||
end, { desc = dir:sub(1, 1):upper() .. dir:sub(2) .. " Reference", buffer = buffer })
|
||||
end
|
||||
|
||||
map("]]", "next")
|
||||
map("[[", "prev")
|
||||
|
||||
-- also set it after loading ftplugins, since a lot overwrite [[ and ]]
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
callback = function()
|
||||
local buffer = vim.api.nvim_get_current_buf()
|
||||
map("]]", "next", buffer)
|
||||
map("[[", "prev", buffer)
|
||||
end,
|
||||
})
|
||||
priority = 1000,
|
||||
config = function()
|
||||
vim.cmd("colorscheme github_dark_dimmed")
|
||||
end,
|
||||
keys = {
|
||||
{ "]]", desc = "Next Reference" },
|
||||
{ "[[", desc = "Prev Reference" },
|
||||
},
|
||||
},
|
||||
|
||||
-- Display undotree
|
||||
{
|
||||
"mbbill/undotree",
|
||||
keys = {
|
||||
{ "<leader>u", "<cmd>UndotreeToggle<cr>", desc = "Toggle Undotree panel" },
|
||||
},
|
||||
},
|
||||
|
||||
-- Show buffers like VS Code tabs
|
||||
@@ -246,17 +66,6 @@ return {
|
||||
end,
|
||||
},
|
||||
|
||||
-- UI Stuff ------------------------------------------------------------------------
|
||||
|
||||
-- icons
|
||||
{ "nvim-tree/nvim-web-devicons" },
|
||||
|
||||
-- ui components
|
||||
{ "MunifTanjim/nui.nvim" },
|
||||
|
||||
-- Better vim.ui
|
||||
{ "stevearc/dressing.nvim" },
|
||||
|
||||
-- Better `vim.notify()`
|
||||
{
|
||||
"rcarriga/nvim-notify",
|
||||
@@ -25,6 +25,22 @@ return {
|
||||
end,
|
||||
},
|
||||
|
||||
-- Changes the Nvim root to git root
|
||||
{
|
||||
"airblade/vim-rooter",
|
||||
config = function()
|
||||
vim.g.rooter_cd_cmd = "tcd" -- Use tcd command to change the root
|
||||
end,
|
||||
},
|
||||
|
||||
-- Display undotree
|
||||
{
|
||||
"mbbill/undotree",
|
||||
keys = {
|
||||
{ "<leader>u", "<cmd>UndotreeToggle<cr>", desc = "Toggle Undotree panel" },
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
config = function()
|
||||
|
||||
Reference in New Issue
Block a user