mirror of
https://github.com/Cian-H/dotfiles.git
synced 2025-12-22 19:31:57 +00:00
Fresh start to remove subtree artifacts
This commit is contained in:
@@ -17,29 +17,14 @@ return { -- Mini is so varied it's hard to categorise. So i dumped my mini insta
|
||||
-- - sr)' - [S]urround [R]eplace [)] [']
|
||||
require("mini.surround").setup()
|
||||
|
||||
-- Simple and easy statusline.
|
||||
-- You could remove this setup call if you don't like it,
|
||||
-- and try some other statusline plugin
|
||||
-- local statusline = require("mini.statusline")
|
||||
-- set use_icons to true if you have a Nerd Font
|
||||
-- statusline.setup({ use_icons = vim.g.have_nerd_font })
|
||||
|
||||
-- You can configure sections in the statusline by overriding their
|
||||
-- default behavior. For example, here we set the section for
|
||||
-- cursor location to LINE:COLUMN
|
||||
---@diagnostic disable-next-line: duplicate-set-field
|
||||
-- statusline.section_location = function()
|
||||
-- return "%2l:%-2v"
|
||||
-- end
|
||||
|
||||
-- Setup of mini.notify
|
||||
-- local notify = require("mini.notify")
|
||||
-- notify.setup()
|
||||
-- vim.notify = notify.make_notify({
|
||||
-- ERROR = { duration = 5000 },
|
||||
-- WARN = { duration = 4000 },
|
||||
-- INFO = { duration = 3000 },
|
||||
-- })
|
||||
local notify = require("mini.notify")
|
||||
notify.setup()
|
||||
vim.notify = notify.make_notify({
|
||||
ERROR = { duration = 5000 },
|
||||
WARN = { duration = 4000 },
|
||||
INFO = { duration = 3000 },
|
||||
})
|
||||
|
||||
-- Some other mini.nvim plugins that look useful to me
|
||||
require("mini.clue").setup()
|
||||
@@ -51,28 +36,68 @@ return { -- Mini is so varied it's hard to categorise. So i dumped my mini insta
|
||||
require("mini.trailspace").setup()
|
||||
|
||||
-- My custom mini.starter config
|
||||
|
||||
-- This function runs a vim command then exits the buffer that called it
|
||||
function _Launch_Vim_Cmd(cmd)
|
||||
local startbuf = vim.api.nvim_get_current_buf()
|
||||
vim.cmd(cmd)
|
||||
vim.api.nvim_buf_delete(startbuf, {})
|
||||
end
|
||||
|
||||
local custom_items = {
|
||||
local starter_items = {
|
||||
{
|
||||
name = "Status",
|
||||
action = "Git status",
|
||||
section = "Git",
|
||||
action = "Telescope file_browser",
|
||||
name = "Tree",
|
||||
section = "Telescope",
|
||||
},
|
||||
{
|
||||
action = "Telescope live_grep",
|
||||
name = "Live grep",
|
||||
section = "Telescope",
|
||||
},
|
||||
{
|
||||
action = "Telescope find_files",
|
||||
name = "File grep",
|
||||
section = "Telescope",
|
||||
},
|
||||
{
|
||||
action = "Telescope command_history",
|
||||
name = "Command history",
|
||||
section = "Telescope",
|
||||
},
|
||||
{
|
||||
action = "Telescope help_tags",
|
||||
name = "Help tags",
|
||||
section = "Telescope",
|
||||
},
|
||||
{
|
||||
name = "Log",
|
||||
action = [[lua _Launch_Vim_Cmd("Git log --graph --pretty=oneline --abbrev-commit")]],
|
||||
action = [[lua Snacks.lazygit.log()]],
|
||||
section = "Git",
|
||||
},
|
||||
{
|
||||
name = "Lazygit",
|
||||
action = "LazyGit",
|
||||
action = [[lua Snacks.lazygit()]],
|
||||
section = "Git",
|
||||
},
|
||||
{
|
||||
name = "Browser",
|
||||
action = function()
|
||||
local handle = io.popen("git remote show")
|
||||
if handle == nil then
|
||||
vim.notify("Failed to find remote", vim.log.levels.ERROR)
|
||||
return
|
||||
end
|
||||
local result = handle:read("*a")
|
||||
handle:close()
|
||||
local remote = vim.split(result, "\n")[1]
|
||||
handle = io.popen("git remote get-url " .. remote)
|
||||
if handle == nil then
|
||||
vim.notify("Failed to get url for " .. remote, vim.log.levels.ERROR)
|
||||
return
|
||||
end
|
||||
local url = handle:read("*a")
|
||||
handle:close()
|
||||
handle = io.popen("xdg-open " .. url)
|
||||
if handle == nil then
|
||||
vim.notify("Failed to open " .. url, vim.log.levels.ERROR)
|
||||
return
|
||||
end
|
||||
result = handle:read("*a")
|
||||
handle:close()
|
||||
end,
|
||||
section = "Git",
|
||||
},
|
||||
{
|
||||
@@ -96,11 +121,8 @@ return { -- Mini is so varied it's hard to categorise. So i dumped my mini insta
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣿⣷⡀⠀⠀⠀⠀⢹⣿⣆⠀⠀⠀⠀⠀\
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⣿⡇⠀⠀⠀⠀⠸⣿⣿⡄⠀⠀⠀⠀\
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠁⠀⠀⠀⠀⠀⡿⣿⣿⠀⠀⠀⠀\
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠀⠀⠀⠀⠀",
|
||||
items = {
|
||||
require("mini.starter").sections.telescope(),
|
||||
custom_items,
|
||||
},
|
||||
⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠈⠙⠀⠀⠀⠀⠀",
|
||||
items = starter_items,
|
||||
footer = "",
|
||||
})
|
||||
end,
|
||||
|
||||
Reference in New Issue
Block a user