Skip to content

Commit

Permalink
misc: adding all the things 🥳
Browse files Browse the repository at this point in the history
  • Loading branch information
TechDufus committed Feb 21, 2025
1 parent 392f201 commit ef3a063
Show file tree
Hide file tree
Showing 16 changed files with 375 additions and 195 deletions.
3 changes: 1 addition & 2 deletions roles/hammerspoon/files/config/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ local macros = {

registerModalBindings(nil, 'f16', macros, true)


--------------------------------------------------------------------------------
-- Multi Window Management
--------------------------------------------------------------------------------
Expand Down Expand Up @@ -78,7 +77,7 @@ local windowManagementBindings = {
['j'] = function() hs.window.focusedWindow():focusWindowSouth(nil, true) end,
['k'] = function() hs.window.focusedWindow():focusWindowNorth(nil, true) end,
['l'] = function() hs.window.focusedWindow():focusWindowEast(nil, true) end,
['a'] = function() hs.application.frontmostApplication():unhide() end,
['a'] = function() hs.application.frontmostApplication():focus() end,
['p'] = layout.selectLayout,
['u'] = layout.bindToCell,
[';'] = layout.selectNextVariant,
Expand Down
6 changes: 0 additions & 6 deletions roles/neovim/files/lua/plugins/comment.lua

This file was deleted.

122 changes: 61 additions & 61 deletions roles/neovim/files/lua/plugins/dashboard-nvim.lua
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
return {
"nvimdev/dashboard-nvim",
event = "VimEnter",
opts = function()
local logo = [[
████████╗███████╗ ██████╗██╗ ██╗██████╗ ██╗ ██╗███████╗██╗ ██╗███████╗
╚══██╔══╝██╔════╝██╔════╝██║ ██║██╔══██╗██║ ██║██╔════╝██║ ██║██╔════╝
██║ █████╗ ██║ ███████║██║ ██║██║ ██║█████╗ ██║ ██║███████╗
██║ ██╔══╝ ██║ ██╔══██║██║ ██║██║ ██║██╔══╝ ██║ ██║╚════██║
██║ ███████╗╚██████╗██║ ██║██████╔╝╚██████╔╝██║ ╚██████╔╝███████║
╚═╝ ╚══════╝ ╚═════╝╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚══════╝
]]

logo = string.rep("\n", 8) .. logo .. "\n\n"

local opts = {
theme = "doom",
hide = {
-- this is taken care of by lualine
-- enabling this messes up the actual laststatus setting after loading a file
statusline = false,
},
config = {
header = vim.split(logo, "\n"),
-- stylua: ignore
center = {
{ action = "Telescope find_files", desc = " Find file", icon = "", key = "f" },
{ action = "ene | startinsert", desc = " New file", icon = "", key = "n" },
{ action = "Telescope oldfiles", desc = " Recent files", icon = "", key = "r" },
{ action = "Telescope live_grep", desc = " Find text", icon = "", key = "g" },
-- { action = [[lua require("lazyvim.util").telescope.config_files()()]], desc = " Config", icon = " ", key = "c" },
-- { action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" },
-- { action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" },
{ action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" },
{ action = "qa", desc = " Quit", icon = "", key = "q" },
},
footer = function()
local stats = require("lazy").stats()
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
return { "⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms" }
end,
},
}

for _, button in ipairs(opts.config.center) do
button.desc = button.desc .. string.rep(" ", 43 - #button.desc)
button.key_format = " %s"
end

-- close Lazy and re-open when the dashboard is ready
if vim.o.filetype == "lazy" then
vim.cmd.close()
vim.api.nvim_create_autocmd("User", {
pattern = "DashboardLoaded",
callback = function()
require("lazy").show()
end,
})
end

return opts
end,
-- "nvimdev/dashboard-nvim",
-- event = "VimEnter",
-- opts = function()
-- local logo = [[
-- ████████╗███████╗ ██████╗██╗ ██╗██████╗ ██╗ ██╗███████╗██╗ ██╗███████╗
-- ╚══██╔══╝██╔════╝██╔════╝██║ ██║██╔══██╗██║ ██║██╔════╝██║ ██║██╔════╝
-- ██║ █████╗ ██║ ███████║██║ ██║██║ ██║█████╗ ██║ ██║███████╗
-- ██║ ██╔══╝ ██║ ██╔══██║██║ ██║██║ ██║██╔══╝ ██║ ██║╚════██║
-- ██║ ███████╗╚██████╗██║ ██║██████╔╝╚██████╔╝██║ ╚██████╔╝███████║
-- ╚═╝ ╚══════╝ ╚═════╝╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚══════╝
-- ]]
--
-- logo = string.rep("\n", 8) .. logo .. "\n\n"
--
-- local opts = {
-- theme = "doom",
-- hide = {
-- -- this is taken care of by lualine
-- -- enabling this messes up the actual laststatus setting after loading a file
-- statusline = false,
-- },
-- config = {
-- header = vim.split(logo, "\n"),
-- -- stylua: ignore
-- center = {
-- { action = "Telescope find_files", desc = " Find file", icon = " ", key = "f" },
-- { action = "ene | startinsert", desc = " New file", icon = " ", key = "n" },
-- { action = "Telescope oldfiles", desc = " Recent files", icon = " ", key = "r" },
-- { action = "Telescope live_grep", desc = " Find text", icon = " ", key = "g" },
-- -- { action = [[lua require("lazyvim.util").telescope.config_files()()]], desc = " Config", icon = " ", key = "c" },
-- -- { action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" },
-- -- { action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" },
-- { action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" },
-- { action = "qa", desc = " Quit", icon = " ", key = "q" },
-- },
-- footer = function()
-- local stats = require("lazy").stats()
-- local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
-- return { "⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms" }
-- end,
-- },
-- }
--
-- for _, button in ipairs(opts.config.center) do
-- button.desc = button.desc .. string.rep(" ", 43 - #button.desc)
-- button.key_format = " %s"
-- end
--
-- -- close Lazy and re-open when the dashboard is ready
-- if vim.o.filetype == "lazy" then
-- vim.cmd.close()
-- vim.api.nvim_create_autocmd("User", {
-- pattern = "DashboardLoaded",
-- callback = function()
-- require("lazy").show()
-- end,
-- })
-- end
--
-- return opts
-- end,
}
7 changes: 0 additions & 7 deletions roles/neovim/files/lua/plugins/distant.lua

This file was deleted.

4 changes: 4 additions & 0 deletions roles/neovim/files/lua/plugins/git-worktree.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
return {
'ThePrimeagen/git-worktree.nvim',
dependencies = { "nvim-lua/plenary.nvim" }
}
131 changes: 126 additions & 5 deletions roles/neovim/files/lua/plugins/mini.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,128 @@
return {
'echasnovski/mini.nvim',
version = '*',
config = function()
require('mini.surround').setup()
end,
-- Comments
{
'echasnovski/mini.comment',
version = false,
dependencies = {
"JoosepAlviste/nvim-ts-context-commentstring",
},
config = function()
-- disable the autocommand from ts-context-commentstring
require('ts_context_commentstring').setup {
enable_autocmd = false,
}

require("mini.comment").setup {
-- tsx, jsx, html , svelte comment support
options = {
custom_commentstring = function()
return require('ts_context_commentstring.internal').calculate_commentstring({ key =
'commentstring' })
or vim.bo.commentstring
end,
},
}
end
},
-- File explorer (this works properly with oil unlike nvim-tree)
{
'echasnovski/mini.files',
config = function()
local MiniFiles = require("mini.files")
MiniFiles.setup({
mappings = {
go_in = "<CR>", -- Map both Enter and L to enter directories or open files
go_in_plus = "l",
go_out = "-",
go_out_plus = "h",
},

})
vim.keymap.set("n", "<leader>ee", "<cmd>lua MiniFiles.open()<CR>", { desc = "Toggle mini file explorer" }) -- toggle file explorer
vim.keymap.set("n", "<leader>w", function()
MiniFiles.open(vim.api.nvim_buf_get_name(0), false)
MiniFiles.reveal_cwd()
end, { desc = "Toggle into currently opened file" })
end,
},
-- Surround
{
"echasnovski/mini.surround",
event = { "BufReadPre", "BufNewFile" },
opts = {
-- Add custom surroundings to be used on top of builtin ones. For more
-- information with examples, see `:h MiniSurround.config`.
custom_surroundings = nil,

-- Duration (in ms) of highlight when calling `MiniSurround.highlight()`
highlight_duration = 300,

-- Module mappings. Use `''` (empty string) to disable one.
-- INFO:
-- saiw surround with no whitespace
-- saw surround with whitespace
mappings = {
add = 'sa', -- Add surrounding in Normal and Visual modes
delete = 'sd', -- Delete surrounding
find = 'sf', -- Find surrounding (to the right)
find_left = 'sF', -- Find surrounding (to the left)
highlight = 'sh', -- Highlight surrounding
replace = 'sr', -- Replace surrounding
update_n_lines = 'sn', -- Update `n_lines`

suffix_last = 'l', -- Suffix to search with "prev" method
suffix_next = 'n', -- Suffix to search with "next" method
},

-- Number of lines within which surrounding is searched
n_lines = 20,

-- Whether to respect selection type:
-- - Place surroundings on separate lines in linewise mode.
-- - Place surroundings on each line in blockwise mode.
respect_selection_type = false,

-- How to search for surrounding (first inside current line, then inside
-- neighborhood). One of 'cover', 'cover_or_next', 'cover_or_prev',
-- 'cover_or_nearest', 'next', 'prev', 'nearest'. For more details,
-- see `:h MiniSurround.config`.
search_method = 'cover',

-- Whether to disable showing non-error feedback
silent = false,
},
},
-- Get rid of whitespace
{
"echasnovski/mini.trailspace",
event = { "BufReadPost", "BufNewFile" },
config = function()
local miniTrailspace = require("mini.trailspace")

miniTrailspace.setup({
only_in_normal_buffers = true,
})
vim.keymap.set("n", "<leader>cw", function() miniTrailspace.trim() end, { desc = "Erase Whitespace" })

-- Ensure highlight never reappears by removing it on CursorMoved
vim.api.nvim_create_autocmd("CursorMoved", {
pattern = "*",
callback = function()
require("mini.trailspace").unhighlight()
end,
})
end,
},
-- Split & join
{
"echasnovski/mini.splitjoin",
config = function()
local miniSplitJoin = require("mini.splitjoin")
miniSplitJoin.setup({
mappings = { toggle = "" }, -- Disable default mapping
})
vim.keymap.set({"n", "x"}, "sj", function() miniSplitJoin.join() end, {desc = "Join arguments"})
vim.keymap.set({ "n", "x" }, "sk", function() miniSplitJoin.split() end, { desc = "Split arguments" })
end,
},
}
Loading

0 comments on commit ef3a063

Please sign in to comment.