diff --git a/.install_skripte/install_terminal_pcks.sh b/.install_skripte/install_terminal_pcks.sh deleted file mode 100755 index 22b6148..0000000 --- a/.install_skripte/install_terminal_pcks.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -sudo pacman -S --needed \ - nodejs \ - npm \ - starship \ - fastfetch \ - tree-sitter-cli \ - ruff \ - python-ruff \ - chromium \ - selene \ - opencode \ - tmux \ - yazi \ - zoxide \ - fzf \ - locate - -npm install -g vscode-js-debug -npm install -g eslint_d -ya pkg add yazi-rs/plugins:git -sudo updatedb diff --git a/Makefile b/Makefile index b4d9162..6a2eb22 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,21 @@ # setup ist ein Kommando-Target (keine Datei) und soll immer ausgeführt werden. .PHONY: basic -basic: - bash .install_skripte/install_basic_pcks.sh +termn: + bash _install_skripte_install_terminal_pcks.sh + stow term +basic: term + bash _install_skripte_install_basic_pcks.sh stow nvim - bash .install_skripte/nextcloud.sh + bash _install_skripte/nextcloud.sh hypr: basic - bash .install_skripte/install_hypr_pcks.sh + bash _install_skripte_install_hypr_pcks.sh stow hypr bash hypr/.config/hypr/scripts/ensure-env.sh bash hypr/.config/hypr/scripts/portal-host-override.sh bash hypr/.config/hypr/scripts/fix_dolphin_file_associations.sh kreation: basic - bash .install_skripte/install_kreation_pcks.sh + bash _install_skripte_install_kreation_pcks.sh stow kreation bunters-monster: basic hypr kreation - .install_skripte/buntes-monster-links.sh + _install_skripte/buntes-monster-links.sh diff --git a/.install_skripte/buntes-monster-links.sh b/_install_skripte/buntes-monster-links.sh similarity index 100% rename from .install_skripte/buntes-monster-links.sh rename to _install_skripte/buntes-monster-links.sh diff --git a/_install_skripte/install_basic_pcks.sh b/_install_skripte/install_basic_pcks.sh new file mode 100755 index 0000000..18f83e4 --- /dev/null +++ b/_install_skripte/install_basic_pcks.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +sudo pacman -S --needed \ + firefox \ + nextcloud-client \ + cups \ + wine \ + wine-mono \ + wine-gecko \ + winetricks \ + thunderbird \ + ktouch \ + ktorrent \ + pipewire \ + pipewire-session-manager \ + qpwgraph \ + cifs-utils \ + rbw \ + sddm + +yay -S \ + catppuccin-sddm-theme-mocha + +echo " +[General] +Numlock=on + +[Theme] +ThemeDir=/usr/share/sddm/themes # Standardverzeichnis für Designvorlagen +Current=catppuccin-mocha-blue # Standardthema +CursorTheme=breeze_cursors # Mausthema +FacesDir=/usr/share/sddm/faces # Verzeichnis für Avatarbilder + +[Users] +MaximumUID=1100 +HideUsers=mathieu +" | sudo tee /etc/sddm.conf + +sudo systemctl disable gdm +sudo systemctl enable sddm + diff --git a/.install_skripte/install_hypr_pcks.sh b/_install_skripte/install_hypr_pcks.sh similarity index 60% rename from .install_skripte/install_hypr_pcks.sh rename to _install_skripte/install_hypr_pcks.sh index 3458c28..2220c4a 100755 --- a/.install_skripte/install_hypr_pcks.sh +++ b/_install_skripte/install_hypr_pcks.sh @@ -16,9 +16,12 @@ sudo pacman -S --needed \ wl-clipboard \ swaync \ hyprshot \ - ttf-jetbrains-mono-nerd \ - ttf-font-awesome + rofi yay -S --needed \ hyprshutdown \ hyprtile + +# Install hyprltm (network manager) +curl -s https://raw.githubusercontent.com/hyprltm/hyprltm-net/main/setup.sh | bash +echo 'fish_add_path -m $HOME/.local/bin' >> ~/.config/fish/config.fish diff --git a/.install_skripte/install_kreation_pcks.sh b/_install_skripte/install_kreation_pcks.sh similarity index 100% rename from .install_skripte/install_kreation_pcks.sh rename to _install_skripte/install_kreation_pcks.sh diff --git a/.install_skripte/install_basic_pcks.sh b/_install_skripte/install_terminal_pcks.sh similarity index 71% rename from .install_skripte/install_basic_pcks.sh rename to _install_skripte/install_terminal_pcks.sh index fe90d7e..aab369f 100755 --- a/.install_skripte/install_basic_pcks.sh +++ b/_install_skripte/install_terminal_pcks.sh @@ -34,31 +34,39 @@ sudo pacman -S --needed \ fish \ vim \ nvim \ - firefox \ - nextcloud-client \ openssh \ rclone \ rsync \ unison \ stow \ - cups \ - wine \ - wine-mono \ - wine-gecko \ - winetricks \ - thunderbird \ - ktouch \ - strawberry \ - ktorrent \ + nodejs \ + npm \ + starship \ + fastfetch \ + tree-sitter-cli \ python \ python-pip \ - pipewire \ - pipewire-session-manager \ - qpwgraph \ - cifs-utils \ - rbw \ extra/ttf-jetbrains-mono-nerd \ - unzip + unzip \ + ruff \ + python-ruff \ + chromium \ + selene \ + opencode \ + tmux \ + yazi \ + zoxide \ + fzf \ + locate \ + ttf-jetbrains-mono-nerd \ + ttf-font-awesome # fish as standard terminal chsh -s /usr/bin/fish + +git clone https://github.com/jimeh/tmuxifier.git ~/.tmuxifier + +npm install -g vscode-js-debug +npm install -g eslint_d +ya pkg add yazi-rs/plugins:git +sudo updatedb diff --git a/.install_skripte/nextcloud.sh b/_install_skripte/nextcloud.sh similarity index 100% rename from .install_skripte/nextcloud.sh rename to _install_skripte/nextcloud.sh diff --git a/hypr/.config/hypr/hyprland.conf b/hypr/.config/hypr/hyprland.conf index 8eeadce..6dc440b 100755 --- a/hypr/.config/hypr/hyprland.conf +++ b/hypr/.config/hypr/hyprland.conf @@ -304,6 +304,7 @@ bind = $mainMod SHIFT, SPACE, exec, nwg-drawer bind = $mainMod, P, pseudo, # dwindle bind = $mainMod, J, togglesplit, # dwindle bind = $mainMod, I, exec, firefox & +bind = $mainMod, n, exec, ~/.local/bin/hyprltm-net # Move focus with mainMod + WASD or Vim-style bind = $mainMod, a, movefocus, l diff --git a/term/.bashrc b/term/.bashrc new file mode 100644 index 0000000..713f4ef --- /dev/null +++ b/term/.bashrc @@ -0,0 +1,15 @@ +# +# ~/.bashrc +# + +# If not running interactively, don't do anything +[[ $- != *i* ]] && return + +alias ls='ls --color=auto' +alias grep='grep --color=auto' +PS1='[\u@\h \W]\$ ' +export PATH="$HOME/.local/bin:$PATH" + +# Tmuxifier +export PATH="$HOME/.tmuxifier/bin:$PATH" +eval "$(tmuxifier init -)" diff --git a/term/.config/fish/config.fish b/term/.config/fish/config.fish index d916484..a29c635 100644 --- a/term/.config/fish/config.fish +++ b/term/.config/fish/config.fish @@ -121,3 +121,10 @@ alias zi=__zoxide_zi # ~/.config/fish/config.fish): # # zoxide init fish | source +fish_add_path -m $HOME/.local/bin + +# Tmuxifier +if test -d $HOME/.tmuxifier + fish_add_path -m $HOME/.tmuxifier/bin + tmuxifier init - | source +end diff --git a/term/.config/nvim/init.lua b/term/.config/nvim/init.lua index d232765..6b9eacf 100644 --- a/term/.config/nvim/init.lua +++ b/term/.config/nvim/init.lua @@ -92,3 +92,13 @@ vim.keymap.set("n", "", ":m .+1==", { desc = "Move line down" }) vim.keymap.set("n", "", ":m .-2==", { desc = "Move line up" }) vim.keymap.set("v", "", ":m '>+1gv=gv", { desc = "Move selection down" }) vim.keymap.set("v", "", ":m '<-2gv=gv", { desc = "Move selection up" }) + +-- Folding keymaps +vim.keymap.set("n", "za", "za", { desc = "Toggle fold under cursor" }) +vim.keymap.set("n", "zA", "zA", { desc = "Toggle fold recursively" }) +vim.keymap.set("n", "zR", "zR", { desc = "Open all folds" }) +vim.keymap.set("n", "zM", "zM", { desc = "Close all folds" }) +vim.keymap.set("n", "zo", "zo", { desc = "Open fold under cursor" }) +vim.keymap.set("n", "zc", "zc", { desc = "Close fold under cursor" }) +vim.keymap.set("n", "zO", "zO", { desc = "Open all folds under cursor" }) +vim.keymap.set("n", "zC", "zC", { desc = "Close all folds under cursor" }) diff --git a/term/.config/nvim/lua/basic-settings.lua b/term/.config/nvim/lua/basic-settings.lua index 65df423..b5ea125 100644 --- a/term/.config/nvim/lua/basic-settings.lua +++ b/term/.config/nvim/lua/basic-settings.lua @@ -10,20 +10,45 @@ - vim.go.* for global option shorthand ]] +-- ============================================================================ +-- TREESITTER (Built-in Neovim 0.10+ features) +-- ============================================================================ +-- Enable Treesitter syntax highlighting (native in Neovim 0.10+) +-- This replaces the old nvim-treesitter highlight module +vim.api.nvim_create_autocmd("FileType", { + pattern = "*", + callback = function() + if vim.bo.buftype == "" and vim.bo.filetype ~= "" then + pcall(vim.treesitter.start) + end + end, + desc = "Enable Treesitter highlighting", +}) + -- ============================================================================ -- FOLDING SETTINGS (Code folding) -- ============================================================================ --- Foldmethod determines how code blocks are detected and folded --- "expr" means folds are based on expressions (we use treesitter for this) -vim.opt.foldmethod = "expr" - --- Foldexpr is the expression used to determine fold level --- v:lua.vim.treesitter.foldexpr() uses Treesitter to calculate folds -vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()" +-- NOTE: In Neovim 0.10+, Treesitter folding must be set per-buffer via FileType autocmd +-- Setting it globally causes the foldexpr to evaluate before Treesitter attaches -- Foldlevel: Higher number = more folds are open by default --- 99 means almost all folds are open when opening a file +-- 1-2 means you'll see folds by default; 99 means all folds are open vim.opt.foldlevel = 99 +vim.opt.foldlevelstart = 99 + +-- Setup Treesitter folding for each buffer after filetype is detected +-- This ensures the parser is loaded before foldexpr evaluates +vim.api.nvim_create_autocmd("FileType", { + pattern = "*", + callback = function() + -- Only set folding for file buffers with Treesitter support + if vim.bo.buftype == "" then + vim.wo.foldmethod = "expr" + vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()" + end + end, + desc = "Setup Treesitter folding per filetype", +}) -- ============================================================================ -- LINE NUMBERS diff --git a/term/.config/nvim/lua/plugins/lsp-config.lua b/term/.config/nvim/lua/plugins/lsp-config.lua index ebfac58..d176620 100644 --- a/term/.config/nvim/lua/plugins/lsp-config.lua +++ b/term/.config/nvim/lua/plugins/lsp-config.lua @@ -75,6 +75,7 @@ return { settings = { Lua = { runtime = { version = "LuaJIT" }, + diagnostics = { globals = { "vim" } }, workspace = { library = vim.api.nvim_get_runtime_file("", true) }, }, }, diff --git a/term/.config/nvim/lua/plugins/nvim-lint.lua b/term/.config/nvim/lua/plugins/nvim-lint.lua index 1fc0f50..e2b4d66 100644 --- a/term/.config/nvim/lua/plugins/nvim-lint.lua +++ b/term/.config/nvim/lua/plugins/nvim-lint.lua @@ -8,7 +8,7 @@ return { typescriptreact = { "eslint_d" }, vue = { "eslint_d" }, python = { "ruff" }, - lua = { "selene" }, + -- lua = { "selene" }, -- Disabled: lua_ls provides diagnostics sh = { "shellcheck" }, bash = { "shellcheck" }, json = { "jsonlint" }, diff --git a/term/.config/nvim/lua/plugins/surround.lua b/term/.config/nvim/lua/plugins/surround.lua index 8c5b167..fb4f4d4 100644 --- a/term/.config/nvim/lua/plugins/surround.lua +++ b/term/.config/nvim/lua/plugins/surround.lua @@ -2,14 +2,34 @@ return { "kylechui/nvim-surround", version = "*", event = "VeryLazy", + init = function() + -- Disable default keymaps (we'll set custom ones) + vim.g.nvim_surround_no_mappings = true + end, config = function() require("nvim-surround").setup({ - keymaps = { - add = "S", -- Add surrounding - delete = "SD", -- Delete surrounding - change = "SC", -- Change surrounding - change_line = "SCL", -- Change surrounding on current line - }, + -- Configuration for surrounds, aliases, etc. can go here + }) + -- Set custom keymaps (v4 method) + -- Add surrounding: Siw" -> surround word with quotes, Siw) -> (surround word) + vim.keymap.set("n", "S", "(nvim-surround-normal)", { + desc = "Add surrounding", + }) + -- Delete surrounding: SD" -> remove quotes, SD) -> remove parentheses + vim.keymap.set("n", "SD", "(nvim-surround-delete)", { + desc = "Delete surrounding", + }) + -- Change surrounding: SC"' -> change quotes to single quotes, SC)] -> change parens to brackets + vim.keymap.set("n", "SC", "(nvim-surround-change)", { + desc = "Change surrounding", + }) + -- Change surrounding on current line + vim.keymap.set("n", "SCL", "(nvim-surround-change-line)", { + desc = "Change surrounding on current line", + }) + -- Visual mode: select text and press S" -> surround selection with quotes + vim.keymap.set("v", "S", "(nvim-surround-visual)", { + desc = "Add surrounding in visual mode", }) end, } diff --git a/term/.config/nvim/lua/plugins/treesitter.lua b/term/.config/nvim/lua/plugins/treesitter.lua index 330f4ec..11accda 100644 --- a/term/.config/nvim/lua/plugins/treesitter.lua +++ b/term/.config/nvim/lua/plugins/treesitter.lua @@ -1,36 +1,58 @@ return { "nvim-treesitter/nvim-treesitter", - branch = "master", build = ":TSUpdate", event = { "BufReadPost", "BufNewFile" }, config = function() - -- Ensure nvim-treesitter queries are preferred over runtime queries - -- This fixes the "except*" syntax error with updated parsers - vim.opt.runtimepath:prepend(vim.fn.stdpath("data") .. "/lazy/nvim-treesitter") - - local ok, configs = pcall(require, "nvim-treesitter.configs") + -- In the latest nvim-treesitter (post-refactor), the plugin only handles + -- parser installation. Highlighting, folding, and indenting are handled + -- by native Neovim Treesitter integration. + + -- CRITICAL: Add nvim-treesitter/runtime to runtimepath so queries are found + local ts_runtime = vim.fn.stdpath("data") .. "/lazy/nvim-treesitter/runtime" + vim.opt.runtimepath:prepend(ts_runtime) + + -- Setup nvim-treesitter (minimal config for parser installation) + require("nvim-treesitter").setup({ + -- Parser installation directory (default: stdpath('data')/site) + install_dir = vim.fn.stdpath("data") .. "/site", + }) + + -- Auto-install parsers for these languages when opening a file + local ensure_installed = { + "python", + "lua", + "json", + "yaml", + "javascript", + "typescript", + "tsx", + "vue", + "html", + "css", + "bash", + "markdown", + "markdown_inline", + } + + -- Install parsers + local ok, install = pcall(require, "nvim-treesitter.install") if ok then - configs.setup({ - auto_install = true, - ensure_installed = { - "python", - "lua", - "json", - "yaml", - "javascript", - "typescript", - "tsx", - "vue", - "html", - "css", - "bash", - "markdown", - "markdown_inline", - }, - highlight = { enable = true }, - indent = { enable = true }, - folding = { enable = true }, - }) + for _, lang in ipairs(ensure_installed) do + vim.schedule(function() + install.install({ lang }) + end) + end end + + -- Enable Treesitter-based indenting (natively supported by Neovim) + vim.api.nvim_create_autocmd("FileType", { + pattern = "*", + callback = function() + if vim.bo.buftype == "" and vim.bo.filetype ~= "" then + vim.bo.indentexpr = "v:lua.vim.treesitter.indentexpr()" + end + end, + desc = "Enable Treesitter indenting", + }) end, } diff --git a/term/.config/tmux/README.md b/term/.config/tmux/README.md new file mode 100644 index 0000000..6536393 --- /dev/null +++ b/term/.config/tmux/README.md @@ -0,0 +1,353 @@ +# Tmuxifier Session Templates + +This directory contains reusable tmux session and window layouts managed by [tmuxifier](https://github.com/jimeh/tmuxifier). + +## Installation + +### 1. Install tmuxifier + +```bash +git clone https://github.com/jimeh/tmuxifier.git ~/.tmuxifier +``` + +### 2. Add to tmux (via TPM) + +The `tmux.conf` in this directory already includes the tmuxifier plugin. After starting tmux, press `prefix + I` to install it via TPM. + +### 3. Add to your shell + +The fish config (`~/.config/fish/config.fish`) in this repo already includes tmuxifier initialization. Restart fish or run: + +```fish +source ~/.config/fish/config.fish +``` + +### 4. Verify installation + +```fish +which tmuxifier +# Should output: ~/.tmuxifier/bin/tmuxifier + +tmuxifier help +# Should show tmuxifier commands +``` + +## Quick Start + +After installing tmuxifier, create and load sessions: + +```bash +# Create a new session layout +tmuxifier new-session my-project + +# Load a session +tmuxifier load-session my-project # or: t s my-project + +# Edit an existing session +tmuxifier edit-session my-project # or: t es my-project + +# Create a window layout (for use within existing sessions) +tmuxifier new-window my-window +tmuxifier load-window my-window # or: t lw my-window +``` + +## Directory Structure + +``` +tmuxifier/ +├── layouts/ +│ ├── *.session.sh # Full session definitions +│ └── *.window.sh # Window-only definitions +``` + +## Session Template Reference + +### Basic Structure + +```bash +# Set a custom session root path (must be called before initialize_session) +session_root "~/projects/my-project" + +# Create session with specified name if it does not already exist +if initialize_session "my-project"; then + + # Create windows + new_window "editor" + new_window "server" + new_window "logs" + + # Select the default active window + select_window "editor" + + # Run commands in the selected window + run_cmd "cd ~/projects/my-project" + + # Send keys (like typing) to the pane + send_keys "nvim ." C-m + + # Finalize session creation and switch/attach to it + finalize_and_go_to_session +fi +``` + +### Commands Reference + +#### Session Commands + +| Command | Description | +|---------|-------------| +| `session_root "path"` | Set root directory for session (must be first) | +| `initialize_session "name"` | Create session if it doesn't exist | +| `finalize_and_go_to_session` | Complete creation and attach to session | +| `select_window "name"` | Set active window | + +#### Window Commands + +| Command | Description | +|---------|-------------| +| `new_window "name"` | Create a new window | +| `select_window "name"` | Switch to existing window | +| `run_cmd "command"` | Execute command in current pane | +| `send_keys "keys"` | Send key sequence to pane | +| `send_text "text"` | Send raw text to pane | +| `split_h [percent]` | Horizontal split (default 50%) | +| `split_v [percent]` | Vertical split (default 50%) | +| `select_pane [target]` | Select pane (up, down, left, right, left-or-up, right-or-down) | + +#### Pane Target Options + +For `select_pane`: +- `up`, `down`, `left`, `right` - Navigate to adjacent pane +- `left-or-up`, `right-or-down` - Prefer first direction, fall back to second + +### Key Modifiers + +| Symbol | Meaning | +|--------|---------| +| `C-m` | Enter/Return key | +| `C-c` | Ctrl+C | +| `C-d` | Ctrl+D (EOF) | +| `M-m` | Alt/Meta+m | +| `C-\\` | Ctrl+\\ | + +## Example Templates + +Understanding the pane system is key. Here's a visual breakdown: + +``` +┌─────────────────────────────────────────────────────┐ +│ Window: "editor" │ +│ ┌─────────────────────┬───────────────────────────┐ │ +│ │ Pane 1 (40%) │ Pane 2 (60%) │ │ +│ │ nvim │ npm run dev │ │ +│ │ ├───────────────────────────┤ │ +│ │ │ Pane 3 (50% of pane 2) │ │ +│ │ │ npm run test │ │ +│ └─────────────────────┴───────────────────────────┘ │ +└─────────────────────────────────────────────────────┘ +``` + +### Example 1: Two Panes Side by Side + +```bash +session_root "~/projects/app" + +if initialize_session "app"; then + new_window "editor" + + # Split horizontally (40% left, 60% right) + split_h 40 + + # Run command in first pane (left side) + run_cmd "cd ~/projects/app && nvim" + + # Move to second pane (right side) and split vertically + select_pane right + split_v 50 + + # Run commands in the new panes + run_cmd "npm run dev" + select_pane right + run_cmd "npm run test" + + select_window "editor" + finalize_and_go_to_session +fi +``` + +### Example 2: Three Panes with Nested Split + +```bash +session_root "~/projects/app" + +if initialize_session "app"; then + new_window "editor" + + # Create three panes: top (20%), bottom-left (40%), bottom-right (40%) + split_v 20 # horizontal split at 20% + run_cmd "htop" # top pane: system monitor + + select_pane down # move to bottom + split_h 50 # vertical split bottom into left/right + run_cmd "npm run dev" # bottom-left + select_pane right + run_cmd "npm run test" # bottom-right + + select_window "editor" + finalize_and_go_to_session +fi +``` + +``` +Resulting layout: +┌─────────────────────────────────────┐ +│ htop (20%) │ +├──────────────┬──────────────────────┤ +│ npm run dev │ npm run test │ +│ (40%) │ (40%) │ +└──────────────┴──────────────────────┘ +``` + +### Example 3: Multiple Windows with Panes + +```bash +session_root "~/projects/webapp" + +if initialize_session "webapp"; then + # Window 1: Main workspace with panes + new_window "editor" + split_h 50 + run_cmd "cd ~/projects/webapp && nvim" + select_pane right + run_cmd "cd ~/projects/webapp && npm run dev" + + # Window 2: Server with logs + new_window "server" + split_v 30 + run_cmd "cd ~/projects/webapp && python -m http.server 8000" + select_pane right + run_cmd "cd ~/projects/webapp && tail -f logs/app.log" + + # Window 3: Database + new_window "database" + run_cmd "docker compose up db" + + # Start on editor window + select_window "editor" + finalize_and_go_to_session +fi +``` + +### Example 4: Practical Development Setup + +```bash +session_root "~/projects/api" + +if initialize_session "api"; then + new_window "code" + split_h 60 + run_cmd "cd ~/projects/api && nvim" + select_pane right + split_v 50 + run_cmd "cd ~/projects/api && uvicorn main:app --reload" + select_pane right + run_cmd "cd ~/projects/api && tail -f logs/api.log" + + new_window "tests" + split_h 50 + run_cmd "cd ~/projects/api && pytest -v" + select_pane right + run_cmd "cd ~/projects/api && pytest --cov" + + new_window "shell" + run_cmd "cd ~/projects/api" + + select_window "code" + finalize_and_go_to_session +fi +``` + +### Example 5: Simple Window Layout (No Panes) + +```bash +session_root "~/projects/webapp" + +if initialize_session "webapp"; then + # Each window has a single pane + new_window "editor" + run_cmd "cd ~/projects/webapp && nvim" + + new_window "server" + run_cmd "cd ~/projects/webapp && npm run dev" + + new_window "database" + run_cmd "docker compose up db" + + new_window "logs" + run_cmd "cd ~/projects/webapp && tail -f logs/app.log" + + select_window "editor" + finalize_and_go_to_session +fi +``` + +## Shell Integration + +### Aliases + +Add these to your shell config for convenience: + +```bash +# Bash/Zsh (.bashrc or .zshrc) +alias t='tmuxifier' +alias ts='tmuxifier load-session' +alias tes='tmuxifier edit-session' +alias tns='tmuxifier new-session' +alias tlw='tmuxifier load-window' + +# Fish (.config/fish/config.fish or conf.d/) +alias t 'tmuxifier' +alias ts 'tmuxifier load-session' +alias tes 'tmuxifier edit-session' +``` + +### Usage Without Tmux Prefix + +If you want to load sessions from outside tmux (in a regular terminal): + +```bash +# Run this in a plain terminal, NOT inside tmux +tmuxifier load-session my-project +``` + +## Tips + +1. **Exit before loading**: Make sure you're not inside tmux when running `load-session` +2. **Auto-starting services**: Use `run_cmd` with background processes (`&`) for long-running services +3. **Docker containers**: Commands like `docker compose up -d` work well in dedicated windows +4. **Custom layouts path**: Set `TMUXIFIER_LAYOUT_PATH` to use a different directory + +```bash +export TMUXIFIER_LAYOUT_PATH="$HOME/.config/tmux/layouts" +``` + +## Troubleshooting + +**"unknown command" when running tmuxifier?** +- tmuxifier is not installed. Run: `git clone https://github.com/jimeh/tmuxifier.git ~/.tmuxifier` +- Restart your shell: `source ~/.config/fish/config.fish` +- Verify: `which tmuxifier` + +**Session won't load?** +- Make sure you're NOT inside tmux when running `load-session` +- Make sure tmuxifier is initialized in your shell config +- Check that you have tmux installed: `tmux -V` +- Verify the layout file exists: `ls ~/.tmuxifier/layouts/` + +**TPM plugin not working?** +- Inside tmux, press `prefix + I` (capital I) to install plugins +- `prefix` is `Ctrl+Space` by default in this config + +**Commands not running?** +- Use `run_cmd` for single commands, not `send_keys` +- For interactive commands, consider using `send_keys` instead diff --git a/term/.config/tmux/layouts/demo.session.sh b/term/.config/tmux/layouts/demo.session.sh new file mode 100644 index 0000000..3e959ba --- /dev/null +++ b/term/.config/tmux/layouts/demo.session.sh @@ -0,0 +1,23 @@ +# Example session: demo +# Usage: tmuxifier load-session demo +# Edit: tmuxifier edit-session demo + +session_root "$HOME" + +if initialize_session "demo"; then + new_window "editor" + new_window "server" + new_window "shell" + + select_window "editor" + run_cmd "cd ~ && nvim ." + + select_window "server" + run_cmd "echo 'Server ready'" + + select_window "shell" + run_cmd "echo 'Shell ready'" + + select_window "editor" + finalize_and_go_to_session +fi diff --git a/term/.config/tmux/tmux.conf b/term/.config/tmux/tmux.conf index 78e19dc..ce4c845 100644 --- a/term/.config/tmux/tmux.conf +++ b/term/.config/tmux/tmux.conf @@ -1,6 +1,5 @@ # ── General ─────────────────────────────────────────────────────────────────── - set -g default-terminal "tmux-256color" set -ag terminal-overrides ",xterm-256color:RGB" @@ -31,7 +30,7 @@ bind k select-pane -U bind l select-pane -R -# ── Plugins ─────────────────────────────────────────────────────────────────── +# ── Plugins ──────────────────────────────────────────────────────────────────── # Auto-bootstrap TPM if not installed if "test ! -d ~/.config/tmux/plugins/tpm" \ @@ -39,12 +38,17 @@ if "test ! -d ~/.config/tmux/plugins/tpm" \ set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'sindrip/tmux-nvim-navigator' +set -g @plugin 'jimeh/tmuxifier' # Catppuccin theme set -g @plugin 'catppuccin/tmux' set -g @catppuccin_flavor "mocha" set -g @catppuccin_window_status_style "rounded" +# Tmuxifier environment +set-environment -g TMUXIFIER_LAYOUT_PATH "$HOME/.tmuxifier/layouts" + # ── Initialize TPM (must be last line before status bar) ──────────────────────