mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 08:41:43 +05:30
chore(nvim): Remove unused util-functions
- Remove relic of effort to force neovim in vs-code - Remove util functions copied from LazyNvim - if I need them I'll write them - Removed Lua code comments I don't understand - Better code comments
This commit is contained in:
@@ -18,7 +18,7 @@ require("config.autocmd")
|
|||||||
-- NOTE: External Tools needed for this Nvim config to work
|
-- NOTE: External Tools needed for this Nvim config to work
|
||||||
-- jsregexp
|
-- jsregexp
|
||||||
-- rust-analyzer, rustc, cargo (rustacean)
|
-- rust-analyzer, rustc, cargo (rustacean)
|
||||||
-- OS Installs:
|
-- OS Installs: Use ../../../scripts/install.sh
|
||||||
-- general: curl, gzip, unzip, git, fd-find, ripgrep, fzf, tree-sitter
|
-- general: curl, gzip, unzip, git, fd-find, ripgrep, fzf, tree-sitter
|
||||||
-- tools: ImageMagick, xclip, xsel, ghostscript
|
-- tools: ImageMagick, xclip, xsel, ghostscript
|
||||||
-- lsp: codespell, nodejs-bash-language-server, hadolint, lua, luajit, shellcheck, shfmt, trivy, pylint, stylua
|
-- lsp: codespell, nodejs-bash-language-server, hadolint, lua, luajit, shellcheck, shfmt, trivy, pylint, stylua
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
local sep = package.config:sub(1, 1)
|
local sep = package.config:sub(1, 1)
|
||||||
local vim_mappings = vim.loop.os_homedir() .. sep .. ".vim" .. sep .. "key_maps.vim"
|
local vim_mappings = vim.loop.os_homedir() .. sep .. ".vim" .. sep .. "key_maps.vim"
|
||||||
local util = require("config.util")
|
local util = require("config.util")
|
||||||
if vim.loop.fs_stat(vim_mappings) and util.is_not_vscode() then
|
if vim.loop.fs_stat(vim_mappings) then
|
||||||
vim.cmd("source " .. vim_mappings)
|
vim.cmd("source " .. vim_mappings)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -60,10 +60,6 @@ vim.keymap.set({ "n", "v" }, "<leader>xb", function()
|
|||||||
vim.cmd("bdelete")
|
vim.cmd("bdelete")
|
||||||
end, { desc = "Save and close current buffer" })
|
end, { desc = "Save and close current buffer" })
|
||||||
|
|
||||||
-- Traverse quickfix
|
|
||||||
-- vim.keymap.set("n", "[q", vim.cmd.cprev, { desc = "Previous quickfix" })
|
|
||||||
-- vim.keymap.set("n", "]q", vim.cmd.cnext, { desc = "Next quickfix" })
|
|
||||||
|
|
||||||
-- Clear searches
|
-- Clear searches
|
||||||
vim.keymap.set({ "i", "n" }, "<esc>", "<cmd>noh<cr><esc>", { desc = "Escape and clear hlsearch" })
|
vim.keymap.set({ "i", "n" }, "<esc>", "<cmd>noh<cr><esc>", { desc = "Escape and clear hlsearch" })
|
||||||
|
|
||||||
@@ -73,7 +69,6 @@ vim.keymap.set({ "x", "o" }, "n", "'Nn'[v:searchforward]", { expr = true, desc =
|
|||||||
vim.keymap.set("n", "N", "'nN'[v:searchforward].'zv'", { expr = true, desc = "Prev search result" })
|
vim.keymap.set("n", "N", "'nN'[v:searchforward].'zv'", { expr = true, desc = "Prev search result" })
|
||||||
vim.keymap.set({ "x", "o" }, "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
|
vim.keymap.set({ "x", "o" }, "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
|
||||||
|
|
||||||
-- diagnostic: From LazyVim
|
|
||||||
local diagnostic_goto = function(next, severity)
|
local diagnostic_goto = function(next, severity)
|
||||||
local go = next and vim.diagnostic.goto_next or vim.diagnostic.goto_prev
|
local go = next and vim.diagnostic.goto_next or vim.diagnostic.goto_prev
|
||||||
severity = severity and vim.diagnostic.severity[severity] or nil
|
severity = severity and vim.diagnostic.severity[severity] or nil
|
||||||
|
|||||||
@@ -98,69 +98,4 @@ local M = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
function M.is_not_vscode()
|
|
||||||
return not vim.g.vscode
|
|
||||||
end
|
|
||||||
|
|
||||||
function M.fg(name)
|
|
||||||
---@type {foreground?:number}?
|
|
||||||
---@diagnostic disable-next-line: deprecated
|
|
||||||
local hl = vim.api.nvim_get_hl and vim.api.nvim_get_hl(0, { name = name }) or vim.api.nvim_get_hl_by_name(name, true)
|
|
||||||
---@diagnostic disable-next-line: undefined-field
|
|
||||||
local fg = hl and (hl.fg or hl.foreground)
|
|
||||||
return fg and { fg = string.format("#%06x", fg) } or nil
|
|
||||||
end
|
|
||||||
|
|
||||||
---@param opts? lsp.Client.filter
|
|
||||||
function M.get_clients(opts)
|
|
||||||
local ret = {} ---@type lsp.Client[]
|
|
||||||
if vim.lsp.get_clients then
|
|
||||||
ret = vim.lsp.get_clients(opts)
|
|
||||||
else
|
|
||||||
---@diagnostic disable-next-line: deprecated
|
|
||||||
ret = vim.lsp.get_active_clients(opts)
|
|
||||||
if opts and opts.method then
|
|
||||||
---@param client lsp.Client
|
|
||||||
ret = vim.tbl_filter(function(client)
|
|
||||||
return client.supports_method(opts.method, { bufnr = opts.bufnr })
|
|
||||||
end, ret)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return opts and opts.filter and vim.tbl_filter(opts.filter, ret) or ret
|
|
||||||
end
|
|
||||||
|
|
||||||
---@param from string
|
|
||||||
---@param to string
|
|
||||||
function M.on_rename(from, to)
|
|
||||||
local clients = M.get_clients()
|
|
||||||
for _, client in ipairs(clients) do
|
|
||||||
if client.supports_method("workspace/willRenameFiles") then
|
|
||||||
---@diagnostic disable-next-line: invisible
|
|
||||||
local resp = client.request_sync("workspace/willRenameFiles", {
|
|
||||||
files = {
|
|
||||||
{
|
|
||||||
oldUri = vim.uri_from_fname(from),
|
|
||||||
newUri = vim.uri_from_fname(to),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}, 1000, 0)
|
|
||||||
if resp and resp.result ~= nil then
|
|
||||||
vim.lsp.util.apply_workspace_edit(resp.result, client.offset_encoding)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
---@param on_attach fun(client, buffer)
|
|
||||||
function M.on_lsp_attach(on_attach)
|
|
||||||
vim.api.nvim_create_autocmd("LspAttach", {
|
|
||||||
callback = function(args)
|
|
||||||
local buffer = args.buf ---@type number
|
|
||||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
|
||||||
on_attach(client, buffer)
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|||||||
@@ -24,8 +24,6 @@ end
|
|||||||
---@diagnostic disable-next-line: undefined-field
|
---@diagnostic disable-next-line: undefined-field
|
||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
-- You can also configure plugins after the setup call,
|
|
||||||
-- as they will be available in your neovim runtime.
|
|
||||||
require("lazy").setup({
|
require("lazy").setup({
|
||||||
change_detection = {
|
change_detection = {
|
||||||
notify = false,
|
notify = false,
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
-- TIP:
|
-- TIP: Setup a new LSP:
|
||||||
-- Step 1: Install the LSP through either of the following:
|
-- Step 1: Install the LSP through:
|
||||||
-- OS Installer > Brew-linux > Mason NeoVim Plugin
|
-- OS Installer > Brew-linux > :MasonInstall
|
||||||
-- Step 2: Append the LSP server name in the below array
|
-- Step 2: Append the LSP server name in the below array ("newlsp")
|
||||||
|
-- Step 3: Create file ("newlsp.lua") in ../../lsp/
|
||||||
|
-- Step 4: Return a lua table containing required lsp config in it
|
||||||
vim.lsp.enable({
|
vim.lsp.enable({
|
||||||
"bashls",
|
"bashls",
|
||||||
"cssls",
|
"cssls",
|
||||||
|
|||||||
@@ -1,17 +1,10 @@
|
|||||||
return {
|
return {
|
||||||
"mfussenegger/nvim-dap",
|
"mfussenegger/nvim-dap",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
-- Creates a beautiful debugger UI
|
|
||||||
"rcarriga/nvim-dap-ui",
|
"rcarriga/nvim-dap-ui",
|
||||||
|
|
||||||
-- Required dependency for nvim-dap-ui
|
|
||||||
"nvim-neotest/nvim-nio",
|
"nvim-neotest/nvim-nio",
|
||||||
|
|
||||||
-- Auto-installs debugger adapters
|
|
||||||
"mason-org/mason.nvim",
|
"mason-org/mason.nvim",
|
||||||
"jay-babu/mason-nvim-dap.nvim",
|
"jay-babu/mason-nvim-dap.nvim",
|
||||||
|
|
||||||
-- Shows variable values inline as virtual text
|
|
||||||
"theHamsta/nvim-dap-virtual-text",
|
"theHamsta/nvim-dap-virtual-text",
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
|
|||||||
@@ -9,10 +9,8 @@ return {
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Finds and lists all of the TODO, HACK, BUG, etc comment
|
|
||||||
{
|
{
|
||||||
"folke/todo-comments.nvim",
|
"folke/todo-comments.nvim",
|
||||||
cond = require("config.util").is_not_vscode(),
|
|
||||||
event = "VimEnter",
|
event = "VimEnter",
|
||||||
dependencies = { "nvim-lua/plenary.nvim" },
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
config = true,
|
config = true,
|
||||||
@@ -25,7 +23,7 @@ return {
|
|||||||
"--with-filename",
|
"--with-filename",
|
||||||
"--line-number",
|
"--line-number",
|
||||||
"--column",
|
"--column",
|
||||||
"--hidden", -- include hidden files
|
"--hidden", -- adds dotfiles
|
||||||
"--glob=!.git", -- exclude .git directory
|
"--glob=!.git", -- exclude .git directory
|
||||||
"--glob=!target",
|
"--glob=!target",
|
||||||
"--glob=!node_modules",
|
"--glob=!node_modules",
|
||||||
@@ -51,19 +49,16 @@ return {
|
|||||||
end,
|
end,
|
||||||
desc = "Previous todo comment",
|
desc = "Previous todo comment",
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "<leader>df", "<cmd>TodoTelescope keywords=FIX,FIXME,BUG<cr>", desc = "FIXME: Tags" },
|
{ "<leader>df", "<cmd>TodoTelescope keywords=FIX,FIXME,BUG<cr>", desc = "FIXME: Tags" },
|
||||||
{ "<leader>dt", "<cmd>TodoTelescope keywords=TODO,FIX,FIXME,BUG<cr>", desc = "Project TODOs" },
|
{ "<leader>dt", "<cmd>TodoTelescope keywords=TODO,FIX,FIXME,BUG<cr>", desc = "Project TODOs" },
|
||||||
{ "<leader>dT", "<cmd>TodoTelescope<cr>", desc = "All tags: FIX, NOTE, TIP, TODO, WARN" },
|
{ "<leader>dT", "<cmd>TodoTelescope<cr>", desc = "All tags: FIX, NOTE, TIP, TODO, WARN" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- better diagnostics list and others
|
|
||||||
{
|
{
|
||||||
"folke/trouble.nvim",
|
"folke/trouble.nvim",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
cmd = "Trouble",
|
cmd = "Trouble",
|
||||||
cond = require("config.util").is_not_vscode(),
|
|
||||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
opts = {
|
opts = {
|
||||||
-- Default: Preview in a split
|
-- Default: Preview in a split
|
||||||
@@ -111,42 +106,11 @@ return {
|
|||||||
{ "<leader>dw", "<cmd>Trouble project_warnings toggle focus=true<cr>", desc = "Trouble: List Project Diagnostics" },
|
{ "<leader>dw", "<cmd>Trouble project_warnings toggle focus=true<cr>", desc = "Trouble: List Project Diagnostics" },
|
||||||
{ "<leader>dq", "<cmd>Trouble quickfix toggle focus=true<cr>", desc = "Trouble: Quickfix List" },
|
{ "<leader>dq", "<cmd>Trouble quickfix toggle focus=true<cr>", desc = "Trouble: Quickfix List" },
|
||||||
{ "gr", "<cmd>Trouble lsp_references toggle focus=true<cr>", desc = "Goto References" },
|
{ "gr", "<cmd>Trouble lsp_references toggle focus=true<cr>", desc = "Goto References" },
|
||||||
{
|
|
||||||
"[q",
|
|
||||||
function()
|
|
||||||
if require("trouble").is_open() then
|
|
||||||
require("trouble").previous({ skip_groups = true, jump = true })
|
|
||||||
else
|
|
||||||
local ok, err = pcall(vim.cmd.cprev)
|
|
||||||
if not ok then
|
|
||||||
vim.notify(err, vim.log.levels.ERROR)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
desc = "Previous trouble/quickfix item",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"]q",
|
|
||||||
function()
|
|
||||||
if require("trouble").is_open() then
|
|
||||||
---@diagnostic disable-next-line: missing-parameter, missing-fields
|
|
||||||
require("trouble").next({ skip_groups = true, jump = true })
|
|
||||||
else
|
|
||||||
local ok, err = pcall(vim.cmd.cnext)
|
|
||||||
if not ok then
|
|
||||||
vim.notify(err, vim.log.levels.ERROR)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
desc = "Next trouble/quickfix item",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- LspSaga
|
|
||||||
{
|
{
|
||||||
"nvimdev/lspsaga.nvim",
|
"nvimdev/lspsaga.nvim",
|
||||||
cond = require("config.util").is_not_vscode(),
|
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
"nvim-tree/nvim-web-devicons",
|
"nvim-tree/nvim-web-devicons",
|
||||||
@@ -170,15 +134,12 @@ return {
|
|||||||
})
|
})
|
||||||
|
|
||||||
vim.keymap.set({ "n", "t" }, "<C-`>", "<cmd>Lspsaga term_toggle<cr>", { desc = "Toggle Floating Terminal" })
|
vim.keymap.set({ "n", "t" }, "<C-`>", "<cmd>Lspsaga term_toggle<cr>", { desc = "Toggle Floating Terminal" })
|
||||||
|
|
||||||
-- Rest of the keymaps in ../core/lsp.lua
|
-- Rest of the keymaps in ../core/lsp.lua
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Search and jump around symbols in the buffer
|
|
||||||
{
|
{
|
||||||
"SmiteshP/nvim-navbuddy",
|
"SmiteshP/nvim-navbuddy",
|
||||||
cond = require("config.util").is_not_vscode(),
|
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"SmiteshP/nvim-navic",
|
"SmiteshP/nvim-navic",
|
||||||
"MunifTanjim/nui.nvim",
|
"MunifTanjim/nui.nvim",
|
||||||
@@ -236,21 +197,13 @@ return {
|
|||||||
lazy = false,
|
lazy = false,
|
||||||
build = ":TSUpdate",
|
build = ":TSUpdate",
|
||||||
init = function(plugin)
|
init = function(plugin)
|
||||||
-- PERF: add nvim-treesitter queries to the rtp and it's custom query predicates early
|
|
||||||
-- This is needed because a bunch of plugins no longer `require("nvim-treesitter")`, which
|
|
||||||
-- no longer trigger the **nvim-treeitter** module to be loaded in time.
|
|
||||||
-- Luckily, the only thing that those plugins need are the custom queries, which we make available
|
|
||||||
-- during startup.
|
|
||||||
require("lazy.core.loader").add_to_rtp(plugin)
|
require("lazy.core.loader").add_to_rtp(plugin)
|
||||||
require("nvim-treesitter.query_predicates")
|
require("nvim-treesitter.query_predicates")
|
||||||
end,
|
end,
|
||||||
dependencies = { "nvim-treesitter/nvim-treesitter-textobjects" },
|
dependencies = { "nvim-treesitter/nvim-treesitter-textobjects" },
|
||||||
|
|
||||||
config = function()
|
config = function()
|
||||||
-- See `:help nvim-treesitter`
|
|
||||||
-- Defer Treesitter setup after first render to improve startup time of 'nvim {filename}'
|
|
||||||
vim.defer_fn(function()
|
vim.defer_fn(function()
|
||||||
---@diagnostic disable-next-line: missing-fields
|
|
||||||
require("nvim-treesitter.configs").setup({
|
require("nvim-treesitter.configs").setup({
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"regex",
|
"regex",
|
||||||
@@ -294,9 +247,8 @@ return {
|
|||||||
textobjects = {
|
textobjects = {
|
||||||
select = {
|
select = {
|
||||||
enable = true,
|
enable = true,
|
||||||
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
|
lookahead = true, -- Automatically jump forward to textobj
|
||||||
keymaps = {
|
keymaps = {
|
||||||
-- You can use the capture groups defined in textobjects.scm (:TSEditQuery textobjects)
|
|
||||||
["aa"] = { query = "@parameter.outer", desc = "Select around the parameter" },
|
["aa"] = { query = "@parameter.outer", desc = "Select around the parameter" },
|
||||||
["ia"] = { query = "@parameter.inner", desc = "Select inside the parameter" },
|
["ia"] = { query = "@parameter.inner", desc = "Select inside the parameter" },
|
||||||
["af"] = { query = "@function.outer", desc = "Select around the function" },
|
["af"] = { query = "@function.outer", desc = "Select around the function" },
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
cond = require("config.util").is_not_vscode(),
|
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{
|
{
|
||||||
"williamboman/mason.nvim",
|
"williamboman/mason.nvim",
|
||||||
@@ -39,7 +38,6 @@ return {
|
|||||||
|
|
||||||
{
|
{
|
||||||
"j-hui/fidget.nvim",
|
"j-hui/fidget.nvim",
|
||||||
cond = require("config.util").is_not_vscode(),
|
|
||||||
opts = {
|
opts = {
|
||||||
progress = {
|
progress = {
|
||||||
poll_rate = 1, -- How and when to poll for progress messages
|
poll_rate = 1, -- How and when to poll for progress messages
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ return {
|
|||||||
-- Taken from LazyVim
|
-- Taken from LazyVim
|
||||||
{
|
{
|
||||||
"nvim-neotest/neotest",
|
"nvim-neotest/neotest",
|
||||||
cond = require("config.util").is_not_vscode(),
|
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-neotest/nvim-nio",
|
"nvim-neotest/nvim-nio",
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
@@ -43,8 +42,6 @@ return {
|
|||||||
|
|
||||||
if require("lazy.core.config").spec.plugins["trouble.nvim"] ~= nil then
|
if require("lazy.core.config").spec.plugins["trouble.nvim"] ~= nil then
|
||||||
opts.consumers = opts.consumers or {}
|
opts.consumers = opts.consumers or {}
|
||||||
-- Refresh and auto close trouble after running tests
|
|
||||||
---@type neotest.Consumer
|
|
||||||
opts.consumers.trouble = function(client)
|
opts.consumers.trouble = function(client)
|
||||||
client.listeners.results = function(adapter_id, results, partial)
|
client.listeners.results = function(adapter_id, results, partial)
|
||||||
if partial then
|
if partial then
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"saghen/blink.cmp",
|
"saghen/blink.cmp",
|
||||||
cond = require("config.util").is_not_vscode(),
|
|
||||||
event = "InsertEnter",
|
event = "InsertEnter",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"L3MON4D3/LuaSnip",
|
"L3MON4D3/LuaSnip",
|
||||||
@@ -19,13 +18,7 @@ return {
|
|||||||
"sources.default",
|
"sources.default",
|
||||||
},
|
},
|
||||||
|
|
||||||
---@module 'blink.cmp'
|
|
||||||
---@type blink.cmp.Config
|
|
||||||
opts = {
|
opts = {
|
||||||
-- 'default' for mappings similar to built-in completion
|
|
||||||
-- 'super-tab' for mappings similar to vscode (tab to accept, arrow keys to navigate)
|
|
||||||
-- 'enter' for mappings similar to 'super-tab' but with 'enter' to accept
|
|
||||||
-- 'none' - create all the mappings yourself
|
|
||||||
keymap = {
|
keymap = {
|
||||||
preset = "none",
|
preset = "none",
|
||||||
["<CR>"] = { "accept", "fallback" }, -- Ctrl + Enter to accept
|
["<CR>"] = { "accept", "fallback" }, -- Ctrl + Enter to accept
|
||||||
@@ -126,8 +119,6 @@ return {
|
|||||||
should_show_items = function()
|
should_show_items = function()
|
||||||
return vim.tbl_contains({ "gitcommit" }, vim.o.filetype)
|
return vim.tbl_contains({ "gitcommit" }, vim.o.filetype)
|
||||||
end,
|
end,
|
||||||
---@module 'blink-cmp-conventional-commits'
|
|
||||||
---@type blink-cmp-conventional-commits.Options
|
|
||||||
opts = {},
|
opts = {},
|
||||||
score_offset = 700,
|
score_offset = 700,
|
||||||
},
|
},
|
||||||
@@ -162,7 +153,6 @@ return {
|
|||||||
|
|
||||||
{
|
{
|
||||||
"L3MON4D3/LuaSnip",
|
"L3MON4D3/LuaSnip",
|
||||||
cond = require("config.util").is_not_vscode(),
|
|
||||||
version = "v2.*",
|
version = "v2.*",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
-- Adds common snippets written in VS Code format
|
-- Adds common snippets written in VS Code format
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"stevearc/conform.nvim",
|
"stevearc/conform.nvim",
|
||||||
cond = require("config.util").is_not_vscode(),
|
|
||||||
lazy = true,
|
lazy = true,
|
||||||
event = { "BufWritePre" },
|
event = { "BufWritePre" },
|
||||||
opts = {
|
opts = {
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ return {
|
|||||||
-- Better fugitive: neogit
|
-- Better fugitive: neogit
|
||||||
{
|
{
|
||||||
"NeogitOrg/neogit",
|
"NeogitOrg/neogit",
|
||||||
cond = require("config.util").is_not_vscode(),
|
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
"sindrets/diffview.nvim",
|
"sindrets/diffview.nvim",
|
||||||
@@ -17,7 +16,6 @@ return {
|
|||||||
-- Git Diffview
|
-- Git Diffview
|
||||||
{
|
{
|
||||||
"sindrets/diffview.nvim",
|
"sindrets/diffview.nvim",
|
||||||
cond = require("config.util").is_not_vscode(),
|
|
||||||
keys = {
|
keys = {
|
||||||
|
|
||||||
{ "<leader>gd", "<cmd>DiffviewOpen<cr>", desc = "Git: Open Diffview", mode = { "n" } },
|
{ "<leader>gd", "<cmd>DiffviewOpen<cr>", desc = "Git: Open Diffview", mode = { "n" } },
|
||||||
@@ -28,7 +26,6 @@ return {
|
|||||||
-- 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",
|
"lewis6991/gitsigns.nvim",
|
||||||
cond = require("config.util").is_not_vscode(),
|
|
||||||
opts = {
|
opts = {
|
||||||
-- See `:help gitsigns.txt`
|
-- See `:help gitsigns.txt`
|
||||||
signs = {
|
signs = {
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ return {
|
|||||||
-- Render Markdown on Neovim
|
-- Render Markdown on Neovim
|
||||||
{
|
{
|
||||||
"MeanderingProgrammer/render-markdown.nvim",
|
"MeanderingProgrammer/render-markdown.nvim",
|
||||||
cond = require("config.util").is_not_vscode(),
|
|
||||||
init = function()
|
init = function()
|
||||||
-- Define color variables
|
-- Define color variables
|
||||||
local color1_bg = "#295715"
|
local color1_bg = "#295715"
|
||||||
@@ -72,7 +71,6 @@ return {
|
|||||||
|
|
||||||
{
|
{
|
||||||
"bullets-vim/bullets.vim",
|
"bullets-vim/bullets.vim",
|
||||||
cond = require("config.util").is_not_vscode(),
|
|
||||||
ft = { "markdown", "text", "gitcommit", "scratch" },
|
ft = { "markdown", "text", "gitcommit", "scratch" },
|
||||||
config = function()
|
config = function()
|
||||||
vim.g.bullets_enabled_file_types = {
|
vim.g.bullets_enabled_file_types = {
|
||||||
|
|||||||
@@ -26,10 +26,8 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- File Explorer: Neotree
|
|
||||||
{
|
{
|
||||||
"nvim-neo-tree/neo-tree.nvim",
|
"nvim-neo-tree/neo-tree.nvim",
|
||||||
cond = require("config.util").is_not_vscode(),
|
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader><tab>", "<CMD>Neotree toggle left<CR>", desc = "Open NeoTree Explorer at Git root", remap = true },
|
{ "<leader><tab>", "<CMD>Neotree toggle left<CR>", desc = "Open NeoTree Explorer at Git root", remap = true },
|
||||||
},
|
},
|
||||||
@@ -78,26 +76,12 @@ return {
|
|||||||
open_files_do_not_replace_types = { "terminal", "Trouble", "trouble", "qf", "Outline" },
|
open_files_do_not_replace_types = { "terminal", "Trouble", "trouble", "qf", "Outline" },
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
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)
|
require("neo-tree").setup(opts)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Telescope: Fuzzy Finder (files, lsp, etc)
|
|
||||||
{
|
{
|
||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
cond = require("config.util").is_not_vscode(),
|
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
{
|
{
|
||||||
@@ -116,6 +100,7 @@ return {
|
|||||||
config = function()
|
config = function()
|
||||||
local telescopeConfig = require("telescope.config")
|
local telescopeConfig = require("telescope.config")
|
||||||
|
|
||||||
|
-- Use this filter for both default search & picker search
|
||||||
local filters = {
|
local filters = {
|
||||||
"--hidden",
|
"--hidden",
|
||||||
"--glob",
|
"--glob",
|
||||||
@@ -126,10 +111,8 @@ return {
|
|||||||
"!**/target/*",
|
"!**/target/*",
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Clone the default Telescope configuration
|
|
||||||
local vimgrep_arguments = { unpack(telescopeConfig.values.vimgrep_arguments) }
|
local vimgrep_arguments = { unpack(telescopeConfig.values.vimgrep_arguments) }
|
||||||
|
|
||||||
-- Merge default arguments with filters
|
|
||||||
for i = 1, #filters do
|
for i = 1, #filters do
|
||||||
vimgrep_arguments[#vimgrep_arguments + 1] = filters[i]
|
vimgrep_arguments[#vimgrep_arguments + 1] = filters[i]
|
||||||
end
|
end
|
||||||
@@ -163,12 +146,9 @@ return {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Load some required Telescope extensions
|
|
||||||
pcall(require("telescope").load_extension, "fzf")
|
pcall(require("telescope").load_extension, "fzf")
|
||||||
pcall(require("telescope").load_extension, "ui-select")
|
pcall(require("telescope").load_extension, "ui-select")
|
||||||
|
|
||||||
-- Keymaps for LSP Things -> In code-lsp.lua
|
|
||||||
|
|
||||||
-- Buffer
|
-- Buffer
|
||||||
vim.keymap.set("n", "<leader>bl", require("telescope.builtin").buffers, { desc = "List Buffers" })
|
vim.keymap.set("n", "<leader>bl", require("telescope.builtin").buffers, { desc = "List Buffers" })
|
||||||
|
|
||||||
|
|||||||
@@ -1,21 +1,12 @@
|
|||||||
return {
|
return {
|
||||||
-- icons
|
-- icons
|
||||||
{
|
"nvim-tree/nvim-web-devicons",
|
||||||
"nvim-tree/nvim-web-devicons",
|
|
||||||
cond = require("config.util").is_not_vscode(),
|
|
||||||
},
|
|
||||||
|
|
||||||
-- ui components
|
-- ui components
|
||||||
{
|
"MunifTanjim/nui.nvim",
|
||||||
"MunifTanjim/nui.nvim",
|
|
||||||
cond = require("config.util").is_not_vscode(),
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Better vim.ui
|
-- Better vim.ui
|
||||||
{
|
"stevearc/dressing.nvim",
|
||||||
"stevearc/dressing.nvim",
|
|
||||||
cond = require("config.util").is_not_vscode(),
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"projekt0n/github-nvim-theme",
|
"projekt0n/github-nvim-theme",
|
||||||
@@ -37,7 +28,6 @@ return {
|
|||||||
-- Show buffers like VS Code tabs
|
-- Show buffers like VS Code tabs
|
||||||
{
|
{
|
||||||
"akinsho/bufferline.nvim",
|
"akinsho/bufferline.nvim",
|
||||||
cond = require("config.util").is_not_vscode(),
|
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>bp", "<Cmd>BufferLineTogglePin<CR>", desc = "Toggle buffer-pin" },
|
{ "<leader>bp", "<Cmd>BufferLineTogglePin<CR>", desc = "Toggle buffer-pin" },
|
||||||
@@ -84,7 +74,6 @@ return {
|
|||||||
vim.api.nvim_create_autocmd("BufAdd", {
|
vim.api.nvim_create_autocmd("BufAdd", {
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
---@diagnostic disable-next-line: param-type-mismatch
|
|
||||||
pcall(buf_line)
|
pcall(buf_line)
|
||||||
end)
|
end)
|
||||||
end,
|
end,
|
||||||
@@ -95,7 +84,6 @@ return {
|
|||||||
-- Completely replaces the UI for messages, cmdline and the popupmenu.
|
-- Completely replaces the UI for messages, cmdline and the popupmenu.
|
||||||
{
|
{
|
||||||
"folke/noice.nvim",
|
"folke/noice.nvim",
|
||||||
cond = require("config.util").is_not_vscode(),
|
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"MunifTanjim/nui.nvim",
|
"MunifTanjim/nui.nvim",
|
||||||
@@ -166,7 +154,6 @@ return {
|
|||||||
-- Indent guides for Neovim
|
-- Indent guides for Neovim
|
||||||
{
|
{
|
||||||
"lukas-reineke/indent-blankline.nvim",
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
cond = require("config.util").is_not_vscode(),
|
|
||||||
opts = {
|
opts = {
|
||||||
indent = { char = "│", tab_char = "│" },
|
indent = { char = "│", tab_char = "│" },
|
||||||
scope = { enabled = false },
|
scope = { enabled = false },
|
||||||
@@ -192,7 +179,6 @@ return {
|
|||||||
-- Better folds
|
-- Better folds
|
||||||
{
|
{
|
||||||
"kevinhwang91/nvim-ufo",
|
"kevinhwang91/nvim-ufo",
|
||||||
cond = require("config.util").is_not_vscode(),
|
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"kevinhwang91/promise-async",
|
"kevinhwang91/promise-async",
|
||||||
|
|||||||
@@ -5,25 +5,8 @@ return {
|
|||||||
"echasnovski/mini.nvim",
|
"echasnovski/mini.nvim",
|
||||||
version = false,
|
version = false,
|
||||||
config = function()
|
config = function()
|
||||||
-- gc
|
|
||||||
require("mini.comment").setup()
|
require("mini.comment").setup()
|
||||||
|
|
||||||
require("mini.pairs").setup()
|
require("mini.pairs").setup()
|
||||||
|
|
||||||
-- mini.ai
|
|
||||||
-- va) - [v]isually select [a]round [)]paren
|
|
||||||
-- - a) would implicitly select around another ), based on some predefined logic
|
|
||||||
-- ci' - [c]hange [i]nside [']quote
|
|
||||||
-- via - [a]rguments
|
|
||||||
-- vif - [f]unction calls
|
|
||||||
-- va_ - select around "_"
|
|
||||||
-- va1 - select around two "1"
|
|
||||||
--
|
|
||||||
-- explicit covering region:
|
|
||||||
-- vinq - select [i]nside [n]ext [q]uote
|
|
||||||
-- vilb - select inside last bracket
|
|
||||||
-- cina - change next function argument
|
|
||||||
-- cila - change last function argument
|
|
||||||
require("mini.ai").setup({ n_lines = 500 })
|
require("mini.ai").setup({ n_lines = 500 })
|
||||||
|
|
||||||
-- mini.surround
|
-- mini.surround
|
||||||
@@ -97,29 +80,27 @@ return {
|
|||||||
})
|
})
|
||||||
|
|
||||||
-- configure mini.indentscope
|
-- configure mini.indentscope
|
||||||
if require("config.util").is_not_vscode() then
|
require("mini.indentscope").setup({
|
||||||
require("mini.indentscope").setup({
|
delay = 100,
|
||||||
delay = 100,
|
symbol = "│",
|
||||||
symbol = "│",
|
options = { try_as_border = true },
|
||||||
options = { try_as_border = true },
|
})
|
||||||
})
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
pattern = {
|
pattern = {
|
||||||
"help",
|
"help",
|
||||||
"neo-tree",
|
"neo-tree",
|
||||||
"Trouble",
|
"Trouble",
|
||||||
"trouble",
|
"trouble",
|
||||||
"lazy",
|
"lazy",
|
||||||
"mason",
|
"mason",
|
||||||
"notify",
|
"notify",
|
||||||
"toggleterm",
|
"toggleterm",
|
||||||
},
|
},
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.b.miniindentscope_disable = true
|
vim.b.miniindentscope_disable = true
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -128,7 +109,6 @@ return {
|
|||||||
"folke/snacks.nvim",
|
"folke/snacks.nvim",
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
lazy = false,
|
lazy = false,
|
||||||
cond = require("config.util").is_not_vscode(),
|
|
||||||
opts = {
|
opts = {
|
||||||
bigfile = { enabled = false },
|
bigfile = { enabled = false },
|
||||||
dashboard = { enabled = false },
|
dashboard = { enabled = false },
|
||||||
@@ -287,7 +267,6 @@ return {
|
|||||||
-- Kitty isn't available on Windows
|
-- Kitty isn't available on Windows
|
||||||
return vim.loop.os_uname().sysname ~= "Windows_NT"
|
return vim.loop.os_uname().sysname ~= "Windows_NT"
|
||||||
end,
|
end,
|
||||||
cond = require("config.util").is_not_vscode(),
|
|
||||||
build = "cp ./*.py ~/.config/kitty/",
|
build = "cp ./*.py ~/.config/kitty/",
|
||||||
keys = {
|
keys = {
|
||||||
{ "<C-S-h>", "<cmd>KittyNavigateLeft<cr>" },
|
{ "<C-S-h>", "<cmd>KittyNavigateLeft<cr>" },
|
||||||
@@ -301,7 +280,6 @@ return {
|
|||||||
{
|
{
|
||||||
"mikesmithgh/kitty-scrollback.nvim",
|
"mikesmithgh/kitty-scrollback.nvim",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
cond = require("config.util").is_not_vscode(),
|
|
||||||
cmd = { "KittyScrollbackGenerateKittens", "KittyScrollbackCheckHealth" },
|
cmd = { "KittyScrollbackGenerateKittens", "KittyScrollbackCheckHealth" },
|
||||||
event = { "User KittyScrollbackLaunch" },
|
event = { "User KittyScrollbackLaunch" },
|
||||||
version = "^4.0.0",
|
version = "^4.0.0",
|
||||||
@@ -318,7 +296,6 @@ return {
|
|||||||
-- Changes the Nvim root to git root
|
-- Changes the Nvim root to git root
|
||||||
{
|
{
|
||||||
"airblade/vim-rooter",
|
"airblade/vim-rooter",
|
||||||
cond = require("config.util").is_not_vscode(),
|
|
||||||
config = function()
|
config = function()
|
||||||
vim.g.rooter_cd_cmd = "tcd" -- Use tcd command to change the root
|
vim.g.rooter_cd_cmd = "tcd" -- Use tcd command to change the root
|
||||||
vim.g.rooter_patterns = { ".git" }
|
vim.g.rooter_patterns = { ".git" }
|
||||||
@@ -335,7 +312,6 @@ return {
|
|||||||
|
|
||||||
{
|
{
|
||||||
"folke/which-key.nvim",
|
"folke/which-key.nvim",
|
||||||
cond = require("config.util").is_not_vscode(),
|
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"echasnovski/mini.icons",
|
"echasnovski/mini.icons",
|
||||||
},
|
},
|
||||||
@@ -368,7 +344,6 @@ return {
|
|||||||
-- TIP: autocmd to autoload sessions at: ../config/autocmd.lua
|
-- TIP: autocmd to autoload sessions at: ../config/autocmd.lua
|
||||||
{
|
{
|
||||||
"folke/persistence.nvim",
|
"folke/persistence.nvim",
|
||||||
cond = require("config.util").is_not_vscode(),
|
|
||||||
event = "BufReadPre",
|
event = "BufReadPre",
|
||||||
opts = {
|
opts = {
|
||||||
-- ~/.config/nvim/sessions/
|
-- ~/.config/nvim/sessions/
|
||||||
|
|||||||
Reference in New Issue
Block a user