{"id":15696959,"url":"https://github.com/luan/tmuxfiles","last_synced_at":"2025-05-08T22:25:31.137Z","repository":{"id":25795793,"uuid":"104009704","full_name":"luan/tmuxfiles","owner":"luan","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-11T16:17:25.000Z","size":31,"stargazers_count":10,"open_issues_count":1,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-20T09:39:06.290Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-19T01:19:06.000Z","updated_at":"2024-11-11T16:17:30.000Z","dependencies_parsed_at":"2023-02-15T03:47:00.776Z","dependency_job_id":null,"html_url":"https://github.com/luan/tmuxfiles","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luan%2Ftmuxfiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luan%2Ftmuxfiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luan%2Ftmuxfiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luan%2Ftmuxfiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luan","download_url":"https://codeload.github.com/luan/tmuxfiles/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253156502,"owners_count":21862932,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T19:10:32.967Z","updated_at":"2025-05-08T22:25:31.111Z","avatar_url":"https://github.com/luan.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Luan's Tmux Config\n\nThis config aims to make tmux comfortable for vim users. Below are\nsome highlights and possible workflows.\n\n**Notation**: We'll use `C-spc` to mean \"hold control, and tap the spacebar\".\n\n## Commands that work \"normally\"\n\nMost of the time in tmux, you're in normal mode. When you type things, they go\ninto your shell, and your shell can run them. You can also run the following\ncommands.\n\n### Managing \"windows\"\n- `C-spc c` -- create a new window\n- `C-spc 1` -- switch to window 1\n- ...\n- `C-spc 9` -- switch to window 9\n- `C-spc C-spc` -- switch to most recent other window\n- `C-spc ,` -- rename this window\n- To close a window, close all the panes in it. Windows start with one pane. See below.\n\n### Managing \"panes\"\n- `C-spc |` -- split window vertically (creates a new \"pane\")\n- `C-spc -` -- split window vertically (creates a new \"pane\")\n- `C-spc h` -- switch keyboard focus to the pane to the left\n- `C-spc j` -- switch keyboard focus to the pane below\n- `C-spc k` -- switch keyboard focus to the pane above\n- `C-spc l` -- switch keyboard focus to the pane to the right\n- `C-spc z` -- Zoom!\n  + If you can see multiple panes, this will \"zoom in\" on the current pane.\n  + If you're already \"zoomed in\", this will zoom out, so you can see multiple\n    panes again.\n- Panes are just regular subshells running your usual shell. If you're running `bash` you can close them with `exit` or `C-d`.\n\n### Clipboard\n- `C-spc [` -- enter movement mode\n- `C-spc ]` -- paste text that you previously copied in movement mode\n\n## Commands that work in movement mode\n\nMovement mode is like being in vim. You can move around using vim movement keys.\nYou can highlight things. You can copy things to a clipboard, for pasting later\n(in normal mode).\n\n### Moving around\n- `h` -- go left\n- `j` -- go down\n- `k` -- go up\n- `l` -- go right\n- `0` -- go to the beginning of the line\n- `$` -- go to the end of the line\n- `w` -- go foreword by one Word\n- `b` -- go Backward by one word\n- `fx` -- go Foreword until you hit the next `x` character. Also works for any\n          other character instead of `x`.\n- `Fx` -- go backward until you hit the next `x` character. Also works for any\n          other character instead of `x`.\n- `tx` -- go foreword unTil just before you hit the next `x` character. Also\n          works for any other character instead of `x`.\n- `Tx` -- go backward unTil just before you hit the next `x` character. Also\n          works for any other character instead of `x`.\n\n### Searching\n- `/` -- search forwards\n- `?` -- search backwards\n- `n` -- jump to the next thing that matches your last search (in whatever\n         direction you were already searching)\n- `N` -- jump to the previous thing that matches your last search (in whatever\n         direction you were already searching)\n\n### Clipboard\n- `v` -- start highlighting character-by-character (you can continue to highlight by moving around)\n- `V` -- start highlighting line-by-line (you can continue to highlight by moving around)\n- `y` -- copy whatever is highlighted to the clipboard (so you can paste later\n         in normal mode). This also puts you immediately back into normal mode.\n\n### Stopping\n- `ESC` stop highlighting or searching\n- `q` stop being in movement mode -- go back to normal mode.\n\n## Common workflows\n\n### The copy-paste flow\n\nI'm in tmux, and I have a single terminal in a single pane in a single window.\n\nI have a list of handy commands in a file called `handy-bash-commands.txt`. I\nwant to use one of them. I'm going to cat the file, copy the appropriate command\nto clipboard, paste it into my shell, and see the results of my cool command.\nLet's break that into steps:\n\nFirst I cat the file:\n\n```\n$ cat handy-bash-commands.txt\n\nhandy-command 1\nhandy-command 2\nsuper cool command\nsudo super cool command\nanother command\nmore stuff\n\n$\n```\n\nNow my cursor is at the shell prompt as I would expect. I hit `C-spc [` to get\ninto movement mode, then hit `kkkk0` to move my cursor to the beginning of the\nline that reads `sudo super cool command`. To highlight the whole line, I hit\n`V`. To copy it to clipboard, I hit `y`. This also kicks me back into normal\nmode, with my cursor at the shell prompt again. To paste and run the command, I\nhit `C-spc ]`. Note that the reason the command runs as soon as I paste is is\nbecause I copied a newline to clipboard when I highlighted and copied the whole\nline earlier.\n\nHere's the result:\n\n\n```\n$ cat handy-bash-commands.txt\n\nhandy-command 1\nhandy-command 2\nsuper cool command\nsudo super cool command\nanother command\nmore stuff\n\n$ sudo super cool command\n\nSUPER COOL OUTPUT!\n\n$\n```\n\nNow I want to run something similar to `handy-command 2`, but with a slight\ndifference.\n\nMy cursor is at the shell prompt as I would expect. I hit `C-spc [` to get\ninto movement mode, then hit `?handy\u003cENTER\u003e` to move my cursor to the beginning of the\nline that reads `handy-command 2`. I'm only interested in the beginning of this\ncommand, so I hit `v` to start highlighting character-by-character. I hit `ww`\nto highlight the words `handy-command`. I hit `y` to copy those words to the\nclipboard. This also kicks me back into normal mode, with my cursor at the shell\nprompt again. To paste the command, I hit `C-spc ]`. Because I didn't copy any\nnewlines, the command doesn't run immediately, and I can edit it.\n\nHere's what my terminal looks like now:\n\n```\n$ cat handy-bash-commands.txt\n\nhandy-command 1\nhandy-command 2\nsuper cool command\nsudo super cool command\nanother command\nmore stuff\n\n$ sudo super cool command\n\nSUPER COOL OUTPUT!\n\n$ handy-command \n```\n\nNow I'm free to complete the command as I wish, and run it as normal:\n\n```\n$ cat handy-bash-commands.txt\n\nhandy-command 1\nhandy-command 2\nsuper cool command\nsudo super cool command\nanother command\nmore stuff\n\n$ sudo super cool command\n\nSUPER COOL OUTPUT!\n\n$ handy-command 65537\n\nWow, that's a really cool number. Are you a big fan of regular polygons?\n\n$\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluan%2Ftmuxfiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluan%2Ftmuxfiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluan%2Ftmuxfiles/lists"}