Skip to content

Commit

Permalink
docs(readme): add jumplist and workspace sections
Browse files Browse the repository at this point in the history
  • Loading branch information
EdenEast committed Sep 20, 2023
1 parent c219353 commit f4cb403
Show file tree
Hide file tree
Showing 6 changed files with 140 additions and 7 deletions.
55 changes: 55 additions & 0 deletions doc/jumplist.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
= Jumplist

:harpoon: https://github.com/ThePrimeagen/harpoon#-harpooning

Tuxmux includes a feature known as the "*Jump List,*" which is designed to streamline the process of navigating and
attaching to different sessions quickly. This concept is inspired by the "harpooning" concept introduced in
link:{harpoon}[ThePrimeagen/harpoon]. The Jump List serves as a powerful tool to facilitate seamless interaction with
multiple sessions.

== What is Harpooning?

Harpooning is a concept from ThePrimeagen's GitHub project, which involves quickly and efficiently attaching to
different sessions or targets within a terminal environment. It's a technique often used by developers and power users
who work with multiple terminal sessions simultaneously.

== Using the Jump List

The primary use case for the Jump List is to enable quick access and attachment to specific sessions through
keybindings. Here's how it works:

Populating the Jump List::
Before you can use the Jump List, you need to populate it with the sessions you want to interact with. This can
typically be done by defining a set of sessions or targets within your application's configuration.

[source,bash]
.shell
----
# Appends the path argument to the jumplist
tm jump --path ~/.config/nvim
# Append the current path to the jumplist
tm jump --path .
# Open the jumplist in your $EDITOR
tm jump --edit
----

Navigating with Keybindings::
Once the Jump List is populated, you can use keybindings or keyboard shortcuts to navigate to a specific index within
the list. Each index typically corresponds to a session or target. This allows you to jump to a desired session with a
single key combination.

[source,bash]
.~/.config/tmux.conf
----
# Bind homerow keys to tuxmux jumplist indices
bind-key -r J run-shell "tm jump --index 1"
bind-key -r K run-shell "tm jump --index 2"
bind-key -r L run-shell "tm jump --index 3"
bind-key -r '"' run-shell "tm jump --index 4"
----

Seamless Session Attachment::
When you activate a specific index in the Jump List, the application will swiftly attach you to the corresponding
session, streamlining the process of interacting with multiple sessions efficiently.
2 changes: 2 additions & 0 deletions doc/man.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ tm - Tmux session manager
TODO: add Description here
---

include::jumplist.adoc[leveloffset=1]
include::worktree.adoc[leveloffset=1]
include::configuration.adoc[leveloffset=1]

== Examples
Expand Down
6 changes: 2 additions & 4 deletions doc/readme.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ image:https://user-images.githubusercontent.com/2746374/266213849-a7c59c69-4f12-
- Support git worktrees on session creation

include::installation.adoc[leveloffset=1]

// TODO: add section explaining jumping and how do add tmux, and bash key bindings
// TODO: add section on git worktree support

include::jumplist.adoc[leveloffset=1]
include::worktree.adoc[leveloffset=1]
include::configuration.adoc[leveloffset=1]

== Development
Expand Down
9 changes: 9 additions & 0 deletions doc/worktree.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
= Git Worktree

This application offers support for Git worktrees, allowing you to manage multiple worktrees within a Git repository
more efficiently. When creating a Tmux session using this application, you'll have the flexibility to choose which
worktree to attach to if the repository contains multiple worktrees.

When you create a Tmux session with this application, you may encounter situations where the Git repository contains
multiple worktrees. To provide you with a seamless experience, the application will prompt you to choose which worktree
you'd like to attach to within the Tmux session.
3 changes: 2 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
meta = with pkgs.lib; {
description = "Tmux utility for session and window management";
homepage = "https://github.com/EdenEast/tuxmux";
license = with licenses; [ mit ];
license = licenses.apsl20;
mainProgram = "tm";
};
});
Expand Down Expand Up @@ -117,6 +117,7 @@
];
packages = with pkgs; [
asciidoctor-with-extensions
jq
just
pandoc
];
Expand Down
72 changes: 70 additions & 2 deletions readme.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,78 @@ cargo install --path .
----

:leveloffset!:
:leveloffset: 1

= Jumplist

:harpoon: https://github.com/ThePrimeagen/harpoon#-harpooning

Tuxmux includes a feature known as the "*Jump List,*" which is designed to streamline the process of navigating and
attaching to different sessions quickly. This concept is inspired by the "harpooning" concept introduced in
link:{harpoon}[ThePrimeagen/harpoon]. The Jump List serves as a powerful tool to facilitate seamless interaction with
multiple sessions.

== What is Harpooning?

Harpooning is a concept from ThePrimeagen's GitHub project, which involves quickly and efficiently attaching to
different sessions or targets within a terminal environment. It's a technique often used by developers and power users
who work with multiple terminal sessions simultaneously.

== Using the Jump List

// TODO: add section explaining jumping and how do add tmux, and bash key bindings
// TODO: add section on git worktree support
The primary use case for the Jump List is to enable quick access and attachment to specific sessions through
keybindings. Here's how it works:

Populating the Jump List::
Before you can use the Jump List, you need to populate it with the sessions you want to interact with. This can
typically be done by defining a set of sessions or targets within your application's configuration.

[source,bash]
.shell
----
# Appends the path argument to the jumplist
tm jump --path ~/.config/nvim
# Append the current path to the jumplist
tm jump --path .
# Open the jumplist in your $EDITOR
tm jump --edit
----

Navigating with Keybindings::
Once the Jump List is populated, you can use keybindings or keyboard shortcuts to navigate to a specific index within
the list. Each index typically corresponds to a session or target. This allows you to jump to a desired session with a
single key combination.

[source,bash]
.~/.config/tmux.conf
----
# Bind homerow keys to tuxmux jumplist indices
bind-key -r J run-shell "tm jump --index 1"
bind-key -r K run-shell "tm jump --index 2"
bind-key -r L run-shell "tm jump --index 3"
bind-key -r '"' run-shell "tm jump --index 4"
----

Seamless Session Attachment::
When you activate a specific index in the Jump List, the application will swiftly attach you to the corresponding
session, streamlining the process of interacting with multiple sessions efficiently.

:leveloffset!:
:leveloffset: 1

= Git Worktree

This application offers support for Git worktrees, allowing you to manage multiple worktrees within a Git repository
more efficiently. When creating a Tmux session using this application, you'll have the flexibility to choose which
worktree to attach to if the repository contains multiple worktrees.

When you create a Tmux session with this application, you may encounter situations where the Git repository contains
multiple worktrees. To provide you with a seamless experience, the application will prompt you to choose which worktree
you'd like to attach to within the Tmux session.

:leveloffset!:
:leveloffset: 1

= Configuration
Expand Down

0 comments on commit f4cb403

Please sign in to comment.