Compare commits

...

12 Commits

20 changed files with 330 additions and 201 deletions

2
.gitignore vendored
View File

@@ -15,3 +15,5 @@ gcloud/
htop/ htop/
mcphub mcphub
spicetify spicetify
gh/hosts.yml
raycast

16
gh/config.yml Normal file
View File

@@ -0,0 +1,16 @@
# What protocol to use when performing git operations. Supported values: ssh, https
git_protocol: https
# What editor gh should run when creating issues, pull requests, etc. If blank, will refer to environment.
editor:
# When to interactively prompt. This is a global config that cannot be overridden by hostname. Supported values: enabled, disabled
prompt: enabled
# A pager program to send command output to, e.g. "less". Set the value to "cat" to disable the pager.
pager:
# Aliases allow you to create nicknames for gh commands
aliases:
co: pr checkout
# The path to a unix socket through which send HTTP connections. If blank, HTTP traffic will be handled by net/http.DefaultTransport.
http_unix_socket:
# What web browser gh should use when opening URLs. If blank, will refer to environment.
browser:
version: "1"

View File

@@ -1,102 +1,104 @@
return { return {}
"yetone/avante.nvim", -- "yetone/avante.nvim",
event = "VeryLazy", -- event = "VeryLazy",
lazy = false, -- lazy = false,
config = function(_, opts) -- config = function(_, opts)
require("avante").setup(opts) -- require("avante").setup(opts)
-- Then remove the default mappings -- -- Then remove the default mappings
vim.schedule(function() -- vim.schedule(function()
vim.keymap.del({ "n", "v" }, "<leader>aa") -- vim.keymap.del({ "n", "v" }, "<leader>aa")
vim.keymap.del("n", "<leader>ar") -- vim.keymap.del("n", "<leader>ar")
vim.keymap.del("v", "<leader>ae") -- vim.keymap.del("v", "<leader>ae")
vim.keymap.del("n", "<leader>ah") -- vim.keymap.del("n", "<leader>ah")
vim.keymap.del("n", "<leader>ad") -- vim.keymap.del("n", "<leader>ad")
vim.keymap.del("n", "<leader>af") -- vim.keymap.del("n", "<leader>af")
vim.keymap.del("n", "<leader>aR") -- vim.keymap.del("n", "<leader>aR")
vim.keymap.del("n", "<leader>as") -- vim.keymap.del("n", "<leader>as")
vim.keymap.del("n", "<leader>at") -- vim.keymap.del("n", "<leader>at")
vim.keymap.del("n", "<leader>a?") -- vim.keymap.del("n", "<leader>a?")
vim.keymap.del("n", "<leader>aB") -- vim.keymap.del("n", "<leader>aB")
vim.keymap.del("n", "<leader>aS") -- vim.keymap.del("n", "<leader>aS")
vim.keymap.del("n", "<leader>an") -- vim.keymap.del("n", "<leader>an")
end) -- vim.keymap.del("n", "<leader>aC")
end, -- vim.keymap.del("n", "<leader>az")
opts = { -- end)
-- add any opts here -- end,
provider = "copilot", -- opts = {
providers = { -- -- add any opts here
copilot = { -- provider = "copilot",
model = "claude-sonnet-4", -- providers = {
-- max_tokens = 4096, -- copilot = {
}, -- model = "claude-sonnet-4",
}, -- -- max_tokens = 4096,
system_prompt = function() -- },
local hub = require("mcphub").get_hub_instance() -- },
return hub and hub:get_active_servers_prompt() or "" -- system_prompt = function()
end, -- local hub = require("mcphub").get_hub_instance()
-- Using function prevents requiring mcphub before it's loaded -- return hub and hub:get_active_servers_prompt() or ""
custom_tools = function() -- end,
return { -- -- Using function prevents requiring mcphub before it's loaded
require("mcphub.extensions.avante").mcp_tool(), -- custom_tools = function()
} -- return {
end, -- require("mcphub.extensions.avante").mcp_tool(),
}, -- }
build = "make", -- end,
keys = { -- },
{ -- build = "make",
"<leader>ca", -- keys = {
function() -- {
require("avante.api").ask() -- "<leader>ca",
end, -- function()
desc = "avante: ask", -- require("avante.api").ask()
mode = { "n", "v" }, -- end,
}, -- desc = "avante: ask",
{ -- mode = { "n", "v" },
"<leader>cr", -- },
function() -- {
require("avante.api").refresh() -- "<leader>cr",
end, -- function()
desc = "avante: refresh", -- require("avante.api").refresh()
}, -- end,
{ -- desc = "avante: refresh",
"<leader>ce", -- },
function() -- {
require("avante.api").edit() -- "<leader>ce",
end, -- function()
desc = "avante: edit", -- require("avante.api").edit()
mode = "v", -- end,
}, -- desc = "avante: edit",
{ -- mode = "v",
"<leader>ch", -- },
function() -- {
require("avante.api").hint() -- "<leader>ch",
end, -- function()
desc = "avante: hint", -- require("avante.api").hint()
mode = "n", -- end,
}, -- desc = "avante: hint",
{ -- mode = "n",
"<leader>cd", -- },
function() -- {
require("avante.api").debug() -- "<leader>cd",
end, -- function()
desc = "avante: debug", -- require("avante.api").debug()
mode = "n", -- end,
}, -- desc = "avante: debug",
}, -- mode = "n",
dependencies = { -- },
"stevearc/dressing.nvim", -- },
"nvim-lua/plenary.nvim", -- dependencies = {
"MunifTanjim/nui.nvim", -- "stevearc/dressing.nvim",
--- The below dependencies are optional, -- "nvim-lua/plenary.nvim",
-- "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons -- "MunifTanjim/nui.nvim",
{ -- --- The below dependencies are optional,
-- Make sure to setup it properly if you have lazy=true -- -- "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons
"MeanderingProgrammer/render-markdown.nvim", -- {
-- "zbirenbaum/copilot.lua", -- for providers='copilot' -- -- Make sure to setup it properly if you have lazy=true
opts = { -- "MeanderingProgrammer/render-markdown.nvim",
file_types = { "markdown", "Avante" }, -- -- "zbirenbaum/copilot.lua", -- for providers='copilot'
}, -- opts = {
ft = { "markdown", "Avante" }, -- file_types = { "markdown", "Avante" },
}, -- },
}, -- ft = { "markdown", "Avante" },
} -- },
-- },
-- }

View File

@@ -1,8 +1,8 @@
return { return {
"numToStr/Comment.nvim", "numToStr/Comment.nvim",
event = "VeryLazy", keys = {
lazy = false, { "<leader>/", desc = "Toggle comment" },
},
config = function () config = function ()
require('Comment').setup({ require('Comment').setup({
opleader = { opleader = {

View File

@@ -1,11 +1,8 @@
return { return {
'tamton-aquib/duck.nvim', "tamton-aquib/duck.nvim",
config = function() keys = {
local duck = require("duck") { "<leader>dd", function() require("duck").hatch() end, desc = "Duck hatch" },
vim.keymap.set('n', '<leader>dd', function() duck.hatch() end, {}) { "<leader>dc", function() require("duck").hatch("🐿️", 20) end, desc = "Duck squirrel" },
vim.keymap.set('n', '<leader>dc', function() duck.hatch("🐿️", 20) end, {}) { "<leader>dk", function() require("duck").cook() end, desc = "Duck cook" },
vim.keymap.set('n', '<leader>dk', function() duck.cook() end, {}) },
vim.keymap.set('n', '<leader>dk', function() duck.cook("🐿️") end, {})
-- duck.hatch("🐿️", 20)
end
} }

View File

@@ -1,19 +1,17 @@
return { return {
"lewis6991/gitsigns.nvim", "lewis6991/gitsigns.nvim",
event = "VeryLazy", event = "VeryLazy",
opts = function() opts = {
return { signs = {
signs = { add = { text = "|" },
add = { text = "" }, change = { text = "|" },
change = { text = "" }, delete = { text = "" },
delete = { text = "󰍵" }, topdelete = { text = "" },
topdelete = { text = "" }, changedelete = { text = "~" },
changedelete = { text = "~" }, untracked = { text = "|" },
untracked = { text = "" }, },
} },
} config = function(_, opts)
end, require("gitsigns").setup(opts)
config = function() end,
require("gitsigns").setup()
end
} }

View File

@@ -1,3 +1,4 @@
return { return {
"https://github.com/plentiform/go-ide", "https://github.com/plentiform/go-ide",
ft = "go",
} }

View File

@@ -1,14 +1,14 @@
return { return {
"nvim-lualine/lualine.nvim", "nvim-lualine/lualine.nvim",
event = "VeryLazy", event = "VeryLazy",
requires = { "nvim-tree/nvim-web-devicons", opt = true }, dependencies = { "nvim-tree/nvim-web-devicons" },
init = function() config = function()
local lualine = require("lualine") local lualine = require("lualine")
local custom_ayu_mirage = require("lualine.themes.ayu_mirage") local custom_ayu_mirage = require("lualine.themes.ayu_mirage")
custom_ayu_mirage.normal.c.bg = "#172c35" custom_ayu_mirage.normal.c.bg = "#172c35"
lualine.setup({ lualine.setup({
section_separators = { left = "", right = "" }, section_separators = { left = "", right = "" },
component_separators = { left = "", right = "" }, component_separators = { left = "", right = "" },
sections = { sections = {
lualine_a = { "mode" }, lualine_a = { "mode" },
lualine_b = { "branch", "diff", "diagnostics" }, lualine_b = { "branch", "diff", "diagnostics" },

View File

@@ -6,7 +6,6 @@
-- https://mason-registry.dev/registry/list -- https://mason-registry.dev/registry/list
local PACKAGES = { local PACKAGES = {
-- LSP -- LSP
"angular-language-server",
"ansible-language-server", "ansible-language-server",
"css-lsp", "css-lsp",
"cssmodules-language-server", "cssmodules-language-server",
@@ -189,6 +188,20 @@ return {
vim.lsp.config("ts_ls", { vim.lsp.config("ts_ls", {
on_attach = on_attach, on_attach = on_attach,
capabilities = capabilities, capabilities = capabilities,
root_markers = { "tsconfig.json", "jsconfig.json", "package.json", ".git" },
init_options = {
hostInfo = "neovim",
preferences = {
importModuleSpecifierPreference = "relative",
},
},
settings = {
typescript = {
preferences = {
importModuleSpecifierPreference = "relative",
},
},
},
}) })
vim.lsp.enable("ts_ls") vim.lsp.enable("ts_ls")
@@ -196,6 +209,7 @@ return {
vim.lsp.config("html", { 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("cssls", { on_attach = on_attach, capabilities = capabilities })
vim.lsp.config("jsonls", { on_attach = on_attach, capabilities = capabilities }) vim.lsp.config("jsonls", { on_attach = on_attach, capabilities = capabilities })
vim.lsp.enable("jsonls")
vim.lsp.config("yamlls", { on_attach = on_attach, capabilities = capabilities }) vim.lsp.config("yamlls", { on_attach = on_attach, capabilities = capabilities })
vim.lsp.config("intelephense", { vim.lsp.config("intelephense", {
on_attach = on_attach, on_attach = on_attach,
@@ -208,7 +222,15 @@ return {
}, },
}, },
}) })
vim.lsp.config("eslint", { on_attach = on_attach, capabilities = capabilities }) vim.lsp.config("eslint", {
on_attach = on_attach,
capabilities = capabilities,
root_markers = { "eslint.config.js", ".eslintrc.js", ".eslintrc.json", ".eslintrc", "package.json" },
settings = {
workingDirectories = { mode = "auto" },
},
})
vim.lsp.enable("eslint")
vim.lsp.config("vue_ls", { vim.lsp.config("vue_ls", {
on_attach = on_attach, on_attach = on_attach,
capabilities = capabilities, capabilities = capabilities,

View File

@@ -1,5 +1,6 @@
return { return {
"ravitemer/mcphub.nvim", "ravitemer/mcphub.nvim",
event = "VeryLazy",
dependencies = { dependencies = {
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
}, },

View File

@@ -3,6 +3,7 @@ return {
"Kurama622/profile.nvim", "Kurama622/profile.nvim",
config = function() config = function()
local comp = require("profile.components") local comp = require("profile.components")
require("profile").setup({ require("profile").setup({
avatar_opts = { avatar_opts = {
force_blank = false, force_blank = false,
@@ -48,15 +49,44 @@ return {
end end
comp:separator_render() comp:separator_render()
handle = io.popen("curl -s -m 3 https://vtip.43z.one") comp:text_component_render({
result = handle:read("*a") comp:text_component("Neovim Tip of the Day:", "center", "ProfileGreen"),
handle:close() comp:text_component("Loading...", "center", "ProfileGreen"),
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, end,
}) })
-- Fetch tip asynchronously and update the buffer
vim.fn.jobstart({ "curl", "-s", "-m", "3", "https://vtip.43z.one" }, {
stdout_buffered = true,
on_stdout = function(_, data)
if data and data[1] and data[1] ~= "" then
local tip = table.concat(data, "")
vim.schedule(function()
-- Find the profile buffer
for _, buf in ipairs(vim.api.nvim_list_bufs()) do
if vim.api.nvim_buf_is_loaded(buf) then
local lines = vim.api.nvim_buf_get_lines(buf, 0, -1, false)
for i, line in ipairs(lines) do
if line:match("Loading%.%.%.") then
-- Replace "Loading..." with the actual tip
local width = vim.api.nvim_win_get_width(0)
local padding = math.floor((width - #tip) / 2)
local centered_tip = string.rep(" ", math.max(0, padding)) .. tip
vim.api.nvim_buf_set_option(buf, "modifiable", true)
vim.api.nvim_buf_set_lines(buf, i - 1, i, false, { centered_tip })
vim.api.nvim_buf_set_option(buf, "modifiable", false)
vim.api.nvim_buf_set_option(buf, "modified", false)
return
end
end
end
end
end)
end
end,
})
vim.api.nvim_set_keymap("n", "<leader>p", "<cmd>Profile<cr>", { silent = true }) vim.api.nvim_set_keymap("n", "<leader>p", "<cmd>Profile<cr>", { silent = true })
end, end,
}, },

View File

@@ -1,10 +1,19 @@
return { return {
"danielfalk/smart-open.nvim", "danielfalk/smart-open.nvim",
branch = "0.2.x", branch = "0.2.x",
config = function() lazy = true,
require("telescope").load_extension("smart_open") keys = {
end, {
"<leader>ff",
function()
require("telescope").load_extension("smart_open")
require("telescope").extensions.smart_open.smart_open()
end,
desc = "Smart Open",
},
},
dependencies = { dependencies = {
"kkharji/sqlite.lua", "kkharji/sqlite.lua",
"nvim-telescope/telescope.nvim",
}, },
} }

View File

@@ -19,18 +19,48 @@ local new_maker = function(filepath, bufnr, opts)
previewers.buffer_previewer_maker(filepath, bufnr, opts) previewers.buffer_previewer_maker(filepath, bufnr, opts)
end end
local function grepInFiles()
local builtin = require("telescope.builtin")
local actions = require("telescope.actions")
local action_state = require("telescope.actions.state")
builtin.filetypes({
attach_mappings = function(prompt_bufnr, _)
actions.select_default:replace(function()
actions.close(prompt_bufnr)
local selection = action_state.get_selected_entry()
local filetype = selection.value
builtin.live_grep({
additional_args = function()
return { "--glob", "*." .. filetype }
end,
})
end)
return true
end,
})
end
return { return {
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim",
event = "VeryLazy", cmd = "Telescope",
tag = "0.1.8", tag = "0.1.8",
dependencies = { "nvim-lua/plenary.nvim" }, dependencies = { "nvim-lua/plenary.nvim" },
init = function() keys = {
local builtin = require("telescope.builtin") { "<leader>ft", grepInFiles, desc = "Live grep by filetype" },
{ "<leader>*", function() require("telescope.builtin").grep_string() end, desc = "Grep current string" },
{ "<leader>fs", function() require("telescope.builtin").find_files() end, desc = "Find files" },
{ "<leader>fg", function() require("telescope.builtin").git_branches() end, desc = "Find Git branches" },
{ "<leader>fc", function() require("telescope.builtin").git_commits() end, desc = "Find Commits" },
{ "<leader>fw", function() require("telescope.builtin").live_grep() end, desc = "Find Words" },
},
config = function()
local telescope = require("telescope") local telescope = require("telescope")
telescope.setup({ telescope.setup({
extensions = { extensions = {
smart_open = { smart_open = {
cwd_only = true,
mappings = { mappings = {
i = { i = {
-- works around smart_open overriding ctrl-w keybind for deleting -- works around smart_open overriding ctrl-w keybind for deleting
@@ -81,38 +111,5 @@ return {
filesize_limit = 0.5, -- MB filesize_limit = 0.5, -- MB
}, },
}) })
local function grepInFiles()
local actions = require("telescope.actions")
local action_state = require("telescope.actions.state")
builtin.filetypes({
attach_mappings = function(prompt_bufnr, _)
actions.select_default:replace(function()
actions.close(prompt_bufnr)
local selection = action_state.get_selected_entry()
local filetype = selection.value
builtin.live_grep({
additional_args = function()
return { "--glob", "*." .. filetype }
end,
})
end)
return true
end,
})
end
local function smart_open()
require("telescope").extensions.smart_open.smart_open()
end
vim.keymap.set("n", "<leader>ft", grepInFiles, { desc = "Live grep by filetype" })
vim.keymap.set("n", "<leader>*", builtin.grep_string, { desc = "Grep current string" })
vim.keymap.set("n", "<leader>fs", builtin.find_files, { desc = "Find files" })
vim.keymap.set("n", "<leader>fg", builtin.git_branches, { desc = "Find Git branches" })
vim.keymap.set("n", "<leader>fc", builtin.git_commits, { desc = "Find Commits" })
vim.keymap.set("n", "<leader>fw", builtin.live_grep, { desc = "Find Words" })
vim.keymap.set("n", "<leader>ff", smart_open, { desc = "Smart Open" })
end, end,
} }

View File

@@ -1,7 +1,5 @@
# Fig pre block. Keep at the top of this file.
[[ -f "$HOME/.fig/shell/zshrc.pre.zsh" ]] && builtin source "$HOME/.fig/shell/zshrc.pre.zsh"
# Theme # Theme
fpath+=("$(brew --prefix)/share/zsh/site-functions") fpath+=("/opt/homebrew/share/zsh/site-functions")
fpath+=$HOME/.zsh/pure fpath+=$HOME/.zsh/pure
autoload -U promptinit; promptinit autoload -U promptinit; promptinit
@@ -12,21 +10,26 @@ prompt pure
# If you come from bash you might have to change your $PATH. # If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:/opt/homebrew/bin:$PATH export PATH=$HOME/bin:/usr/local/bin:/opt/homebrew/bin:$PATH
export PATH=$(go env GOPATH)/bin:$PATH export PATH="$HOME/go/bin:$PATH"
export PATH=/User/oliverhnat/.local/bin/claude:$PATH export PATH=/User/oliverhnat/.local/bin/claude:$PATH
export EDITOR="/opt/homebrew/bin/nvim" export EDITOR="/opt/homebrew/bin/nvim"
# Path to your oh-my-zsh installation. # Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh" export ZSH="$HOME/.oh-my-zsh"
# Skip compaudit (saves ~150ms on cold start)
ZSH_DISABLE_COMPFIX=true
export LC_ALL="en_US.UTF-8" export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8" export LC_CTYPE="en_US.UTF-8"
export HOMEBREW_NO_AUTO_UPDATE=1
export GITLAB_URL=https://gitlab.elnino.tech
export ANTHROPIC_API_KEY= export ANTHROPIC_API_KEY=
export GEMINI_API_KEY= export GEMINI_API_KEY=
export HOMEBREW_NO_AUTO_UPDATE=1
export GITLAB_TOKEN= export GITLAB_TOKEN=
export GITLAB_URL=
export TAVILY_API_KEY= export TAVILY_API_KEY=
# Set name of the theme to load --- if set to "random", it will # Set name of the theme to load --- if set to "random", it will
@@ -97,10 +100,11 @@ ZSH_THEME=""
# Add wisely, as too many plugins slow down shell startup. # Add wisely, as too many plugins slow down shell startup.
plugins=( plugins=(
tmuxinator
git git
yarn yarn
docker # docker
docker-compose # docker-compose
zsh-autosuggestions zsh-autosuggestions
zsh-z zsh-z
zsh-syntax-highlighting # Needs to be the last plugin zsh-syntax-highlighting # Needs to be the last plugin
@@ -135,18 +139,15 @@ source $ZSH/oh-my-zsh.sh
# Change colors of the LS command output # Change colors of the LS command output
# export LSCOLORS=Dxfxcxdxbxegedabagacad # export LSCOLORS=Dxfxcxdxbxegedabagacad
source /Users/oliverhnat/.docker/init-zsh.sh || true # Added by Docker Desktop
# User configuration # User configuration
source ~/.oh-my-zsh/custom/custom_commands.sh source ~/.config/omz-custom/custom_commands.sh
source ~/.config/omz-custom/tmux-sessions.sh
[ -f "/Users/oliverhnat/.ghcup/env" ] && . "/Users/oliverhnat/.ghcup/env" # ghcup-env [ -f "/Users/oliverhnat/.ghcup/env" ] && . "/Users/oliverhnat/.ghcup/env" # ghcup-env
. "$HOME/.local/bin/env" . "$HOME/.local/bin/env"
export NVM_DIR="$HOME/.nvm" source ~/.config/omz-custom/nvm.sh
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
export PATH="$HOME/.local/bin:$PATH" export PATH="$HOME/.local/bin:$PATH"

View File

@@ -103,10 +103,16 @@ function _tat_autocomplete() {
'files:files:_files' 'files:files:_files'
} }
function _rut() {
# Complete with files, preferring tests/ directory
_files -g '*.php'
}
# Register the completion function for zsh # Register the completion function for zsh
if [[ -n ${ZSH_VERSION-} ]]; then if [[ -n ${ZSH_VERSION-} ]]; then
compdef _tat_autocomplete tat compdef _tat_autocomplete tat
compdef _cmr cmr compdef _cmr cmr
compdef _rut rut
else else
# Fallback for bash # Fallback for bash
complete -f -F _tat_autocomplete -o default tat complete -f -F _tat_autocomplete -o default tat

View File

@@ -86,6 +86,10 @@ function rutvrm () {
docker-compose exec -T mysql mysql --host=mysql --password=deadbeef --database=vrm_testing < tests/resources/db/*.sql docker-compose exec -T mysql mysql --host=mysql --password=deadbeef --database=vrm_testing < tests/resources/db/*.sql
} }
function rut() {
rutvrm && docker compose exec app composer test "$@"
}
alias yas="yarn serve" alias yas="yarn serve"
alias yai="yarn install" alias yai="yarn install"
@@ -162,6 +166,16 @@ function dbar() {
} }
function gcmr() {
if [[ "$*" == "--draft" ]]
then
draft="--draft"
else
draft=""
fi
gh pr create -a "@me" --fill $draft
}
function cmr() { function cmr() {
if [[ "$*" == "--draft" ]] if [[ "$*" == "--draft" ]]
then then
@@ -275,6 +289,7 @@ alias gl="glab"
alias glci="glab ci view" alias glci="glab ci view"
alias glciw="glab ci view --web" alias glciw="glab ci view --web"
alias glmr="glab mr view --web" alias glmr="glab mr view --web"
alias mr=glmr
# get snippets from elnino gitlab # get snippets from elnino gitlab
function gitlab_snippets() { function gitlab_snippets() {

10
omz-custom/nvm.sh Normal file
View File

@@ -0,0 +1,10 @@
# NVM lazy loading (speeds up shell startup significantly)
export NVM_DIR="$HOME/.nvm"
nvm() {
unset -f nvm node npm npx
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm "$@"
}
node() { nvm; unset -f node; node "$@"; }
npm() { nvm; unset -f npm; npm "$@"; }
npx() { nvm; unset -f npx; npx "$@"; }

View File

@@ -4,6 +4,17 @@ function tat() {
ALL_PROJECTS=$(tls) ALL_PROJECTS=$(tls)
IS_VALID_PROJECT=$(echo $ALL_PROJECTS | grep -io "[[:<:]]$SAFE_INPUT\w*" | head -1) IS_VALID_PROJECT=$(echo $ALL_PROJECTS | grep -io "[[:<:]]$SAFE_INPUT\w*" | head -1)
if [[ $IS_VALID_PROJECT != "" ]]; then if [[ $IS_VALID_PROJECT != "" ]]; then
if [[ "$IS_VALID_PROJECT" == "vrm-deploy" ]] && tmux has-session -t vrm-deploy 2>/dev/null; then
current_session=$(tmux display-message -p '#S' 2>/dev/null)
if [[ "$current_session" == "vrm-deploy" ]]; then
tmux rename-session -t vrm-deploy vrm-deploy-old
tmuxinator start vrm-deploy
tmux kill-session -t vrm-deploy-old 2>/dev/null
return 0
else
tmux kill-session -t vrm-deploy 2>/dev/null
fi
fi
tmuxinator start "$IS_VALID_PROJECT" tmuxinator start "$IS_VALID_PROJECT"
return 1 return 1
fi fi

View File

@@ -37,6 +37,18 @@ choice="$(printf '%s\n' "$sel" | sed -n '3p')"
project="${choice:-$query}" project="${choice:-$query}"
[ -n "$project" ] || exit 0 [ -n "$project" ] || exit 0
if [ "$project" = "vrm-deploy" ] && tmux has-session -t vrm-deploy 2>/dev/null; then
current_session=$(tmux display-message -p '#S' 2>/dev/null)
if [ "$current_session" = "vrm-deploy" ]; then
tmux rename-session -t vrm-deploy vrm-deploy-old
tmuxinator start vrm-deploy
tmux kill-session -t vrm-deploy-old 2>/dev/null
exit 0
else
tmux kill-session -t vrm-deploy 2>/dev/null
fi
fi
tmuxinator start "$project" tmuxinator start "$project"
exit 0 exit 0

View File

@@ -67,7 +67,6 @@ set -g @plugin 'omerxx/tmux-sessionx'
set -g @plugin 'christoomey/vim-tmux-navigator' 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 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) # Initialise tmux plugin manager (needs to be at the bottom of the file)
run '~/.config/tmux/plugins/tpm/tpm' run '~/.config/tmux/plugins/tpm/tpm'