change dotfile manager to tuckr
This commit is contained in:
parent
5efa1c4ce5
commit
f181cd388a
206 changed files with 18 additions and 1329 deletions
32
Configs/nvim_unstable/.config/nvim_unstable/init.lua
Normal file
32
Configs/nvim_unstable/.config/nvim_unstable/init.lua
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
-- Bootstrap lazy.nvim
|
||||
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
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("aleidk.options")
|
||||
require("aleidk.keymaps")
|
||||
|
||||
-- Setup lazy.nvim
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- import your plugins
|
||||
{ import = "aleidk/plugins" },
|
||||
},
|
||||
-- Configure any other settings here. See the documentation for more details.
|
||||
-- colorscheme that will be used when installing plugins.
|
||||
install = { colorscheme = { "habamax" } },
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = true },
|
||||
})
|
||||
31
Configs/nvim_unstable/.config/nvim_unstable/lazy-lock.json
Normal file
31
Configs/nvim_unstable/.config/nvim_unstable/lazy-lock.json
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"catppuccin": { "branch": "main", "commit": "5b5e3aef9ad7af84f463d17b5479f06b87d5c429" },
|
||||
"comment-box.nvim": { "branch": "main", "commit": "06bb771690bc9df0763d14769b779062d8f12bc5" },
|
||||
"conform.nvim": { "branch": "master", "commit": "b1a75324ddf96b7bb84963a297b1ed334db087c0" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
|
||||
"fzf-lua": { "branch": "main", "commit": "6488ada2f376e47789391dc353b6d91a3f9de6f6" },
|
||||
"grapple.nvim": { "branch": "main", "commit": "b41ddfc1c39f87f3d1799b99c2f0f1daa524c5f7" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" },
|
||||
"mini.nvim": { "branch": "main", "commit": "0420076298c4457f200c2de468f65d080597a347" },
|
||||
"neogen": { "branch": "main", "commit": "b2e78708876f4da507839726816010a68e33fec8" },
|
||||
"nvim-lint": { "branch": "master", "commit": "93b8040115c9114dac1047311763bef275e752dc" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "ff6471d4f837354d8257dfa326b031dd8858b16e" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "9be6836ebeb88a536055bf1ce0961eef68da4bc6" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "93b29a32d5f4be10e39226c6b796f28d68a8b483" },
|
||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "4c3a5848ee0b09ecdea73adcd2a689190aeb728c" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
||||
"remote-sshfs.nvim": { "branch": "main", "commit": "1ae5784bf0729c8b03cb7fe6561508a673c9adc8" },
|
||||
"render-markdown": { "branch": "main", "commit": "92256e02db70c474f97fc461b6b6bc4aff7a499a" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "a4ed82509cecc56df1c7138920a1aeaf246c0ac5" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" },
|
||||
"ts-node-action": { "branch": "master", "commit": "bfaa787cc85d753af3c19245b4142ed727a534b5" },
|
||||
"typescript-tools.nvim": { "branch": "master", "commit": "e0887c1e336edbb01243e9f1e60d74b0bc0a2bed" },
|
||||
"vim-dadbod": { "branch": "master", "commit": "9f0ca8bcef704659820a95c3bbd2c262583a66a1" },
|
||||
"vim-dadbod-completion": { "branch": "master", "commit": "a8dac0b3cf6132c80dc9b18bef36d4cf7a9e1fe6" },
|
||||
"vim-dadbod-ui": { "branch": "master", "commit": "685e75b34ee0e12f92ec4507ea8bb7f1aaa936e5" },
|
||||
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
|
||||
"yazi.nvim": { "branch": "main", "commit": "aae26f6794c2afe2054a0782fb0ff07b2cd2876c" }
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
cmd = { "rust-analyzer" },
|
||||
filetypes = { 'rust' },
|
||||
root_markers = { "cargo.toml" },
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
callback = function(args)
|
||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
|
||||
if not client then
|
||||
return
|
||||
end
|
||||
|
||||
-- Prefer LSP folding if client supports it
|
||||
if client:supports_method('textDocument/foldingRange') then
|
||||
local win = vim.api.nvim_get_current_win()
|
||||
vim.wo[win][0].foldexpr = 'v:lua.vim.lsp.foldexpr()'
|
||||
end
|
||||
|
||||
if client:supports_method 'textDocument/completion' then
|
||||
vim.lsp.completion.enable(true, client.id, args.buf, { autotrigger = true })
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
return {
|
||||
icons = {
|
||||
misc = {
|
||||
pint = " ",
|
||||
},
|
||||
dap = {
|
||||
Stopped = { " ", "DiagnosticWarn", "DapStoppedLine" },
|
||||
Breakpoint = " ",
|
||||
BreakpointCondition = " ",
|
||||
BreakpointRejected = { " ", "DiagnosticError" },
|
||||
LogPoint = ".>",
|
||||
},
|
||||
diagnostics = {
|
||||
Error = " ",
|
||||
Warn = " ",
|
||||
Hint = " ",
|
||||
Info = " ",
|
||||
},
|
||||
git = {
|
||||
added = " ",
|
||||
modified = " ",
|
||||
removed = " ",
|
||||
branch = "",
|
||||
},
|
||||
kinds = {
|
||||
Array = " ",
|
||||
Boolean = " ",
|
||||
Class = " ",
|
||||
Color = " ",
|
||||
Constant = " ",
|
||||
Constructor = " ",
|
||||
Copilot = " ",
|
||||
Enum = " ",
|
||||
EnumMember = " ",
|
||||
Event = " ",
|
||||
Field = " ",
|
||||
File = " ",
|
||||
Folder = " ",
|
||||
Function = " ",
|
||||
Interface = " ",
|
||||
Key = " ",
|
||||
Keyword = " ",
|
||||
Method = " ",
|
||||
Module = " ",
|
||||
Namespace = " ",
|
||||
Null = " ",
|
||||
Number = " ",
|
||||
Object = " ",
|
||||
Operator = " ",
|
||||
Package = " ",
|
||||
Property = " ",
|
||||
Reference = " ",
|
||||
Snippet = " ",
|
||||
String = " ",
|
||||
Struct = " ",
|
||||
Text = " ",
|
||||
TypeParameter = " ",
|
||||
Unit = " ",
|
||||
Value = " ",
|
||||
Variable = " ",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
-- stylua: ignore start
|
||||
-- QoL normalization's
|
||||
vim.keymap.set("n", "Q", "<nop>", {})
|
||||
vim.keymap.set({ "n", "v" }, "<Space>", "<Nop>", { desc = "Prevent cursor movement", silent = true })
|
||||
vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'",
|
||||
{ desc = "Move cursor regardless of word wrap", expr = true, silent = true })
|
||||
vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'",
|
||||
{ desc = "Move cursor regardless of word wrap", expr = true, silent = true })
|
||||
vim.keymap.set("n", "J", "mzJ`z", { desc = "Keep cursor in column while joining lines", silent = true })
|
||||
|
||||
-- vim.keymap.set("n", "<C-d>", "<C-d>zz", { desc = "Keep cursor centered while junping", silent = true })
|
||||
-- vim.keymap.set("n", "<C-u>", "<C-u>zz", { desc = "Keep cursor centered while junping", silent = true })
|
||||
-- vim.keymap.set("n", "n", "nzzzv", { desc = "Keep cursor centered while searching", silent = true })
|
||||
-- vim.keymap.set("n", "N", "Nzzzv", { desc = "Keep cursor centered while searching", silent = true })
|
||||
|
||||
-- Utils
|
||||
vim.keymap.set("n", "|", ":vs<CR>", { desc = "Create vsplit", silent = true })
|
||||
vim.keymap.set("n", "°", ":sp<CR>", { desc = "Create split", silent = true })
|
||||
|
||||
vim.keymap.set("v", "p", [["_dP]], { desc = "Paste without lossing yanked text", silent = true })
|
||||
vim.keymap.set("n", "<Leader>uh", ":nohl<CR>", { desc = "Remove search highlight", silent = true })
|
||||
|
||||
-- Buffer manipulation
|
||||
vim.keymap.set("n", "<leader>bc", "<Cmd>bd<CR>", { desc = "Close buffer", silent = true })
|
||||
vim.keymap.set("n", "<leader>bh", "<Cmd>bp<CR>", { desc = "Prev buffer", silent = true })
|
||||
vim.keymap.set("n", "<leader>bl", "<Cmd>bn<CR>", { desc = "Next buffer", silent = true })
|
||||
vim.keymap.set("n", "<leader>bA", "<Cmd>bufdo bd<CR>", { desc = "Close all buffers", silent = true })
|
||||
|
||||
vim.keymap.set("n", "<C-h>", "<C-w>h", { desc = "Move to left window", silent = true })
|
||||
vim.keymap.set("n", "<C-j>", "<C-w>j", { desc = "Move to bottom window", silent = true })
|
||||
vim.keymap.set("n", "<C-k>", "<C-w>k", { desc = "Move to top window", silent = true })
|
||||
vim.keymap.set("n", "<C-l>", "<C-w>l", { desc = "Move to right window", silent = true })
|
||||
|
||||
-- stylua: ignore end
|
||||
|
|
@ -0,0 +1,161 @@
|
|||
-- [[ Setting options ]]
|
||||
-- See `:help vim.o`
|
||||
|
||||
-- Set <space> as the leader key
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
vim.o.diffopt = "vertical,closeoff,filler"
|
||||
|
||||
local opt = vim.opt
|
||||
|
||||
vim.schedule(function()
|
||||
vim.opt.clipboard = 'unnamedplus'
|
||||
end)
|
||||
|
||||
vim.o.winborder = 'rounded'
|
||||
opt.breakindent = true -- Every wrapped line will continue visually indented
|
||||
opt.autowrite = true -- Enable auto write
|
||||
-- opt.completeopt = "menu,menuone,noselect"
|
||||
vim.o.completeopt = 'noselect,menu,menuone,noinsert,popup'
|
||||
opt.conceallevel = 2 -- Hide * markup for bold and italic
|
||||
opt.confirm = true -- Confirm to save changes before exiting modified buffer
|
||||
opt.cursorline = true -- Enable highlighting of the current line
|
||||
opt.expandtab = true -- Use spaces instead of tabs
|
||||
opt.formatoptions = "jcroqlnt" -- tcqj
|
||||
opt.grepformat = "%f:%l:%c:%m"
|
||||
opt.grepprg = "rg --vimgrep"
|
||||
opt.ignorecase = true -- Ignore case
|
||||
opt.inccommand = "nosplit" -- preview incremental substitute
|
||||
opt.laststatus = 0
|
||||
vim.opt.list = true -- Sets how neovim will display certain whitespace characters in the editor.
|
||||
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
|
||||
opt.mouse = "a" -- Enable mouse mode
|
||||
opt.number = true -- Print line number
|
||||
opt.pumblend = 10 -- Popup blend
|
||||
opt.pumheight = 10 -- Maximum number of entries in a popup
|
||||
opt.relativenumber = true -- Relative line numbers
|
||||
opt.scrolloff = 15 -- Lines of context
|
||||
opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize" }
|
||||
opt.shiftround = true -- Round indent
|
||||
opt.shiftwidth = 2 -- Size of an indent
|
||||
-- opt.shortmess:append({ W = true, I = true, c = true }) -- INFO: this control the format of some messages
|
||||
opt.showmode = false -- Don't show mode since we have a statusline
|
||||
opt.sidescrolloff = 8 -- Columns of context
|
||||
opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time
|
||||
opt.smartcase = true -- Don't ignore case with capitals
|
||||
opt.smartindent = true -- Insert indents automatically
|
||||
opt.spelllang = { "en" }
|
||||
opt.splitbelow = true -- Put new windows below current
|
||||
opt.splitright = true -- Put new windows right of current
|
||||
opt.tabstop = 2 -- Number of spaces tabs count for
|
||||
opt.termguicolors = true -- True color support
|
||||
opt.timeoutlen = 300
|
||||
opt.undofile = true
|
||||
opt.undolevels = 10000
|
||||
opt.updatetime = 200 -- Save swap file and trigger CursorHold
|
||||
opt.wildmode = "longest,list:full" -- Command-line completion mode
|
||||
opt.winminwidth = 5 -- Minimum window width
|
||||
opt.wrap = false -- Disable line wrap
|
||||
vim.opt.inccommand = 'split' -- Preview substitutions live, as you type!
|
||||
|
||||
vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
|
||||
|
||||
-- Nice and simple folding:
|
||||
vim.o.foldenable = true
|
||||
vim.o.foldlevel = 99
|
||||
vim.o.foldmethod = "expr"
|
||||
vim.o.foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
||||
vim.opt.fillchars:append({ fold = " " })
|
||||
|
||||
local fn = vim.fn
|
||||
|
||||
-- Quickfix customization
|
||||
function _G.qftf(info)
|
||||
local items
|
||||
local ret = {}
|
||||
-- The name of item in list is based on the directory of quickfix window.
|
||||
-- Change the directory for quickfix window make the name of item shorter.
|
||||
-- It's a good opportunity to change current directory in quickfixtextfunc :)
|
||||
--
|
||||
-- local alterBufnr = fn.bufname('#') -- alternative buffer is the buffer before enter qf window
|
||||
-- local root = getRootByAlterBufnr(alterBufnr)
|
||||
-- vim.cmd(('noa lcd %s'):format(fn.fnameescape(root)))
|
||||
--
|
||||
if info.quickfix == 1 then
|
||||
items = fn.getqflist({ id = info.id, items = 0 }).items
|
||||
else
|
||||
items = fn.getloclist(info.winid, { id = info.id, items = 0 }).items
|
||||
end
|
||||
local limit = 31
|
||||
local fnameFmt1, fnameFmt2 = "%-" .. limit .. "s", "…%." .. (limit - 1) .. "s"
|
||||
local validFmt = "%s │%5d:%-3d│%s %s"
|
||||
for i = info.start_idx, info.end_idx do
|
||||
local e = items[i]
|
||||
local fname = ""
|
||||
local str
|
||||
if e.valid == 1 then
|
||||
if e.bufnr > 0 then
|
||||
fname = fn.bufname(e.bufnr)
|
||||
if fname == "" then
|
||||
fname = "[No Name]"
|
||||
else
|
||||
fname = fname:gsub("^" .. vim.env.HOME, "~")
|
||||
end
|
||||
-- char in fname may occur more than 1 width, ignore this issue in order to keep performance
|
||||
if #fname <= limit then
|
||||
fname = fnameFmt1:format(fname)
|
||||
else
|
||||
fname = fnameFmt2:format(fname:sub(1 - limit))
|
||||
end
|
||||
end
|
||||
local lnum = e.lnum > 99999 and -1 or e.lnum
|
||||
local col = e.col > 999 and -1 or e.col
|
||||
local qtype = e.type == "" and "" or " " .. e.type:sub(1, 1):upper()
|
||||
str = validFmt:format(fname, lnum, col, qtype, e.text)
|
||||
else
|
||||
str = e.text
|
||||
end
|
||||
table.insert(ret, str)
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
-- TODO: how to customize?
|
||||
vim.o.qftf = "{info -> v:lua._G.qftf(info)}"
|
||||
|
||||
vim.filetype.add({
|
||||
-- Detect and assign filetype based on the extension of the filename
|
||||
extension = {
|
||||
mdx = "mdx",
|
||||
log = "log",
|
||||
conf = "conf",
|
||||
env = "dotenv",
|
||||
},
|
||||
-- Detect and apply filetypes based on the entire filename
|
||||
filename = {
|
||||
[".env"] = "dotenv",
|
||||
["env"] = "dotenv",
|
||||
["tsconfig.json"] = "jsonc",
|
||||
},
|
||||
-- Detect and apply filetypes based on certain patterns of the filenames
|
||||
pattern = {
|
||||
-- INFO: Match filenames like - ".env.example", ".env.local" and so on
|
||||
["%.env%.[%w_.-]+"] = "dotenv",
|
||||
[".*%.blade%.php"] = "blade",
|
||||
[".*%.hurl.*"] = "hurl",
|
||||
[".*/hypr/.*%.conf"] = "hyprlang",
|
||||
},
|
||||
})
|
||||
|
||||
-- ╭─────────────────────────────────────────────────────────╮
|
||||
-- │ LSP │
|
||||
-- ╰─────────────────────────────────────────────────────────╯
|
||||
|
||||
vim.lsp.enable({
|
||||
"rust_analyzer"
|
||||
})
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_lines = { current_line = true }
|
||||
})
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
local function select_or_create(search)
|
||||
local grapple = require("grapple")
|
||||
|
||||
if grapple.exists(search) then
|
||||
grapple.select(search)
|
||||
else
|
||||
grapple.tag()
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
"cbochs/grapple.nvim",
|
||||
dependencies = {
|
||||
{ "nvim-tree/nvim-web-devicons", lazy = true },
|
||||
},
|
||||
lazy = false,
|
||||
cmd = "Grapple",
|
||||
config = function()
|
||||
local telescope = require("telescope")
|
||||
telescope.load_extension("grapple")
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader><leader>a", "<cmd>Grapple toggle<cr>", desc = "Toggle bookmark for current file" },
|
||||
{ "<leader><leader>D", "<cmd>Grapple reset<cr>", desc = "Delete all bookmarks" },
|
||||
{ "<leader><leader>t", "<cmd>Grapple toggle_tags<cr>", desc = "Toggle bookmarks window" },
|
||||
{ "<leader><leader>T", "<cmd>Grapple toggle_scopes<cr>", desc = "Toggle scopes window" },
|
||||
{ "<leader><leader>n", "<cmd>Grapple cycle forward<cr>", desc = "Next bookmark" },
|
||||
{ "<leader><leader>N", "<cmd>Grapple cycle backward<cr>", desc = "Prev bookmark" },
|
||||
{ "<leader><leader>j", function() select_or_create({ index = 1 }) end, desc = "Go or create bookmark 1" },
|
||||
{ "<leader><leader>k", function() select_or_create({ index = 2 }) end, desc = "Go or create bookmark 2" },
|
||||
{ "<leader><leader>l", function() select_or_create({ index = 3 }) end, desc = "Go or create bookmark 3" },
|
||||
{ "<leader><leader>ñ", function() select_or_create({ index = 4 }) end, desc = "Go or create bookmark 4" },
|
||||
{ "<leader><leader>J", "<cmd>Grapple tag index=1<cr>", desc = "Override bookmark 1" },
|
||||
{ "<leader><leader>K", "<cmd>Grapple tag index=2<cr>", desc = "Override bookmark 2" },
|
||||
{ "<leader><leader>L", "<cmd>Grapple tag index=3<cr>", desc = "Override bookmark 3" },
|
||||
{ "<leader><leader>Ñ", "<cmd>Grapple tag index=4<cr>", desc = "Override bookmark 4" },
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
return { -- Change colors.none if not using a transparent background
|
||||
"catppuccin/nvim",
|
||||
name = "catppuccin",
|
||||
priority = 1000,
|
||||
config = function()
|
||||
local utils = require("catppuccin.utils.colors")
|
||||
|
||||
local opts = {
|
||||
flavour = "macchiato",
|
||||
transparent_background = true,
|
||||
integrations = {
|
||||
aerial = true,
|
||||
blink_cmp = true,
|
||||
cmp = true,
|
||||
gitsigns = true,
|
||||
indent_blankline = { enabled = true, scope_color = "text", },
|
||||
lsp_trouble = true,
|
||||
mason = true,
|
||||
noice = true,
|
||||
notify = true,
|
||||
mini = {
|
||||
enabled = true,
|
||||
indentscope_color = "",
|
||||
},
|
||||
},
|
||||
custom_highlights = function(colors)
|
||||
return {
|
||||
-- Fix colors for cmp
|
||||
Pmenu = { bg = colors.none, blend = 0 },
|
||||
FloatBorder = { bg = colors.none },
|
||||
CmpItemMenu = { fg = colors.text, bg = colors.none },
|
||||
-- dadbod-ui
|
||||
NotificationInfo = { bg = colors.none, fg = colors.text },
|
||||
NotificationWarning = { bg = colors.none, fg = colors.yellow },
|
||||
NotificationError = { bg = colors.none, fg = colors.red },
|
||||
|
||||
-- for word diff in previews
|
||||
GitSignsAddInline = {
|
||||
fg = colors.teal,
|
||||
bg = utils.darken(colors.teal, 0.4),
|
||||
style = { "bold" },
|
||||
},
|
||||
GitSignsDeleteInline = {
|
||||
fg = colors.red,
|
||||
bg = utils.darken(colors.red, 0.4),
|
||||
style = { "bold" },
|
||||
},
|
||||
GitSignsChangeInline = {
|
||||
fg = colors.mauve,
|
||||
bg = utils.darken(colors.mauve, 0.4),
|
||||
style = { "bold" },
|
||||
},
|
||||
GitSignsDeleteVirtLn = { bg = colors.none, fg = colors.red },
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
||||
require("catppuccin").setup(opts)
|
||||
vim.cmd.colorscheme("catppuccin-macchiato")
|
||||
end,
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
return {
|
||||
{
|
||||
"LudoPinelli/comment-box.nvim",
|
||||
opts = {
|
||||
outer_blank_lines = true,
|
||||
},
|
||||
keys = {
|
||||
{ "gcb", function() require("comment-box").lcbox() end, { desc = "Create a comment box", mode = { "n", "v" }, } },
|
||||
{ "gcl", function() require("comment-box").llline() end, { desc = "Create a comment line", mode = { "n", "v" }, } },
|
||||
},
|
||||
},
|
||||
{
|
||||
"danymat/neogen",
|
||||
opts = { snippet_engine = "nvim" },
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
||||
version = "*", -- stable releases
|
||||
keys = {
|
||||
{
|
||||
"gcd",
|
||||
function()
|
||||
require("neogen").generate()
|
||||
end,
|
||||
desc = "Generate comment docstring",
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
return {
|
||||
"kristijanhusak/vim-dadbod-ui",
|
||||
dependencies = {
|
||||
{ "tpope/vim-dadbod", lazy = true },
|
||||
{ "kristijanhusak/vim-dadbod-completion", ft = { "sql", "mysql", "plsql" }, lazy = true },
|
||||
},
|
||||
cmd = {
|
||||
"DBUI",
|
||||
"DBUIToggle",
|
||||
"DBUIAddConnection",
|
||||
"DBUIFindBuffer",
|
||||
},
|
||||
keys = {
|
||||
{ "<Leader>ud", "<CMD>DBUIToggle<CR>", desc = "Toggle DB UI" },
|
||||
},
|
||||
init = function()
|
||||
-- Your DBUI configuration
|
||||
vim.g.db_ui_use_nerd_fonts = 1
|
||||
vim.g.db_ui_force_echo_notifications = 1
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = {
|
||||
"sql",
|
||||
"mysql",
|
||||
"plsql",
|
||||
},
|
||||
command = [[setlocal omnifunc=vim_dadbod_completion#omni]],
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = {
|
||||
"sql",
|
||||
"mysql",
|
||||
"plsql",
|
||||
},
|
||||
callback = function()
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
require("cmp").setup.buffer({
|
||||
sources = { { name = "vim-dadbod-completion" }, { name = "buffer" } },
|
||||
})
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
return {
|
||||
"mikavilpas/yazi.nvim",
|
||||
keys = {
|
||||
{
|
||||
"<leader>E",
|
||||
"<cmd>Yazi<cr>",
|
||||
desc = "Open yazi at the current file",
|
||||
},
|
||||
-- {
|
||||
-- -- Open in the current working directory
|
||||
-- "<leader>E",
|
||||
-- "<cmd>Yazi cwd<cr>",
|
||||
-- desc = "Open the file manager in nvim's working directory",
|
||||
-- },
|
||||
},
|
||||
opts = {
|
||||
-- if you want to open yazi instead of netrw, see below for more info
|
||||
open_for_directories = true,
|
||||
open_multiple_tabs = true,
|
||||
floating_window_scaling_factor = 1,
|
||||
keymaps = {
|
||||
show_help = '<f1>',
|
||||
open_file_in_vertical_split = '<c-v>',
|
||||
open_file_in_horizontal_split = '<c-s>',
|
||||
open_file_in_tab = '<c-t>',
|
||||
grep_in_directory = '<c-w>',
|
||||
cycle_open_buffers = '<tab>',
|
||||
copy_relative_path_to_selected_files = '<c-y>',
|
||||
send_to_quickfix_list = '<c-q>',
|
||||
change_working_directory = "<c-\\>",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,121 @@
|
|||
return {
|
||||
"stevearc/conform.nvim",
|
||||
event = { "BufWritePre" },
|
||||
cmd = { "ConformInfo" },
|
||||
opts = {
|
||||
-- See available formatters in: https://github.com/stevearc/conform.nvim#formatters
|
||||
-- Formatters can be installed by mason
|
||||
formatters_by_ft = {
|
||||
-- Conform will run multiple formatters sequentially
|
||||
-- Use a stop_after_first = true to run only the first available formatters
|
||||
-- Use the "_" filetype to run formatters on filetypes that don't
|
||||
-- have other formatters configured.
|
||||
["_"] = { "trim_whitespace" },
|
||||
blade = { "blade-formatter" },
|
||||
css = { "biome" },
|
||||
go = { "gofumpt", "goimports_reviser", "golines" },
|
||||
html = { "djlint", "prettierd", stop_after_first = true },
|
||||
htmldjango = { "djlint", stop_after_first = true },
|
||||
javascript = { "biome" },
|
||||
javascriptreact = { "biome" },
|
||||
json = { "biome" },
|
||||
jsonc = { "biome" },
|
||||
lua = { "stylua" },
|
||||
markdown = { "markdownlint" },
|
||||
php = { "pint" },
|
||||
python = { "ruff_format", "ruff_organize_imports" },
|
||||
scss = { "biome", "prettierd", "prettier", stop_after_first = true },
|
||||
sh = { "shfmt" },
|
||||
toml = { "taplo" },
|
||||
typescript = { "biome" },
|
||||
typescriptreact = { "biome" },
|
||||
xml = { "lemminx" },
|
||||
zsh = { "shfmt" },
|
||||
sql = { "sleek" }
|
||||
},
|
||||
formatters = {
|
||||
djlint = {
|
||||
prepend_args = {
|
||||
"--format-css",
|
||||
"--indent-css",
|
||||
"2",
|
||||
"--format-js",
|
||||
"--indent-js",
|
||||
"2",
|
||||
"--indent",
|
||||
"2",
|
||||
"--preserve-blank-lines",
|
||||
"--quiet"
|
||||
}
|
||||
}
|
||||
},
|
||||
format_on_save = function(bufnr)
|
||||
-- Disable with a global or buffer-local variable
|
||||
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||
return
|
||||
end
|
||||
|
||||
return { timeout_ms = 2000, lsp_fallback = true }
|
||||
end,
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("conform").setup(opts)
|
||||
|
||||
local function toggleAutoFormat()
|
||||
-- to make this global, change b to g
|
||||
if vim.b.disable_autoformat == nil then
|
||||
vim.b.disable_autoformat = true
|
||||
print("Autoformat set to: " .. tostring(not vim.b.disable_autoformat))
|
||||
return
|
||||
end
|
||||
|
||||
vim.b.disable_autoformat = not vim.b.disable_autoformat
|
||||
print("Autoformat set to: " .. tostring(not vim.b.disable_autoformat))
|
||||
end
|
||||
|
||||
MAP("n", "<leader>uf", toggleAutoFormat, "Toggle auto format")
|
||||
|
||||
vim.api.nvim_create_user_command("Fmt", function(args)
|
||||
local range = nil
|
||||
if args.count ~= -1 then
|
||||
local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
|
||||
range = {
|
||||
start = { args.line1, 0 },
|
||||
["end"] = { args.line2, end_line:len() },
|
||||
}
|
||||
end
|
||||
|
||||
local function callback(err, did_edit)
|
||||
if not did_edit then
|
||||
vim.notify("The file was not formatted:\n" .. tostring(err), vim.log.levels.ERROR)
|
||||
return
|
||||
end
|
||||
|
||||
if args.bang then
|
||||
vim.cmd("w")
|
||||
end
|
||||
end
|
||||
|
||||
require("conform").format(
|
||||
{
|
||||
async = true,
|
||||
lsp_format = "fallback",
|
||||
range = range,
|
||||
formatters = args.fargs
|
||||
},
|
||||
callback
|
||||
)
|
||||
end, {
|
||||
range = true,
|
||||
bang = true,
|
||||
force = true,
|
||||
desc = "Format the document",
|
||||
nargs = '*',
|
||||
-- complete = function()
|
||||
-- local formatters = require('conform').formatters_by_ft
|
||||
--
|
||||
-- return vim.tbl_keys(formatters)
|
||||
-- end
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
return {
|
||||
"ibhagwan/fzf-lua",
|
||||
dependencies = { "echasnovski/mini.nvim" },
|
||||
opts = {},
|
||||
keys = {
|
||||
{ "<leader>ff", function() require("fzf-lua").files() end, desc = "Find files" },
|
||||
{ "<leader>fb", function() require("fzf-lua").buffers() end, desc = "Find buffers" },
|
||||
{ "<leader>fw", function() require("fzf-lua").grep_cword() end, desc = "Find word under cursor" },
|
||||
{ "<leader>fW", function() require("fzf-lua").live_grep_native() end, desc = "Find word (live grep)" },
|
||||
{ "<leader>fw", function() require("fzf-lua").grep_visual() end, desc = "Find selection", mode = { "v" } },
|
||||
{ "<leader>fw", function() require("fzf-lua").grep_cword() end, desc = "Find word under cursor" },
|
||||
|
||||
{ "<leader>fg", function() require("fzf-lua").git_bcommits() end, desc = "Find commit log for current buffer" },
|
||||
|
||||
{ "<leader>fl", function() require("fzf-lua").lsp_document_symbols() end, desc = "Find LSP Symbols" },
|
||||
|
||||
{ "<leader>fr", function() require("fzf-lua").registers() end, desc = "Find registers" },
|
||||
{ "<leader>fk", function() require("fzf-lua").keymaps() end, desc = "Find keymaps" },
|
||||
{ "<leader>fh", function() require("fzf-lua").helptags() end, desc = "Find help tags" },
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
return {
|
||||
-- Add indentation guides even on blank lines
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
||||
main = "ibl",
|
||||
opts = {
|
||||
-- char = "▏",
|
||||
indent = {
|
||||
char = "│",
|
||||
tab_char = "│",
|
||||
},
|
||||
scope = {
|
||||
enabled = true,
|
||||
},
|
||||
exclude = {
|
||||
filetypes = {
|
||||
"help",
|
||||
"alpha",
|
||||
"dashboard",
|
||||
"neo-tree",
|
||||
"Trouble",
|
||||
"lazy",
|
||||
"mason",
|
||||
"notify",
|
||||
"toggleterm",
|
||||
"lazyterm",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
return {
|
||||
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
|
||||
{ "nvim-tree/nvim-web-devicons", lazy = true },
|
||||
{
|
||||
"ckolkey/ts-node-action",
|
||||
dependencies = { "nvim-treesitter" },
|
||||
opts = {},
|
||||
keys = {
|
||||
{ "<leader>ls", function() require("ts-node-action").node_action() end, desc = "Node Action" }
|
||||
}
|
||||
},
|
||||
{
|
||||
-- `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" } }
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
return {
|
||||
"mfussenegger/nvim-lint",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
local lint = require("lint")
|
||||
|
||||
lint.linters.gitlint.stdin = true
|
||||
lint.linters.gitlint.args = { "--contrib", "contrib-title-conventional-commits", "--msg-filename", "-" }
|
||||
|
||||
lint.linters_by_ft = {
|
||||
-- astro = { "eslint_d" },
|
||||
python = { "ruff" },
|
||||
sh = { "shellcheck" },
|
||||
NeogitCommitMessage = { "gitlint" },
|
||||
gitcommit = { "gitlint" },
|
||||
markdown = { "markdownlint" },
|
||||
}
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||
callback = function()
|
||||
require("lint").try_lint()
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
return {
|
||||
{
|
||||
"MeanderingProgrammer/markdown.nvim",
|
||||
name = "render-markdown", -- Only needed if you have another plugin named markdown.nvim
|
||||
dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' }, -- if you use the mini.nvim suite
|
||||
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins
|
||||
opts = {
|
||||
file_types = { 'markdown' },
|
||||
sign = {
|
||||
enabled = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,201 @@
|
|||
return {
|
||||
'echasnovski/mini.nvim',
|
||||
version = '*',
|
||||
dependencies = {
|
||||
"rafamadriz/friendly-snippets",
|
||||
},
|
||||
config = function()
|
||||
require('mini.icons').setup()
|
||||
require('mini.bracketed').setup() -- [] movement for various stuff
|
||||
require("mini.ai").setup({})
|
||||
require('mini.cursorword').setup() -- Highlight word under cursor
|
||||
require('mini.extra').setup()
|
||||
require('mini.jump').setup() -- Extend f, F, t, T
|
||||
require('mini.surround').setup()
|
||||
require('mini.operators').setup()
|
||||
require('mini.pairs').setup()
|
||||
require('mini.splitjoin').setup()
|
||||
require("mini.align").setup({})
|
||||
require('mini.animate').setup()
|
||||
require('mini.notify').setup({
|
||||
-- Notifications about LSP progress
|
||||
lsp_progress = {
|
||||
-- Whether to enable showing
|
||||
enable = false,
|
||||
}
|
||||
})
|
||||
vim.notify = require('mini.notify').make_notify()
|
||||
require('mini.starter').setup()
|
||||
require('mini.statusline').setup({})
|
||||
require('mini.diff').setup({ view = { style = 'sign' } })
|
||||
|
||||
require('mini.git').setup({})
|
||||
|
||||
local rhs = '<Cmd>lua MiniGit.show_at_cursor()<CR>'
|
||||
vim.keymap.set({ 'n', 'x' }, '<Leader>gs', rhs, { desc = 'Show at cursor', silent = true })
|
||||
|
||||
local starter = require('mini.starter')
|
||||
starter.setup({
|
||||
footer = '',
|
||||
evaluate_single = true,
|
||||
items = {
|
||||
starter.sections.recent_files(10, true),
|
||||
starter.sections.pick(),
|
||||
starter.sections.builtin_actions(),
|
||||
},
|
||||
content_hooks = {
|
||||
starter.gen_hook.adding_bullet(),
|
||||
starter.gen_hook.indexing('all', { 'Builtin actions' }),
|
||||
starter.gen_hook.aligning("center", "center"),
|
||||
},
|
||||
})
|
||||
|
||||
require('mini.indentscope').setup({
|
||||
draw = {
|
||||
animation = require('mini.indentscope').gen_animation.none(),
|
||||
},
|
||||
})
|
||||
|
||||
require('mini.files').setup({
|
||||
mappings = {
|
||||
go_in = 'L',
|
||||
go_in_plus = 'l',
|
||||
},
|
||||
windows = {
|
||||
preview = true,
|
||||
width_preview = 75,
|
||||
}
|
||||
})
|
||||
vim.keymap.set('n', '<Leader>e', ":lua MiniFiles.open(vim.api.nvim_buf_get_name(0))<CR>",
|
||||
{ desc = 'Show at cursor', silent = true })
|
||||
|
||||
require('mini.move').setup({
|
||||
mappings = {
|
||||
-- Move visual selection in Visual mode
|
||||
left = 'H',
|
||||
right = 'L',
|
||||
down = 'J',
|
||||
up = 'K',
|
||||
|
||||
-- Move current line in Normal mode
|
||||
line_left = '',
|
||||
line_right = '',
|
||||
line_down = '',
|
||||
line_up = '',
|
||||
},
|
||||
})
|
||||
require('mini.comment').setup({
|
||||
options = {
|
||||
-- Whether to ignore blank lines when commenting
|
||||
ignore_blank_line = true,
|
||||
-- Whether to ignore blank lines in actions and textobject
|
||||
start_of_line = true,
|
||||
},
|
||||
})
|
||||
|
||||
local gen_loader = require('mini.snippets').gen_loader
|
||||
require('mini.snippets').setup({
|
||||
snippets = {
|
||||
-- Load custom file with global snippets first (adjust for Windows)
|
||||
gen_loader.from_file('~/.config/nvim-unstable/snippets/global.json'),
|
||||
|
||||
-- Load snippets based on current language by reading files from
|
||||
-- "snippets/" subdirectories from 'runtimepath' directories.
|
||||
gen_loader.from_lang(),
|
||||
},
|
||||
})
|
||||
|
||||
local miniclue = require("mini.clue")
|
||||
miniclue.setup({
|
||||
triggers = {
|
||||
-- Leader triggers
|
||||
{ mode = "n", keys = "<Leader>" },
|
||||
{ mode = "v", keys = "<Leader>" },
|
||||
{ mode = "x", keys = "<Leader>" },
|
||||
|
||||
-- Built-in completion
|
||||
{ mode = "i", keys = "<C-x>" },
|
||||
|
||||
-- `g` key
|
||||
{ mode = "n", keys = "g" },
|
||||
{ mode = "x", keys = "g" },
|
||||
|
||||
-- Marks
|
||||
{ mode = "n", keys = "'" },
|
||||
{ mode = "n", keys = "`" },
|
||||
{ mode = "x", keys = "'" },
|
||||
{ mode = "x", keys = "`" },
|
||||
|
||||
-- Registers
|
||||
{ mode = "n", keys = '"' },
|
||||
{ mode = "x", keys = '"' },
|
||||
{ mode = "i", keys = "<C-r>" },
|
||||
{ mode = "c", keys = "<C-r>" },
|
||||
|
||||
-- Window commands
|
||||
{ mode = "n", keys = "<C-w>" },
|
||||
|
||||
-- `z` key
|
||||
{ mode = "n", keys = "z" },
|
||||
{ mode = "x", keys = "z" },
|
||||
},
|
||||
|
||||
-- Add a "postkeys" value to activate those keys after others
|
||||
clues = {
|
||||
miniclue.gen_clues.builtin_completion(),
|
||||
miniclue.gen_clues.g(),
|
||||
miniclue.gen_clues.marks(),
|
||||
miniclue.gen_clues.registers(),
|
||||
miniclue.gen_clues.windows(),
|
||||
miniclue.gen_clues.z(),
|
||||
|
||||
{ mode = "n", keys = "<Leader><Leader>", desc = "+Bookmarks" },
|
||||
{ mode = "n", keys = "<Leader><Leader>n", postkeys = "<Leader><Leader>" },
|
||||
{ mode = "n", keys = "<Leader><Leader>N", postkeys = "<Leader><Leader>" },
|
||||
{ mode = "n", keys = "<Leader>b", desc = "+Buffers" },
|
||||
{ mode = "n", keys = "<Leader>bh", postkeys = "<Leader>b" },
|
||||
{ mode = "n", keys = "<Leader>bl", postkeys = "<Leader>b" },
|
||||
{ mode = "n", keys = "<Leader>f", desc = "+Find" },
|
||||
{ mode = "n", keys = "<Leader>g", desc = "+Git" },
|
||||
{ mode = "n", keys = "<Leader>l", desc = "+LSP" },
|
||||
{ mode = "n", keys = "<Leader>r", desc = "+Replace" },
|
||||
{ mode = "n", keys = "<Leader>u", desc = "+UI & Config" },
|
||||
{ mode = "n", keys = "<Leader>un", desc = "+Noice" },
|
||||
{ mode = "n", keys = "<Leader>w", desc = "+Workspace" },
|
||||
{ mode = "n", keys = "<Leader>p", desc = "+Run stuff" },
|
||||
{ mode = "n", keys = "<Leader>z", desc = "+ZK" },
|
||||
{ mode = "v", keys = "<Leader>z", desc = "+ZK" },
|
||||
{ mode = "v", keys = "<Leader>a", desc = "+AI" },
|
||||
{ mode = "n", keys = "<Leader>a", desc = "+AI" },
|
||||
{ mode = "n", keys = "g?", desc = "+Print Debug" },
|
||||
},
|
||||
|
||||
-- Clue window settings
|
||||
window = {
|
||||
-- Floating window config
|
||||
config = {
|
||||
width = "auto",
|
||||
},
|
||||
-- Delay before showing clue window
|
||||
delay = 200,
|
||||
-- Keys to scroll inside the clue window
|
||||
scroll_down = "<C-d>",
|
||||
scroll_up = "<C-u>",
|
||||
},
|
||||
})
|
||||
|
||||
local hipatterns = require('mini.hipatterns')
|
||||
hipatterns.setup({
|
||||
highlighters = {
|
||||
-- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE'
|
||||
fixme = { pattern = '%f[%w]()FIXME()%f[%W]', group = 'MiniHipatternsFixme' },
|
||||
hack = { pattern = '%f[%w]()HACK()%f[%W]', group = 'MiniHipatternsHack' },
|
||||
todo = { pattern = '%f[%w]()TODO()%f[%W]', group = 'MiniHipatternsTodo' },
|
||||
note = { pattern = '%f[%w]()NOTE()%f[%W]', group = 'MiniHipatternsNote' },
|
||||
|
||||
-- Highlight hex color strings (`#rrggbb`) using that color
|
||||
hex_color = hipatterns.gen_highlighter.hex_color(),
|
||||
},
|
||||
})
|
||||
end
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
{
|
||||
"nosduco/remote-sshfs.nvim",
|
||||
dependencies = { "nvim-telescope/telescope.nvim" },
|
||||
cmd = { "RemoteSSHFSConnect" },
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
event = { "BufReadPost", "BufNewFile", "BufWritePre", "VeryLazy" },
|
||||
dependencies = {
|
||||
{
|
||||
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||
opts = {
|
||||
enable_autocmd = false,
|
||||
},
|
||||
},
|
||||
{ "nvim-treesitter/nvim-treesitter-context" },
|
||||
},
|
||||
build = ":TSUpdate",
|
||||
opts = {
|
||||
auto_install = true,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
---@module 'trouble'
|
||||
|
||||
return {
|
||||
"folke/trouble.nvim",
|
||||
dependencies = { "echasnovski/mini.nvim", "ibhagwan/fzf-lua" },
|
||||
cmd = { "Trouble" },
|
||||
keys = {
|
||||
{
|
||||
"<leader>fD",
|
||||
"<cmd>Trouble diagnostics open<cr>",
|
||||
desc = "Find diagnostics (Trouble)",
|
||||
},
|
||||
{
|
||||
"<leader>fd",
|
||||
"<cmd>Trouble diagnostics open filter.buf=0<cr>",
|
||||
desc = "Find buffer diagnostics (Trouble)",
|
||||
},
|
||||
{
|
||||
"<leader>ll",
|
||||
"<cmd>Trouble symbols open<cr>",
|
||||
desc = "Symbols (Trouble)",
|
||||
},
|
||||
{
|
||||
"<leader>li",
|
||||
"<cmd>Trouble lsp open<cr>",
|
||||
desc = "LSP info of node (Trouble)",
|
||||
},
|
||||
{
|
||||
"<leader>fq",
|
||||
"<cmd>Trouble qflist open<cr>",
|
||||
desc = "Quickfix List (Trouble)",
|
||||
},
|
||||
},
|
||||
opts = function()
|
||||
local config = require("fzf-lua.config")
|
||||
local actions = require("trouble.sources.fzf").actions
|
||||
config.defaults.actions.files["ctrl-t"] = actions.open
|
||||
|
||||
---@type trouble.Window.opts
|
||||
local win_opts = {
|
||||
-- size = { width = 30, height = 0.5 },
|
||||
minimal = true,
|
||||
border = "rounded",
|
||||
position = "bottom",
|
||||
}
|
||||
|
||||
---@type trouble.Config
|
||||
return {
|
||||
focus = true,
|
||||
|
||||
---@type trouble.Window.opts
|
||||
preview = {
|
||||
type = "split",
|
||||
relative = "win",
|
||||
position = "top",
|
||||
},
|
||||
|
||||
---@type table<string, trouble.Action.spec|false>
|
||||
keys = {
|
||||
["<s-cr>"] = "jump_close",
|
||||
["<cr>"] = "jump",
|
||||
["<2-leftmouse>"] = "jump",
|
||||
["<c-v>"] = "jump_split_close",
|
||||
["<c-s>"] = "jump_vsplit_close",
|
||||
["v"] = "jump_split_close",
|
||||
["s"] = "jump_vsplit_close",
|
||||
["<c-k>"] = "cancel", -- hack to fool myself into thinking I move to the avobe window
|
||||
["a"] = function(view, ctx)
|
||||
-- TODO: this is not possible until this issue is solved
|
||||
-- https://github.com/neovim/neovim/issues/31206
|
||||
local trouble = require("trouble")
|
||||
view:action("jump_only")
|
||||
|
||||
vim.lsp.buf.code_action()
|
||||
|
||||
trouble.focus(view, ctx)
|
||||
end,
|
||||
},
|
||||
win = win_opts,
|
||||
---@type table<string, trouble.Mode>
|
||||
modes = {
|
||||
symbols = {
|
||||
focus = true,
|
||||
win = win_opts
|
||||
},
|
||||
lsp_references = {
|
||||
focus = true,
|
||||
win = win_opts
|
||||
},
|
||||
lsp = {
|
||||
focus = true,
|
||||
win = win_opts
|
||||
},
|
||||
}
|
||||
}
|
||||
end
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
return {
|
||||
"pmizio/typescript-tools.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
|
||||
opts = {
|
||||
init_options = {
|
||||
preferences = {
|
||||
disableSuggestions = true,
|
||||
},
|
||||
},
|
||||
settings = {
|
||||
-- array of strings("fix_all"|"add_missing_imports"|"remove_unused"|
|
||||
-- "remove_unused_imports"|"organize_imports") -- or string "all"
|
||||
-- to include all supported code actions
|
||||
-- specify commands exposed as code_actions
|
||||
expose_as_code_action = "all",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"Basic": { "prefix": "ba", "body": "T1=$1 T2=$2 T0=$0" },
|
||||
"Placeholders": { "prefix": "pl", "body": "T1=${1:aa}\nT2=${2:<$1>}" },
|
||||
"Choices": { "prefix": "ch", "body": "T1=${1|a,b|} T2=${2|c,d|}" },
|
||||
"Linked": { "prefix": "li", "body": "T1=$1\n\tT1=$1" },
|
||||
"Variables": { "prefix": "va", "body": "Runtime: $VIMRUNTIME\n" },
|
||||
"Complex": {
|
||||
"prefix": "co",
|
||||
"body": ["T1=${1:$RANDOM}", "T3=${3:$1_${2:$1}}", "T2=$2"]
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue