Compare commits

...

19 Commits

Author SHA1 Message Date
Oliver
3e85812630 fix(nvim): fix autocompletion 2025-10-30 16:58:06 +01:00
Oliver
a968cdc50a fix(nvim): delete unused diagrams plugin 2025-10-30 16:53:32 +01:00
Oliver
d7df92eb95 feat(leap): remove leap 2025-10-30 14:43:55 +01:00
Oliver
6d75acf6f2 feat(attempt): add attempt 2025-10-30 14:43:38 +01:00
Oliver
e3ce7dccd4 feat(custom-commands): add gdc to show git diff --cached 2025-10-29 15:40:37 +01:00
Oliver
0dceca82a1 chore(gitignore): update gitignore 2025-10-24 16:22:25 +02:00
Oliver
e55dd790eb feat(nvim): add profile and gx 2025-10-24 16:21:22 +02:00
Oliver
54bf8fdd78 fix(nvim): fix neovim go to definition 2025-10-21 17:35:56 +02:00
Oliver
eddb023767 feat(nvim): update to v0.11 2025-10-21 17:09:58 +02:00
Oliver
3230e6d872 fix(tmuxinator): edit template - don't run dcud and open nvim with a . 2025-10-13 14:19:00 +02:00
Oliver
c4e46206d7 feat(nvim): add new intro image 2025-10-06 16:19:44 +02:00
Oliver
2d0acc2d70 fix(tmuxinator): allow tab/shift-tab to be used instead of up and down and allow cycling 2025-10-06 14:07:10 +02:00
Oliver
383a900c2d feat(tmuxinator): show popup for choosing session on <prefix>s 2025-10-06 13:57:09 +02:00
Oliver
fdf5efedb1 fix(tmuxinator): change mx to tat and get_mx_sessions to tls 2025-10-06 09:10:07 +02:00
357bdad01b fix(tmuxinator): make grep case insensitive 2025-10-04 15:51:12 +02:00
499b0f4329 fix(tmuxinator): make grep safe + running just mx will open in the current directory 2025-10-04 15:46:47 +02:00
15f2f88565 fix(tmuxinator): fix directory does not exist when it exists error 2025-10-04 15:32:28 +02:00
3790e1e28a fix(tmuxinator): better autocompletion 2025-10-04 15:30:55 +02:00
1f982263e6 fix(tmuxinator): better handling when folder does not exist 2025-10-04 15:20:33 +02:00
23 changed files with 684 additions and 204 deletions

2
.gitignore vendored
View File

@@ -8,3 +8,5 @@ omz-custom/plugins
omz-custom/vrm.sh
omz
testDir
tmuxinator/*.yml
!tmuxinator/template.yml.temp

View File

@@ -1,3 +1,5 @@
todo.md
**/.DS_Store
**/lazy-lock.json
**/.claude/settings.local.json

View File

@@ -1 +1 @@
{"copilot.lua":"1.13.0"}
{"copilot.lua":"1.384.0"}

13
nvim/lsp/luals.lua Normal file
View File

@@ -0,0 +1,13 @@
return {
cmd = { "lua-language-server" },
filetypes = { "lua" },
root_markers = { ".luarc.json", ".luarc.jsonc" },
settings = {
Lua = {
runtime = {
version = "LuaJIT",
},
signatureHelp = { enabled = true },
},
},
}

View File

@@ -1,21 +0,0 @@
local configs = require 'lspconfig.configs'
local util = require 'lspconfig.util'
configs.prolog_lsp = {
default_config = {
cmd = {"swipl",
"-g", "use_module(library(lsp_server)).",
"-g", "lsp_server:main",
"-t", "halt",
"--", "stdio"};
filetypes = {"prolog"};
root_dir = util.root_pattern("pack.pl");
};
docs = {
description = [[
https://github.com/jamesnvc/prolog_lsp
Prolog Language Server
]];
}
}

View File

@@ -5,6 +5,3 @@ require("olinpin.commands")
-- this needs to be set after lazy
vim.o.timeoutlen = 0
-- setup prolog
require('lspconfig/prolog_lsp')
require('lspconfig').prolog_lsp.setup{}

122
nvim/lua/olinpin/intro.lua Normal file
View File

@@ -0,0 +1,122 @@
local M = {}
local api = vim.api
local fn = vim.fn
local strw = api.nvim_strwidth
local opts = {
header = {
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣤⣴⣶⣶⣶⣶⣦⣤⡀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⠟⠉⠉⠉⠉⠉⠛⠻⢿⣷⣄⠀⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣼⣿⠟⠁⠀⠀⢠⣤⣄⠀⠀⠀⠀⠙⣿⣷⠀",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⠏⠀⠀⠀⠀⠘⠻⠋⠀⠀⠀⠀⠀⢸⣿⡇",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⣿⡏⠀⠀⣀⣀⣀⣠⣤⣤⣤⣤⣿⣄⠀⢠⣿⣧",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣿⣿⠀⠀⠀⠈⠻⣿⣶⠶⣶⣤⣤⣜⣿⣦⡈⢿⣿",
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⠀⠀⠀⠀⠀⠈⠙⠻⢶⣤⣭⣛⣿⣿⣷⣼⣿",
"⠀⠀⠀⠀⠀⣰⣶⣾⠿⠿⢿⣷⣶⣄⠀⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠙⠛⠛⢛⣿⣿",
"⠀⠀⠀⠀⠀⢹⣿⣆⠀⠀⠀⠈⠻⢿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⡏",
"⠀⠀⠀⠀⠀⣸⣿⣿⠀⠀⠀⠀⠀⠀⢀⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⠀",
"⠀⠀⠀⢀⣾⣿⣿⡇⠀⠀⠀⠀⠀⠀⢸⠟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⡇⠀",
"⠀⠀⠀⣼⣿⠃⠹⣿⣷⣄⠀⠀⠀⠀⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⠇⠀",
"⠀⠀⠀⣿⡿⠀⠀⠈⠻⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⠀⠀",
"⠀⠀⢸⣿⣧⠀⠀⠀⠀⠸⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡷⠀⠀",
"⠀⠀⠈⣿⣿⡄⠀⠀⠀⠀⢻⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣿⡀⠀",
"⠀⠀⠀⣿⣿⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣧⠀",
"⠀⠀⠀⢻⣿⡟⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢿⣿⡇",
"⠀⠀⠀⠘⣿⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⡿",
"⠀⠀⠀⣤⣸⣿⣿⡷⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⠃",
"⠀⠀⠘⣿⡿⠿⣿⣿⣿⣷⡶⢶⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⣿⠏⠀",
"⠀⠀⢀⣿⡟⠀⠀⠀⠀⠀⠀⠈⣿⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⡿⠟⠉⠀⠀",
"⠀⠀⣼⣿⠇⠀⣴⣄⠀⠀⠀⠀⢹⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣶⣿⠟⠁⠀⠀⠀⠀",
"⢀⣼⣿⠋⠀⠀⠘⣿⣧⠀⠀⠀⢸⣿⣧⣄⣀⠀⠀⠀⢀⣀⣤⣶⣿⣿⠋⠁⠀⠀⠀⠀⠀⠀",
"⢾⣯⣁⠀⠀⠀⠀⠈⢿⡄⠀⠀⣸⡿⠉⠙⠛⠛⠛⠛⢻⣿⡏⢹⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠛⢿⣷⣦⣤⣀⡀⠀⠀⠀⣠⣿⣷⣶⣶⣶⣶⣶⣦⣤⣿⣿⡜⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠈⠙⠛⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⢻⡿⣷⣶⣤⣀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣏⣁⡸⠟⠈⣩⣿⣿⣿⠶⠀⠀",
"⠀⠀⠀⣠⣴⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣿⠟⠋⠁⠀⠀⠀⠀",
"⠀⠀⠀⠙⠿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠋⠉⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠉⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
" WADDLE WADDLE WADDLE ",
},
buttons = {}
}
M.open = function(buf, win, action)
action = action or "open"
win = win or api.nvim_get_current_win()
if not vim.bo.buflisted and action == "open" then
if vim.t.bufs[1] then
win = vim.fn.bufwinid(vim.t.bufs[1])
api.nvim_set_current_win(win)
end
end
local ns = api.nvim_create_namespace "nvdash"
local winh = api.nvim_win_get_height(win)
local winw = api.nvim_win_get_width(win)
buf = buf or vim.api.nvim_create_buf(false, true)
local nvdash_w = 0
if action == "open" then
api.nvim_win_set_buf(0, buf)
end
opts.header = type(opts.header) == "function" and opts.header() or opts.header
local ui = {}
------------------------ find largest string's width -----------------------------
for _, v in ipairs(opts.header) do
local headerw = strw(v)
if headerw > nvdash_w then
nvdash_w = headerw
end
local col = math.floor((winw / 2) - math.floor(strw(v) / 2)) - 6
local opt = { virt_text_win_col = col, virt_text = { { v, "NvDashAscii" } } }
table.insert(ui, opt)
end
opts.buttons = type(opts.buttons) == "table" and opts.buttons or opts.buttons()
local key_lines = {}
----------------------- save display txt -----------------------------------------
local dashboard_h = #ui + 3
-- if screen height is small
winh = dashboard_h > winh and dashboard_h or winh
local row_i = math.floor((winh / 2) - (dashboard_h / 2))
for i, v in ipairs(key_lines) do
key_lines[i].i = v.i + row_i + 1
end
-- make all lines available
local empty_str = {}
for i = 1, winh do
empty_str[i] = ""
end
------------------------------ EXTMARKS : set text + highlight -------------------------------
api.nvim_buf_set_lines(buf, 0, -1, false, empty_str)
for i, v in ipairs(ui) do
api.nvim_buf_set_extmark(buf, ns, row_i + i, 0, v)
end
if action == "redraw" then
return
end
------------------------------------ keybinds ------------------------------------------
vim.wo[win].virtualedit = "all"
if key_lines[1] then
api.nvim_win_set_cursor(win, { key_lines[1].i, key_lines[1].col })
end
end
return M

View File

@@ -0,0 +1,36 @@
return {
"m-demare/attempt.nvim",
config = function()
local attempt = require("attempt")
attempt.setup({
initial_content = {
php = "<?php\n\n",
py = "",
},
ext_options = { "js", "py", "php", "" },
format_opts = {
js = "JavaScript",
py = "Python",
[""] = "[None]",
},
})
local cmd_map = {
py = "python3",
js = "node",
php = "php",
}
vim.keymap.set("n", "<leader>ss", attempt.new_select, { desc = "Attempt: Open Attempt" })
vim.keymap.set("n", "<leader>si", attempt.new_input_ext, { desc = "Attempt: New Attempt with Input" })
vim.keymap.set("n", "<leader>sr", function()
local ext = vim.fn.expand("%:e")
local cmd = cmd_map[ext] or 'echo "unsupported"'
vim.cmd("split | terminal " .. cmd .. " %")
end, { desc = "Attempt: Run Attempt" })
vim.keymap.set("n", "<leader>sd", attempt.delete_buf, { desc = "Attempt: Delete Attempt from Current Buffer" })
vim.keymap.set("n", "<leader>sc", attempt.rename_buf, { desc = "Attempt: Rename Attempt from Current Buffer" })
vim.keymap.set("n", "<leader>sf", ":Telescope attempt<CR>", { desc = "Attempt: List Attempts with Telescope" })
end,
}

View File

@@ -0,0 +1,58 @@
return {
{
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"L3MON4D3/LuaSnip",
"saadparwaiz1/cmp_luasnip",
},
config = function()
local cmp = require("cmp")
local luasnip = require("luasnip")
cmp.setup({
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = true }),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
}, {
{ name = "buffer" },
{ name = "path" },
}),
})
end,
},
}

View File

@@ -1,40 +1,34 @@
return {
"stevearc/conform.nvim",
event = "BufWritePre",
event = { "BufReadPre", "BufNewFile" },
opts = {
lsp_fallback = true,
formatters_by_ft = {
lua = { "stylua" },
javascript = { "prettier" },
typescript = { "prettier" },
json = { "prettier" },
css = { "prettier" },
html = { "prettier" },
sh = { "shfmt" },
go = { "goimports", "gofumpt" },
php = { "php-cs-fixer" },
python = { "black" },
},
-- format_on_save = function(bufnr)
-- local filetype = vim.bo[bufnr].filetype
-- if filetype == "javascript" then
-- return nil
-- end
-- if filetype == "vue" then
-- return nil
-- end
-- if filetype == "less" then
-- return nil
-- end
-- if filetype == "php" then
-- return nil
-- end
--
-- return {
-- timeout_ms = 500,
-- lsp_fallback = true,
-- }
-- end,
format_on_save = false,
default_format_opts = { lsp_fallback = true },
},
config = function(_, opts)
require("conform").setup(opts)
-- manual formatting keymap
vim.keymap.set({ "n", "x" }, "=", function()
require("conform").format({
async = true,
lsp_fallback = true,
})
end, { desc = "Format file or range" })
end,
}

View File

@@ -1,3 +0,0 @@
return {
"xavierchow/vim-sequence-diagram"
}

View File

@@ -0,0 +1,66 @@
return {
"chrishrb/gx.nvim",
keys = { { "gx", "<cmd>Browse<cr>", mode = { "n", "x" } } },
cmd = { "Browse" },
init = function()
vim.g.netrw_nogx = 1 -- disable netrw gx
end,
dependencies = { "nvim-lua/plenary.nvim" }, -- Required for Neovim < 0.10.0
config = true, -- default settings
submodules = false, -- not needed, submodules are required only for tests
-- -- you can specify also another config if you want
-- config = function()
-- require("gx").setup {
-- open_browser_app = "os_specific", -- specify your browser app; default for macOS is "open", Linux "xdg-open" and Windows "powershell.exe"
-- open_browser_args = { "--background" }, -- specify any arguments, such as --background for macOS' "open".
-- handlers = {
-- plugin = true, -- open plugin links in lua (e.g. packer, lazy, ..)
-- github = true, -- open github issues
-- brewfile = true, -- open Homebrew formulaes and casks
-- package_json = true, -- open dependencies from package.json
-- search = true, -- search the web/selection on the web if nothing else is found
-- go = true, -- open pkg.go.dev from an import statement (uses treesitter)
-- jira = { -- custom handler to open Jira tickets (these have higher precedence than builtin handlers)
-- name = "jira", -- set name of handler
-- handle = function(mode, line, _)
-- local ticket = require("gx.helper").find(line, mode, "(%u+-%d+)")
-- if ticket and #ticket < 20 then
-- return "http://jira.company.com/browse/" .. ticket
-- end
-- end,
-- },
-- rust = { -- custom handler to open rust's cargo packages
-- name = "rust", -- set name of handler
-- filetype = { "toml" }, -- you can also set the required filetype for this handler
-- filename = "Cargo.toml", -- or the necessary filename
-- handle = function(mode, line, _)
-- local crate = require("gx.helper").find(line, mode, "(%w+)%s-=%s")
-- if crate then
-- return "https://crates.io/crates/" .. crate
-- end
-- end,
-- },
-- },
-- handler_options = {
-- search_engine = "google", -- you can select between google, bing, duckduckgo, ecosia and yandex
-- search_engine = "https://search.brave.com/search?q=", -- or you can pass in a custom search engine
-- select_for_search = false, -- if your cursor is e.g. on a link, the pattern for the link AND for the word will always match. This disables this behaviour for default so that the link is opened without the select option for the word AND link
-- git_remotes = { "upstream", "origin" }, -- list of git remotes to search for git issue linking, in priority
-- git_remotes = function(fname) -- you can also pass in a function
-- if fname:match("myproject") then
-- return { "mygit" }
-- end
-- return { "upstream", "origin" }
-- end,
-- git_remote_push = false, -- use the push url for git issue linking,
-- git_remote_push = function(fname) -- you can also pass in a function
-- return fname:match("myproject")
-- end,
-- },
-- }
-- end,
}

View File

@@ -1,24 +0,0 @@
return {
"ggandor/leap.nvim",
config = function ()
require('leap')
vim.keymap.set("n", "<leader>s", "<Plug>(leap-forward-to)", { desc = "Leap forward to" })
-- default mapping: `s`
vim.keymap.set("n", "<leader>S", "<Plug>(leap-backward-to)", { desc = "Leap backward to" })
-- arguments: `{ backward = true }`
-- default mapping: `S`
vim.keymap.set("n", "<leader>b", "<Plug>(leap-forward-till)", { desc = "Leap forward till" } )
-- arguments: `{ offset = -1, inclusive_op = true }`
-- default mapping: `x` (Visual and Operator-pending mode only)
vim.keymap.set("n", "<leader>B", "<Plug>(leap-backward-till)", { desc = "Leap backward till" })
-- arguments: `{ backward = true, offset = 2 }`
-- default mapping: `X` (Visual and Operator-pending mode only)
-- <Plug>(leap-from-window)
-- arguments: `{ target_windows = require('leap.util').get_enterable_windows() }`
-- default mapping: `gs`
end
}

View File

@@ -1,49 +0,0 @@
return {
'VonHeikemen/lsp-zero.nvim',
branch = 'v2.x',
dependencies = {
-- LSP Support
{'neovim/nvim-lspconfig'}, -- Required
{'williamboman/mason.nvim'}, -- Optional
{'williamboman/mason-lspconfig.nvim'}, -- Optional
-- Autocompletion
{'hrsh7th/nvim-cmp'}, -- Required
{'hrsh7th/cmp-nvim-lsp'}, -- Required
{'L3MON4D3/LuaSnip'}, -- Required
},
config = function()
local lsp = require('lsp-zero')
lsp.preset('recommended')
lsp.on_attach(function(client, bufnr)
-- see :help lsp-zero-keybindings
-- to learn the available actions
lsp.default_keymaps({buffer = bufnr})
end)
lsp.setup_servers({'ts_ls', 'eslint', 'html', 'hls', 'gopls'})
-- require("lspconfig").html.setup({
-- filetypes = { "html", "htmldjango" },
-- init_options = {
-- configurationSection = { "html", "css", "javascript" },
-- embeddedLanguages = {
-- css = true,
-- javascript = true,
-- },
-- provideFormatter = true,
-- },
-- })
require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls())
lsp.set_sign_icons({
error = '',
warn = '',
hint = '',
info = '»'
})
lsp.setup()
end
}

View File

@@ -1,6 +1,225 @@
return {
"williamboman/mason.nvim",
config = function()
require("mason").setup()
end
-- Install LSP servers and 3rd-party tools
-- source: https://github.com/ruicsh/nvim-config/blob/main/lua/plugins/mason.lua
-- sauce: https://github.com/ruicsh/nvim-config/blob/main/lua/plugins/mason.lua
-- https://github.com/williamboman/mason.nvim
-- https://mason-registry.dev/registry/list
local PACKAGES = {
-- LSP
"angular-language-server",
"ansible-language-server",
"css-lsp",
"cssmodules-language-server",
"css-variables-language-server",
"dockerfile-language-server",
"harper-ls",
"html-lsp",
"json-lsp",
"lua-language-server",
"pyright",
"typescript-language-server",
"yaml-language-server",
-- Format
"black",
"flake8",
"prettierd",
"stylua",
-- Lint
"eslint-lsp",
"pylint",
"jq",
"php-cs-fixer",
"intelephense",
"prettier",
}
local function install(pack, version)
local notifyOpts = { title = "Mason", icon = "", id = "mason.install" }
local msg = version and ("[%s] updating to %s…"):format(pack.name, version)
or ("[%s] installing…"):format(pack.name)
vim.defer_fn(function()
vim.notify(msg, nil, notifyOpts)
end, 0)
pack:once("install:success", function()
local msg2 = ("[%s] %s"):format(pack.name, version and "updated." or "installed.")
notifyOpts.icon = ""
vim.defer_fn(function()
vim.notify(msg2, nil, notifyOpts)
end, 0)
end)
pack:once("install:failed", function()
local error = "Failed to install [" .. pack.name .. "]"
vim.defer_fn(function()
vim.notify(error, vim.log.levels.ERROR, notifyOpts)
end, 0)
end)
pack:install({ version = version })
end
local function syncPackages(ensurePacks)
local masonReg = require("mason-registry")
local function refreshCallback()
-- Auto-install missing packages & auto-update installed ones
vim.iter(ensurePacks):each(function(packName)
-- Extract package name and pinned version if specified
local name, pinnedVersion = packName:match("([^@]+)@?(.*)")
if not masonReg.has_package(name) then
return
end
local pack = masonReg.get_package(name)
if pack:is_installed() then
-- Only check for updates if no version was pinned
if pinnedVersion == "" then
local latest_version = pack:get_latest_version()
-- Check if the latest version is different from the installed one
if latest_version and latest_version ~= pack:get_installed_version() then
local msg = ("[%s] updating to %s…"):format(pack.name, latest_version)
vim.defer_fn(function()
vim.notify(msg, nil, { title = "Mason", icon = "󰅗" })
end, 0)
-- Install the latest version
pack:install({ version = latest_version })
end
end
else
-- Install with pinned version if specified
install(pack, pinnedVersion ~= "" and pinnedVersion or nil)
end
end)
-- Auto-clean unused packages
local installedPackages = masonReg.get_installed_package_names()
vim.iter(installedPackages):each(function(packName)
-- Check if installed package is in our ensure list (without version suffix)
local isEnsured = vim.iter(ensurePacks):any(function(ensurePack)
local name = ensurePack:match("([^@]+)")
return name == packName
end)
if not isEnsured then
masonReg.get_package(packName):uninstall()
local msg = ("[%s] uninstalled."):format(packName)
vim.defer_fn(function()
vim.notify(msg, nil, { title = "Mason", icon = "󰅗" })
end, 0)
end
end)
end
masonReg.refresh(refreshCallback)
end
return {
{
"williamboman/mason.nvim",
init = function()
-- Do not crowd home directory with NPM cache folder
vim.env.npm_config_cache = vim.env.HOME .. "/.cache/npm"
end,
opts = {
ui = {
border = "rounded",
height = 0.85,
width = 0.8,
},
},
config = function(_, opts)
require("mason").setup(opts)
-- Filter out disabled packages
local packages = {}
for _, package in ipairs(PACKAGES) do
table.insert(packages, package)
end
vim.defer_fn(function()
syncPackages(packages)
end, 3000)
end,
event = { "VeryLazy" },
},
{
"williamboman/mason-lspconfig.nvim",
dependencies = { "williamboman/mason.nvim" },
config = function()
local capabilities = require("cmp_nvim_lsp").default_capabilities()
local on_attach = function(client, bufnr)
local opts = { buffer = bufnr, silent = true }
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts)
vim.keymap.set("n", "go", vim.lsp.buf.type_definition, opts)
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
vim.keymap.set("n", "gs", vim.lsp.buf.signature_help, opts)
vim.keymap.set("n", "<F2>", vim.lsp.buf.rename, opts)
vim.keymap.set({ "n", "x" }, "<F3>", function()
vim.lsp.buf.format({ async = true })
end, opts)
vim.keymap.set("n", "<F4>", vim.lsp.buf.code_action, opts)
end
-- Configure LSP servers using new vim.lsp.config API
vim.lsp.config("lua_ls", {
on_attach = on_attach,
capabilities = capabilities,
settings = {
Lua = {
runtime = { version = "LuaJIT" },
diagnostics = { globals = { "vim" } },
workspace = {
library = vim.api.nvim_get_runtime_file("", true),
checkThirdParty = false,
},
telemetry = { enable = false },
},
},
})
vim.lsp.config("ts_ls", { on_attach = on_attach, capabilities = capabilities })
vim.lsp.config("pyright", { on_attach = on_attach, capabilities = capabilities })
vim.lsp.config("html", { on_attach = on_attach, capabilities = capabilities })
vim.lsp.config("cssls", { on_attach = on_attach, capabilities = capabilities })
vim.lsp.config("jsonls", { on_attach = on_attach, capabilities = capabilities })
vim.lsp.config("yamlls", { on_attach = on_attach, capabilities = capabilities })
vim.lsp.config("intelephense", {
on_attach = on_attach,
capabilities = capabilities,
settings = {
intelephense = {
format = {
enable = true,
},
},
},
})
vim.lsp.config("eslint", { on_attach = on_attach, capabilities = capabilities })
require("mason-lspconfig").setup({
ensure_installed = {
"lua_ls",
"ts_ls",
"pyright",
"html",
"cssls",
"jsonls",
"yamlls",
"intelephense",
"eslint",
},
automatic_installation = true,
})
end,
},
{
"neovim/nvim-lspconfig",
dependencies = { "williamboman/mason-lspconfig.nvim" },
},
}

View File

@@ -1,33 +0,0 @@
return {
"jay-babu/mason-null-ls.nvim",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"williamboman/mason.nvim",
"jose-elias-alvarez/null-ls.nvim",
},
config = function ()
require("mason-null-ls").setup({
ensure_installed = {
"stylua",
"jq",
"php-cs-fixer",
"intelephense",
"black",
"prettier",
}
})
local null_ls = require("null-ls")
local format = null_ls.builtins.formatting
null_ls.setup({
sources = {
format.black,
format.stylua,
format.prettier
}
})
vim.keymap.set({"n", "x"}, "=", function() vim.cmd('LspZeroFormat') end, { desc = "Format" })
end
}

View File

@@ -0,0 +1,63 @@
return {
{
"Kurama622/profile.nvim",
config = function()
local comp = require("profile.components")
require("profile").setup({
avatar_opts = {
force_blank = false,
},
disable_keys = {},
cursor_pos = { 17, 48 },
format = function()
local header = {
[[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣤⣴⣶⣶⣶⣶⣦⣤⡀⠀⠀⠀⠀]],
[[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⠟⠉⠉⠉⠉⠉⠛⠻⢿⣷⣄⠀⠀]],
[[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣼⣿⠟⠁⠀⠀⢠⣤⣄⠀⠀⠀⠀⠙⣿⣷⠀]],
[[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⠏⠀⠀⠀⠀⠘⠻⠋⠀⠀⠀⠀⠀⢸⣿⡇]],
[[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⣿⡏⠀⠀⣀⣀⣀⣠⣤⣤⣤⣤⣿⣄⠀⢠⣿⣧]],
[[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣿⣿⠀⠀⠀⠈⠻⣿⣶⠶⣶⣤⣤⣜⣿⣦⡈⢿⣿]],
[[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⠀⠀⠀⠀⠀⠈⠙⠻⢶⣤⣭⣛⣿⣿⣷⣼⣿]],
[[⠀⠀⠀⠀⠀⣰⣶⣾⠿⠿⢿⣷⣶⣄⠀⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠙⠛⠛⢛⣿⣿]],
[[⠀⠀⠀⠀⠀⢹⣿⣆⠀⠀⠀⠈⠻⢿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⡏]],
[[⠀⠀⠀⠀⠀⣸⣿⣿⠀⠀⠀⠀⠀⠀⢀⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⠀]],
[[⠀⠀⠀⢀⣾⣿⣿⡇⠀⠀⠀⠀⠀⠀⢸⠟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⡇⠀]],
[[⠀⠀⠀⣼⣿⠃⠹⣿⣷⣄⠀⠀⠀⠀⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⠇⠀]],
[[⠀⠀⠀⣿⡿⠀⠀⠈⠻⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⠀⠀]],
[[⠀⠀⢸⣿⣧⠀⠀⠀⠀⠸⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡷⠀⠀]],
[[⠀⠀⠈⣿⣿⡄⠀⠀⠀⠀⢻⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣿⡀⠀]],
[[⠀⠀⠀⣿⣿⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣧⠀]],
[[⠀⠀⠀⢻⣿⡟⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢿⣿⡇]],
[[⠀⠀⠀⠘⣿⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⡿]],
[[⠀⠀⠀⣤⣸⣿⣿⡷⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⠃]],
[[⠀⠀⠘⣿⡿⠿⣿⣿⣿⣷⡶⢶⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⣿⠏⠀]],
[[⠀⠀⢀⣿⡟⠀⠀⠀⠀⠀⠀⠈⣿⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⡿⠟⠉⠀⠀]],
[[⠀⠀⣼⣿⠇⠀⣴⣄⠀⠀⠀⠀⢹⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣶⣿⠟⠁⠀⠀⠀⠀]],
[[⢀⣼⣿⠋⠀⠀⠘⣿⣧⠀⠀⠀⢸⣿⣧⣄⣀⠀⠀⠀⢀⣀⣤⣶⣿⣿⠋⠁⠀⠀⠀⠀⠀⠀]],
[[⢾⣯⣁⠀⠀⠀⠀⠈⢿⡄⠀⠀⣸⡿⠉⠙⠛⠛⠛⠛⢻⣿⡏⢹⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀]],
[[⠀⠛⢿⣷⣦⣤⣀⡀⠀⠀⠀⣠⣿⣷⣶⣶⣶⣶⣶⣦⣤⣿⣿⡜⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀]],
[[⠀⠀⠀⠈⠙⠛⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⢻⡿⣷⣶⣤⣀⠀⠀⠀⠀]],
[[⠀⠀⠀⠀⠀⠀⠸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣏⣁⡸⠟⠈⣩⣿⣿⣿⠶⠀⠀]],
[[⠀⠀⠀⣠⣴⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣿⠟⠋⠁⠀⠀⠀⠀]],
[[⠀⠀⠀⠙⠿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠋⠉⠀⠀⠀⠀⠀⠀⠀⠀]],
[[⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠉⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀]],
[[ WADDLE WADDLE WADDLE ]],
}
for _, line in ipairs(header) do
comp:text_component_render({ comp:text_component(line, "center", "ProfileBlue") })
end
comp:separator_render()
handle = io.popen("curl -s -m 3 https://vtip.43z.one")
result = handle:read("*a")
handle:close()
comp:text_component_render({
comp:text_component("Neovim Tip of the Day:", "center", "ProfileGreen"),
comp:text_component(result or "Could not fetch tip.", "center", "ProfileGreen"),
})
end,
})
vim.api.nvim_set_keymap("n", "<leader>p", "<cmd>Profile<cr>", { silent = true })
end,
},
}

View File

@@ -45,14 +45,7 @@ return {
additional_vim_regex_highlighting = {"markdown"}
},
}
require'lspconfig'.sourcekit.setup{
cmd = {'/usr/bin/sourcekit-lsp'}
}
require('lspconfig')['hls'].setup{
filetypes = { 'haskell', 'lhaskell', 'cabal' },
}
-- vim.keymap.set('n','gd',vim.lsp.buf.definition)
end
}

View File

@@ -17,6 +17,8 @@ alias gch="git checkout"
alias lg="ls | grep"
alias gdc="git diff --cached"
function gas() {
git add --all
git status
@@ -127,12 +129,8 @@ function ccd() {
printf "%q" "$(pwd)" | pbcopy
}
alias tat="tmux attach -t"
alias t="tmux"
alias tls="tmux ls"
function ip() {
dig +short myip.opendns.com @resolver1.opendns.com
}

View File

@@ -1,25 +1,21 @@
function mx() {
PROJECT_DIR=$1
if [[ -z "$PROJECT_DIR" ]]; then
echo "Usage: mx <project_directory> [SESSION_NAME]"
return 1
fi
ALL_PROJECTS=$(get_mux_sessions)
IS_VALID_PROJECT=$(echo $ALL_PROJECTS | grep -o "\b$PROJECT_DIR\w*" | head -1)
function tat() {
PROJECT_DIR=${1:-.}
SAFE_INPUT=$(printf '%s\n' "$PROJECT_DIR" | sed 's/[][\.^$*+?{}|()]/\\&/g')
ALL_PROJECTS=$(tls)
IS_VALID_PROJECT=$(echo $ALL_PROJECTS | grep -io "[[:<:]]$SAFE_INPUT\w*" | head -1)
if [[ $IS_VALID_PROJECT != "" ]]; then
echo $IS_VALID_PROJECT
tmuxinator start "$IS_VALID_PROJECT"
return 1
fi
SESSION_NAME=${2:-$(basename $(realpath "$PROJECT_DIR"))}
WHOLE_PATH=$(realpath "$PROJECT_DIR")
if [[ $WHOLE_PATH == "*No such file or directory*" ]]; then
if [ -d "$PROJECT_DIR" ]; then
else
echo "Directory does not exist: $PROJECT_DIR"
return 1
fi
WHOLE_PATH=$(realpath "$PROJECT_DIR")
SESSION_NAME=${2:-$(basename $WHOLE_PATH)}
# check if file doesn't exist yet in the tmuxinator config directory
TMUXINATOR_CONFIG=~/.config/tmuxinator/$SESSION_NAME.yml
if [[ -f $TMUXINATOR_CONFIG ]]; then
@@ -34,21 +30,27 @@ function mx() {
}
function get_mux_sessions() {
ALL_PROJECTS=$(tmuxinator list | grep -v tmuxinator)
echo $ALL_PROJECTS
function tls() {
tmuxinator list | grep -v tmuxinator | tr ' ' '\n' | grep -v '^$'
}
function _mx_autocomplete() {
local cur
cur="${COMP_WORDS[COMP_CWORD]}"
local projects="$(get_mux_sessions)"
COMPREPLY=()
while IFS= read -r line; do
COMPREPLY+=("$line")
done < <(
{ compgen -W "$projects" -- "$cur"; compgen -f -- "$cur"; } | sort -u
)
local -a projects files dirs
local expl
# Get tmuxinator projects
projects=(${(f)"$(tls)"})
# Get files and directories with proper completion
_alternative \
'projects:tmuxinator projects:compadd -a projects' \
'files:files:_files'
}
complete -f -F _mx_autocomplete -o default mx
# Register the completion function for zsh
if [[ -n ${ZSH_VERSION-} ]]; then
compdef _mx_autocomplete tat
else
# Fallback for bash
complete -f -F _mx_autocomplete -o default tat
fi

42
tmux/bin/fuzzy-switch.sh Executable file
View File

@@ -0,0 +1,42 @@
#!/usr/bin/env bash
die() {
printf "\n[tmux-fuzzy] %s\n" "$1" >&2
# keep popup visible if we're in a popup
if [ -n "${TMUX:-}" ]; then
printf "Press ENTER to close..."
read -r _ || true
fi
exit 1
}
list_projects() {
tmuxinator list 2>/dev/null \
| sed '1{/tmuxinator projects:/d;}' \
| tr -s '[:space:]' '\n' \
| grep -E '^[[:alnum:]_.:-]+$' \
|| true
}
# unique + sorted
items="$(list_projects | sort -u)"
[ -n "$items" ] || die "No tmuxinator projects found."
sel="$(
printf '%s\n' "$items" | fzf \
--prompt='Project > ' \
--height=100% --layout=reverse \
--print-query --expect=enter \
--bind 'tab:down,btab:up' \
--cycle
)" || exit 0
key="$(printf '%s\n' "$sel" | sed -n '1p')"
query="$(printf '%s\n' "$sel" | sed -n '2p' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')"
choice="$(printf '%s\n' "$sel" | sed -n '3p')"
project="${choice:-$query}"
[ -n "$project" ] || exit 0
tmuxinator start "$project"
exit 0

View File

@@ -66,5 +66,8 @@ set -g @plugin 'omerxx/tmux-sessionx'
set -g @plugin 'christoomey/vim-tmux-navigator'
bind-key s display-popup -w 30% -h 30% -E "~/.config/tmux/bin/fuzzy-switch.sh"
bind-key f display-popup -w 30% -h 30% -E "~/.config/tmux/bin/fuzzy-switch.sh"
# Initialise tmux plugin manager (needs to be at the bottom of the file)
run '~/.config/tmux/plugins/tpm/tpm'

View File

@@ -5,6 +5,6 @@ windows:
- zsh:
layout: b8f6,198x59,0,0[198x39,0,0,71,198x19,0,40{99x19,0,40,73,98x19,100,40,75}]
panes:
- nvim
- nvim .
-
-
- dcud