From 8a2e1006b3b272126332aa064f3ad95387129544 Mon Sep 17 00:00:00 2001 From: Biswakalyan Bhuyan Date: Thu, 13 Feb 2025 14:13:49 +0530 Subject: new dot files --- .config/zsh/oh-my-zsh/plugins/dirhistory/README.md | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .config/zsh/oh-my-zsh/plugins/dirhistory/README.md (limited to '.config/zsh/oh-my-zsh/plugins/dirhistory/README.md') diff --git a/.config/zsh/oh-my-zsh/plugins/dirhistory/README.md b/.config/zsh/oh-my-zsh/plugins/dirhistory/README.md new file mode 100644 index 0000000..ede9b54 --- /dev/null +++ b/.config/zsh/oh-my-zsh/plugins/dirhistory/README.md @@ -0,0 +1,62 @@ +# Dirhistory plugin + +This plugin adds keyboard shortcuts for navigating directory history and hierarchy. + +To use it, add `dirhistory` to the plugins array in your zshrc file: + +```zsh +plugins=(... dirhistory) +``` + +## Keyboard Shortcuts + +| Shortcut | Description | +|-----------------------------------|-----------------------------------------------------------| +| Alt + Left | Go to previous directory | +| Alt + Right | Go to next directory | +| Alt + Up | Move into the parent directory | +| Alt + Down | Move into the first child directory by alphabetical order | + +**For macOS: use the Option key () instead of Alt**. + +> NOTE: some terminals might override the Alt + Arrows key bindings (e.g. Windows Terminal). +> If these don't work check your terminal settings and change them to a different keyboard shortcut. + +## Usage + +This plugin allows you to navigate the history of previous working directories using Alt + Left +and Alt + Right. Alt + Left moves to past directories, and +Alt + Right goes back to recent directories. + +**NOTE: the maximum directory history size is 30.** + +You can also navigate **directory hierarchies** using Alt + Up and Alt + Down. +Alt + Up moves to the parent directory, while Alt + Down moves into the first +child directory found in alphabetical order (useful to navigate long empty directories, e.g. Java packages). + +For example, if the shell was started, and the following commands were entered: + +```shell +cd ~ +cd /usr +cd share +cd doc +``` + +the directory stack (`dirs -v`) would look like this: + +```console +$ dirs -v +0 /usr/share/doc +1 /usr/share +2 /usr +3 ~ +``` + +then entering Alt + Left at the prompt would change directory from `/usr/share/doc` to `/usr/share`, +then if pressed again to `/usr`, then `~`. If Alt + Right were pressed the directory would be changed +to `/usr` again. + +After that, Alt + Down will probably go to `/usr/bin` if `bin` is the first directory in alphabetical +order (depends on your `/usr` folder structure). Alt + Up will return to `/usr`, and once more will get +you to the root folder (`/`). -- cgit v1.2.3-59-g8ed1b