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
|
||||
-- jsregexp
|
||||
-- rust-analyzer, rustc, cargo (rustacean)
|
||||
-- OS Installs:
|
||||
-- OS Installs: Use ../../../scripts/install.sh
|
||||
-- general: curl, gzip, unzip, git, fd-find, ripgrep, fzf, tree-sitter
|
||||
-- tools: ImageMagick, xclip, xsel, ghostscript
|
||||
-- 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 vim_mappings = vim.loop.os_homedir() .. sep .. ".vim" .. sep .. "key_maps.vim"
|
||||
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)
|
||||
end
|
||||
|
||||
@@ -60,10 +60,6 @@ vim.keymap.set({ "n", "v" }, "<leader>xb", function()
|
||||
vim.cmd("bdelete")
|
||||
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
|
||||
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({ "x", "o" }, "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
|
||||
|
||||
-- diagnostic: From LazyVim
|
||||
local diagnostic_goto = function(next, severity)
|
||||
local go = next and vim.diagnostic.goto_next or vim.diagnostic.goto_prev
|
||||
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
|
||||
|
||||
@@ -24,8 +24,6 @@ end
|
||||
---@diagnostic disable-next-line: undefined-field
|
||||
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({
|
||||
change_detection = {
|
||||
notify = false,
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
-- TIP:
|
||||
-- Step 1: Install the LSP through either of the following:
|
||||
-- OS Installer > Brew-linux > Mason NeoVim Plugin
|
||||
-- Step 2: Append the LSP server name in the below array
|
||||
-- TIP: Setup a new LSP:
|
||||
-- Step 1: Install the LSP through:
|
||||
-- OS Installer > Brew-linux > :MasonInstall
|
||||
-- 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({
|
||||
"bashls",
|
||||
"cssls",
|
||||
|
||||
@@ -1,17 +1,10 @@
|
||||
return {
|
||||
"mfussenegger/nvim-dap",
|
||||
dependencies = {
|
||||
-- Creates a beautiful debugger UI
|
||||
"rcarriga/nvim-dap-ui",
|
||||
|
||||
-- Required dependency for nvim-dap-ui
|
||||
"nvim-neotest/nvim-nio",
|
||||
|
||||
-- Auto-installs debugger adapters
|
||||
"mason-org/mason.nvim",
|
||||
"jay-babu/mason-nvim-dap.nvim",
|
||||
|
||||
-- Shows variable values inline as virtual text
|
||||
"theHamsta/nvim-dap-virtual-text",
|
||||
},
|
||||
keys = {
|
||||
|
||||
@@ -9,10 +9,8 @@ return {
|
||||
end,
|
||||
},
|
||||
|
||||
-- Finds and lists all of the TODO, HACK, BUG, etc comment
|
||||
{
|
||||
"folke/todo-comments.nvim",
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
event = "VimEnter",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = true,
|
||||
@@ -25,7 +23,7 @@ return {
|
||||
"--with-filename",
|
||||
"--line-number",
|
||||
"--column",
|
||||
"--hidden", -- include hidden files
|
||||
"--hidden", -- adds dotfiles
|
||||
"--glob=!.git", -- exclude .git directory
|
||||
"--glob=!target",
|
||||
"--glob=!node_modules",
|
||||
@@ -51,19 +49,16 @@ return {
|
||||
end,
|
||||
desc = "Previous todo comment",
|
||||
},
|
||||
|
||||
{ "<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<cr>", desc = "All tags: FIX, NOTE, TIP, TODO, WARN" },
|
||||
},
|
||||
},
|
||||
|
||||
-- better diagnostics list and others
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
lazy = false,
|
||||
cmd = "Trouble",
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
opts = {
|
||||
-- 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>dq", "<cmd>Trouble quickfix toggle focus=true<cr>", desc = "Trouble: Quickfix List" },
|
||||
{ "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",
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"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" })
|
||||
|
||||
-- Rest of the keymaps in ../core/lsp.lua
|
||||
end,
|
||||
},
|
||||
|
||||
-- Search and jump around symbols in the buffer
|
||||
{
|
||||
"SmiteshP/nvim-navbuddy",
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
dependencies = {
|
||||
"SmiteshP/nvim-navic",
|
||||
"MunifTanjim/nui.nvim",
|
||||
@@ -236,21 +197,13 @@ return {
|
||||
lazy = false,
|
||||
build = ":TSUpdate",
|
||||
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("nvim-treesitter.query_predicates")
|
||||
end,
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter-textobjects" },
|
||||
|
||||
config = function()
|
||||
-- See `:help nvim-treesitter`
|
||||
-- Defer Treesitter setup after first render to improve startup time of 'nvim {filename}'
|
||||
vim.defer_fn(function()
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = {
|
||||
"regex",
|
||||
@@ -294,9 +247,8 @@ return {
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
|
||||
lookahead = true, -- Automatically jump forward to textobj
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm (:TSEditQuery textobjects)
|
||||
["aa"] = { query = "@parameter.outer", desc = "Select around the parameter" },
|
||||
["ia"] = { query = "@parameter.inner", desc = "Select inside the parameter" },
|
||||
["af"] = { query = "@function.outer", desc = "Select around the function" },
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
return {
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
dependencies = {
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
@@ -39,7 +38,6 @@ return {
|
||||
|
||||
{
|
||||
"j-hui/fidget.nvim",
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
opts = {
|
||||
progress = {
|
||||
poll_rate = 1, -- How and when to poll for progress messages
|
||||
|
||||
@@ -3,7 +3,6 @@ return {
|
||||
-- Taken from LazyVim
|
||||
{
|
||||
"nvim-neotest/neotest",
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
dependencies = {
|
||||
"nvim-neotest/nvim-nio",
|
||||
"nvim-lua/plenary.nvim",
|
||||
@@ -43,8 +42,6 @@ return {
|
||||
|
||||
if require("lazy.core.config").spec.plugins["trouble.nvim"] ~= nil then
|
||||
opts.consumers = opts.consumers or {}
|
||||
-- Refresh and auto close trouble after running tests
|
||||
---@type neotest.Consumer
|
||||
opts.consumers.trouble = function(client)
|
||||
client.listeners.results = function(adapter_id, results, partial)
|
||||
if partial then
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
return {
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
event = "InsertEnter",
|
||||
dependencies = {
|
||||
"L3MON4D3/LuaSnip",
|
||||
@@ -19,13 +18,7 @@ return {
|
||||
"sources.default",
|
||||
},
|
||||
|
||||
---@module 'blink.cmp'
|
||||
---@type blink.cmp.Config
|
||||
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 = {
|
||||
preset = "none",
|
||||
["<CR>"] = { "accept", "fallback" }, -- Ctrl + Enter to accept
|
||||
@@ -126,8 +119,6 @@ return {
|
||||
should_show_items = function()
|
||||
return vim.tbl_contains({ "gitcommit" }, vim.o.filetype)
|
||||
end,
|
||||
---@module 'blink-cmp-conventional-commits'
|
||||
---@type blink-cmp-conventional-commits.Options
|
||||
opts = {},
|
||||
score_offset = 700,
|
||||
},
|
||||
@@ -162,7 +153,6 @@ return {
|
||||
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
version = "v2.*",
|
||||
dependencies = {
|
||||
-- Adds common snippets written in VS Code format
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
return {
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
lazy = true,
|
||||
event = { "BufWritePre" },
|
||||
opts = {
|
||||
|
||||
@@ -2,7 +2,6 @@ return {
|
||||
-- Better fugitive: neogit
|
||||
{
|
||||
"NeogitOrg/neogit",
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"sindrets/diffview.nvim",
|
||||
@@ -17,7 +16,6 @@ return {
|
||||
-- Git Diffview
|
||||
{
|
||||
"sindrets/diffview.nvim",
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
keys = {
|
||||
|
||||
{ "<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
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
opts = {
|
||||
-- See `:help gitsigns.txt`
|
||||
signs = {
|
||||
|
||||
@@ -2,7 +2,6 @@ return {
|
||||
-- Render Markdown on Neovim
|
||||
{
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
init = function()
|
||||
-- Define color variables
|
||||
local color1_bg = "#295715"
|
||||
@@ -72,7 +71,6 @@ return {
|
||||
|
||||
{
|
||||
"bullets-vim/bullets.vim",
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
ft = { "markdown", "text", "gitcommit", "scratch" },
|
||||
config = function()
|
||||
vim.g.bullets_enabled_file_types = {
|
||||
|
||||
@@ -26,10 +26,8 @@ return {
|
||||
},
|
||||
},
|
||||
|
||||
-- File Explorer: Neotree
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
keys = {
|
||||
{ "<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" },
|
||||
},
|
||||
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)
|
||||
end,
|
||||
},
|
||||
|
||||
-- Telescope: Fuzzy Finder (files, lsp, etc)
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
{
|
||||
@@ -116,6 +100,7 @@ return {
|
||||
config = function()
|
||||
local telescopeConfig = require("telescope.config")
|
||||
|
||||
-- Use this filter for both default search & picker search
|
||||
local filters = {
|
||||
"--hidden",
|
||||
"--glob",
|
||||
@@ -126,10 +111,8 @@ return {
|
||||
"!**/target/*",
|
||||
}
|
||||
|
||||
-- Clone the default Telescope configuration
|
||||
local vimgrep_arguments = { unpack(telescopeConfig.values.vimgrep_arguments) }
|
||||
|
||||
-- Merge default arguments with filters
|
||||
for i = 1, #filters do
|
||||
vimgrep_arguments[#vimgrep_arguments + 1] = filters[i]
|
||||
end
|
||||
@@ -163,12 +146,9 @@ return {
|
||||
},
|
||||
})
|
||||
|
||||
-- Load some required Telescope extensions
|
||||
pcall(require("telescope").load_extension, "fzf")
|
||||
pcall(require("telescope").load_extension, "ui-select")
|
||||
|
||||
-- Keymaps for LSP Things -> In code-lsp.lua
|
||||
|
||||
-- Buffer
|
||||
vim.keymap.set("n", "<leader>bl", require("telescope.builtin").buffers, { desc = "List Buffers" })
|
||||
|
||||
|
||||
@@ -1,21 +1,12 @@
|
||||
return {
|
||||
-- icons
|
||||
{
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
},
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
|
||||
-- ui components
|
||||
{
|
||||
"MunifTanjim/nui.nvim",
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
},
|
||||
"MunifTanjim/nui.nvim",
|
||||
|
||||
-- Better vim.ui
|
||||
{
|
||||
"stevearc/dressing.nvim",
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
},
|
||||
"stevearc/dressing.nvim",
|
||||
|
||||
{
|
||||
"projekt0n/github-nvim-theme",
|
||||
@@ -37,7 +28,6 @@ return {
|
||||
-- Show buffers like VS Code tabs
|
||||
{
|
||||
"akinsho/bufferline.nvim",
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
event = "VeryLazy",
|
||||
keys = {
|
||||
{ "<leader>bp", "<Cmd>BufferLineTogglePin<CR>", desc = "Toggle buffer-pin" },
|
||||
@@ -84,7 +74,6 @@ return {
|
||||
vim.api.nvim_create_autocmd("BufAdd", {
|
||||
callback = function()
|
||||
vim.schedule(function()
|
||||
---@diagnostic disable-next-line: param-type-mismatch
|
||||
pcall(buf_line)
|
||||
end)
|
||||
end,
|
||||
@@ -95,7 +84,6 @@ return {
|
||||
-- Completely replaces the UI for messages, cmdline and the popupmenu.
|
||||
{
|
||||
"folke/noice.nvim",
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"MunifTanjim/nui.nvim",
|
||||
@@ -166,7 +154,6 @@ return {
|
||||
-- Indent guides for Neovim
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
opts = {
|
||||
indent = { char = "│", tab_char = "│" },
|
||||
scope = { enabled = false },
|
||||
@@ -192,7 +179,6 @@ return {
|
||||
-- Better folds
|
||||
{
|
||||
"kevinhwang91/nvim-ufo",
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"kevinhwang91/promise-async",
|
||||
|
||||
@@ -5,25 +5,8 @@ return {
|
||||
"echasnovski/mini.nvim",
|
||||
version = false,
|
||||
config = function()
|
||||
-- gc
|
||||
require("mini.comment").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 })
|
||||
|
||||
-- mini.surround
|
||||
@@ -97,29 +80,27 @@ return {
|
||||
})
|
||||
|
||||
-- configure mini.indentscope
|
||||
if require("config.util").is_not_vscode() then
|
||||
require("mini.indentscope").setup({
|
||||
delay = 100,
|
||||
symbol = "│",
|
||||
options = { try_as_border = true },
|
||||
})
|
||||
require("mini.indentscope").setup({
|
||||
delay = 100,
|
||||
symbol = "│",
|
||||
options = { try_as_border = true },
|
||||
})
|
||||
|
||||
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
|
||||
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,
|
||||
},
|
||||
|
||||
@@ -128,7 +109,6 @@ return {
|
||||
"folke/snacks.nvim",
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
opts = {
|
||||
bigfile = { enabled = false },
|
||||
dashboard = { enabled = false },
|
||||
@@ -287,7 +267,6 @@ return {
|
||||
-- Kitty isn't available on Windows
|
||||
return vim.loop.os_uname().sysname ~= "Windows_NT"
|
||||
end,
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
build = "cp ./*.py ~/.config/kitty/",
|
||||
keys = {
|
||||
{ "<C-S-h>", "<cmd>KittyNavigateLeft<cr>" },
|
||||
@@ -301,7 +280,6 @@ return {
|
||||
{
|
||||
"mikesmithgh/kitty-scrollback.nvim",
|
||||
lazy = true,
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
cmd = { "KittyScrollbackGenerateKittens", "KittyScrollbackCheckHealth" },
|
||||
event = { "User KittyScrollbackLaunch" },
|
||||
version = "^4.0.0",
|
||||
@@ -318,7 +296,6 @@ return {
|
||||
-- Changes the Nvim root to git root
|
||||
{
|
||||
"airblade/vim-rooter",
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
config = function()
|
||||
vim.g.rooter_cd_cmd = "tcd" -- Use tcd command to change the root
|
||||
vim.g.rooter_patterns = { ".git" }
|
||||
@@ -335,7 +312,6 @@ return {
|
||||
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
dependencies = {
|
||||
"echasnovski/mini.icons",
|
||||
},
|
||||
@@ -368,7 +344,6 @@ return {
|
||||
-- TIP: autocmd to autoload sessions at: ../config/autocmd.lua
|
||||
{
|
||||
"folke/persistence.nvim",
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
event = "BufReadPre",
|
||||
opts = {
|
||||
-- ~/.config/nvim/sessions/
|
||||
|
||||
Reference in New Issue
Block a user