Skip to content

Commit ef3a063

Browse files
committed
misc: adding all the things 🥳
1 parent 392f201 commit ef3a063

File tree

16 files changed

+375
-195
lines changed

16 files changed

+375
-195
lines changed

roles/hammerspoon/files/config/init.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ local macros = {
4848

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

51-
5251
--------------------------------------------------------------------------------
5352
-- Multi Window Management
5453
--------------------------------------------------------------------------------
@@ -78,7 +77,7 @@ local windowManagementBindings = {
7877
['j'] = function() hs.window.focusedWindow():focusWindowSouth(nil, true) end,
7978
['k'] = function() hs.window.focusedWindow():focusWindowNorth(nil, true) end,
8079
['l'] = function() hs.window.focusedWindow():focusWindowEast(nil, true) end,
81-
['a'] = function() hs.application.frontmostApplication():unhide() end,
80+
['a'] = function() hs.application.frontmostApplication():focus() end,
8281
['p'] = layout.selectLayout,
8382
['u'] = layout.bindToCell,
8483
[';'] = layout.selectNextVariant,

roles/neovim/files/lua/plugins/comment.lua

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,63 @@
11
return {
2-
"nvimdev/dashboard-nvim",
3-
event = "VimEnter",
4-
opts = function()
5-
local logo = [[
6-
████████╗███████╗ ██████╗██╗ ██╗██████╗ ██╗ ██╗███████╗██╗ ██╗███████╗
7-
╚══██╔══╝██╔════╝██╔════╝██║ ██║██╔══██╗██║ ██║██╔════╝██║ ██║██╔════╝
8-
██║ █████╗ ██║ ███████║██║ ██║██║ ██║█████╗ ██║ ██║███████╗
9-
██║ ██╔══╝ ██║ ██╔══██║██║ ██║██║ ██║██╔══╝ ██║ ██║╚════██║
10-
██║ ███████╗╚██████╗██║ ██║██████╔╝╚██████╔╝██║ ╚██████╔╝███████║
11-
╚═╝ ╚══════╝ ╚═════╝╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚══════╝
12-
]]
13-
14-
logo = string.rep("\n", 8) .. logo .. "\n\n"
15-
16-
local opts = {
17-
theme = "doom",
18-
hide = {
19-
-- this is taken care of by lualine
20-
-- enabling this messes up the actual laststatus setting after loading a file
21-
statusline = false,
22-
},
23-
config = {
24-
header = vim.split(logo, "\n"),
25-
-- stylua: ignore
26-
center = {
27-
{ action = "Telescope find_files", desc = " Find file", icon = "", key = "f" },
28-
{ action = "ene | startinsert", desc = " New file", icon = "", key = "n" },
29-
{ action = "Telescope oldfiles", desc = " Recent files", icon = "", key = "r" },
30-
{ action = "Telescope live_grep", desc = " Find text", icon = "", key = "g" },
31-
-- { action = [[lua require("lazyvim.util").telescope.config_files()()]], desc = " Config", icon = " ", key = "c" },
32-
-- { action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" },
33-
-- { action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" },
34-
{ action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" },
35-
{ action = "qa", desc = " Quit", icon = "", key = "q" },
36-
},
37-
footer = function()
38-
local stats = require("lazy").stats()
39-
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
40-
return { "⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms" }
41-
end,
42-
},
43-
}
44-
45-
for _, button in ipairs(opts.config.center) do
46-
button.desc = button.desc .. string.rep(" ", 43 - #button.desc)
47-
button.key_format = " %s"
48-
end
49-
50-
-- close Lazy and re-open when the dashboard is ready
51-
if vim.o.filetype == "lazy" then
52-
vim.cmd.close()
53-
vim.api.nvim_create_autocmd("User", {
54-
pattern = "DashboardLoaded",
55-
callback = function()
56-
require("lazy").show()
57-
end,
58-
})
59-
end
60-
61-
return opts
62-
end,
2+
-- "nvimdev/dashboard-nvim",
3+
-- event = "VimEnter",
4+
-- opts = function()
5+
-- local logo = [[
6+
-- ████████╗███████╗ ██████╗██╗ ██╗██████╗ ██╗ ██╗███████╗██╗ ██╗███████╗
7+
-- ╚══██╔══╝██╔════╝██╔════╝██║ ██║██╔══██╗██║ ██║██╔════╝██║ ██║██╔════╝
8+
-- ██║ █████╗ ██║ ███████║██║ ██║██║ ██║█████╗ ██║ ██║███████╗
9+
-- ██║ ██╔══╝ ██║ ██╔══██║██║ ██║██║ ██║██╔══╝ ██║ ██║╚════██║
10+
-- ██║ ███████╗╚██████╗██║ ██║██████╔╝╚██████╔╝██║ ╚██████╔╝███████║
11+
-- ╚═╝ ╚══════╝ ╚═════╝╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚══════╝
12+
-- ]]
13+
--
14+
-- logo = string.rep("\n", 8) .. logo .. "\n\n"
15+
--
16+
-- local opts = {
17+
-- theme = "doom",
18+
-- hide = {
19+
-- -- this is taken care of by lualine
20+
-- -- enabling this messes up the actual laststatus setting after loading a file
21+
-- statusline = false,
22+
-- },
23+
-- config = {
24+
-- header = vim.split(logo, "\n"),
25+
-- -- stylua: ignore
26+
-- center = {
27+
-- { action = "Telescope find_files", desc = " Find file", icon = " ", key = "f" },
28+
-- { action = "ene | startinsert", desc = " New file", icon = " ", key = "n" },
29+
-- { action = "Telescope oldfiles", desc = " Recent files", icon = " ", key = "r" },
30+
-- { action = "Telescope live_grep", desc = " Find text", icon = " ", key = "g" },
31+
-- -- { action = [[lua require("lazyvim.util").telescope.config_files()()]], desc = " Config", icon = " ", key = "c" },
32+
-- -- { action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" },
33+
-- -- { action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" },
34+
-- { action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" },
35+
-- { action = "qa", desc = " Quit", icon = " ", key = "q" },
36+
-- },
37+
-- footer = function()
38+
-- local stats = require("lazy").stats()
39+
-- local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
40+
-- return { "⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms" }
41+
-- end,
42+
-- },
43+
-- }
44+
--
45+
-- for _, button in ipairs(opts.config.center) do
46+
-- button.desc = button.desc .. string.rep(" ", 43 - #button.desc)
47+
-- button.key_format = " %s"
48+
-- end
49+
--
50+
-- -- close Lazy and re-open when the dashboard is ready
51+
-- if vim.o.filetype == "lazy" then
52+
-- vim.cmd.close()
53+
-- vim.api.nvim_create_autocmd("User", {
54+
-- pattern = "DashboardLoaded",
55+
-- callback = function()
56+
-- require("lazy").show()
57+
-- end,
58+
-- })
59+
-- end
60+
--
61+
-- return opts
62+
-- end,
6363
}

roles/neovim/files/lua/plugins/distant.lua

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
return {
2+
'ThePrimeagen/git-worktree.nvim',
3+
dependencies = { "nvim-lua/plenary.nvim" }
4+
}
Lines changed: 126 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,128 @@
11
return {
2-
'echasnovski/mini.nvim',
3-
version = '*',
4-
config = function()
5-
require('mini.surround').setup()
6-
end,
2+
-- Comments
3+
{
4+
'echasnovski/mini.comment',
5+
version = false,
6+
dependencies = {
7+
"JoosepAlviste/nvim-ts-context-commentstring",
8+
},
9+
config = function()
10+
-- disable the autocommand from ts-context-commentstring
11+
require('ts_context_commentstring').setup {
12+
enable_autocmd = false,
13+
}
14+
15+
require("mini.comment").setup {
16+
-- tsx, jsx, html , svelte comment support
17+
options = {
18+
custom_commentstring = function()
19+
return require('ts_context_commentstring.internal').calculate_commentstring({ key =
20+
'commentstring' })
21+
or vim.bo.commentstring
22+
end,
23+
},
24+
}
25+
end
26+
},
27+
-- File explorer (this works properly with oil unlike nvim-tree)
28+
{
29+
'echasnovski/mini.files',
30+
config = function()
31+
local MiniFiles = require("mini.files")
32+
MiniFiles.setup({
33+
mappings = {
34+
go_in = "<CR>", -- Map both Enter and L to enter directories or open files
35+
go_in_plus = "l",
36+
go_out = "-",
37+
go_out_plus = "h",
38+
},
39+
40+
})
41+
vim.keymap.set("n", "<leader>ee", "<cmd>lua MiniFiles.open()<CR>", { desc = "Toggle mini file explorer" }) -- toggle file explorer
42+
vim.keymap.set("n", "<leader>w", function()
43+
MiniFiles.open(vim.api.nvim_buf_get_name(0), false)
44+
MiniFiles.reveal_cwd()
45+
end, { desc = "Toggle into currently opened file" })
46+
end,
47+
},
48+
-- Surround
49+
{
50+
"echasnovski/mini.surround",
51+
event = { "BufReadPre", "BufNewFile" },
52+
opts = {
53+
-- Add custom surroundings to be used on top of builtin ones. For more
54+
-- information with examples, see `:h MiniSurround.config`.
55+
custom_surroundings = nil,
56+
57+
-- Duration (in ms) of highlight when calling `MiniSurround.highlight()`
58+
highlight_duration = 300,
59+
60+
-- Module mappings. Use `''` (empty string) to disable one.
61+
-- INFO:
62+
-- saiw surround with no whitespace
63+
-- saw surround with whitespace
64+
mappings = {
65+
add = 'sa', -- Add surrounding in Normal and Visual modes
66+
delete = 'sd', -- Delete surrounding
67+
find = 'sf', -- Find surrounding (to the right)
68+
find_left = 'sF', -- Find surrounding (to the left)
69+
highlight = 'sh', -- Highlight surrounding
70+
replace = 'sr', -- Replace surrounding
71+
update_n_lines = 'sn', -- Update `n_lines`
72+
73+
suffix_last = 'l', -- Suffix to search with "prev" method
74+
suffix_next = 'n', -- Suffix to search with "next" method
75+
},
76+
77+
-- Number of lines within which surrounding is searched
78+
n_lines = 20,
79+
80+
-- Whether to respect selection type:
81+
-- - Place surroundings on separate lines in linewise mode.
82+
-- - Place surroundings on each line in blockwise mode.
83+
respect_selection_type = false,
84+
85+
-- How to search for surrounding (first inside current line, then inside
86+
-- neighborhood). One of 'cover', 'cover_or_next', 'cover_or_prev',
87+
-- 'cover_or_nearest', 'next', 'prev', 'nearest'. For more details,
88+
-- see `:h MiniSurround.config`.
89+
search_method = 'cover',
90+
91+
-- Whether to disable showing non-error feedback
92+
silent = false,
93+
},
94+
},
95+
-- Get rid of whitespace
96+
{
97+
"echasnovski/mini.trailspace",
98+
event = { "BufReadPost", "BufNewFile" },
99+
config = function()
100+
local miniTrailspace = require("mini.trailspace")
101+
102+
miniTrailspace.setup({
103+
only_in_normal_buffers = true,
104+
})
105+
vim.keymap.set("n", "<leader>cw", function() miniTrailspace.trim() end, { desc = "Erase Whitespace" })
106+
107+
-- Ensure highlight never reappears by removing it on CursorMoved
108+
vim.api.nvim_create_autocmd("CursorMoved", {
109+
pattern = "*",
110+
callback = function()
111+
require("mini.trailspace").unhighlight()
112+
end,
113+
})
114+
end,
115+
},
116+
-- Split & join
117+
{
118+
"echasnovski/mini.splitjoin",
119+
config = function()
120+
local miniSplitJoin = require("mini.splitjoin")
121+
miniSplitJoin.setup({
122+
mappings = { toggle = "" }, -- Disable default mapping
123+
})
124+
vim.keymap.set({"n", "x"}, "sj", function() miniSplitJoin.join() end, {desc = "Join arguments"})
125+
vim.keymap.set({ "n", "x" }, "sk", function() miniSplitJoin.split() end, { desc = "Split arguments" })
126+
end,
127+
},
7128
}

0 commit comments

Comments
 (0)