From bfce9e3e49e697bf3def5e313aab27ef698a3c33 Mon Sep 17 00:00:00 2001 From: Terminator X Date: Sat, 23 Oct 2021 03:35:51 +0530 Subject: [PATCH] Updated Basic use cases (markdown) --- Basic-use-cases.md | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/Basic-use-cases.md b/Basic-use-cases.md index 2d9284e..c243f9e 100644 --- a/Basic-use-cases.md +++ b/Basic-use-cases.md @@ -192,39 +192,9 @@ Another options is to combine and use `nnn` with a multiplexer like `dvtm`: There are several ways to run commands from `nnn`: 1. Launch a shell within the current directory. This is your regular shell. -2. Use the prompt key to show the [native command prompt](https://github.com/jarun/nnn/wiki/Concepts#prompts) and enter your command. The commands are invoked using the `$SHELL` so you can use commands, aliases (in `~/.zshenv` for zsh), environment variables, pipes, redirections. +2. Use the prompt key to show the [native command prompt](https://github.com/jarun/nnn/wiki/Concepts#native-command-prompt) and enter your command. The commands are invoked using the `$SHELL` so you can use commands, aliases (in `~/.zshenv` for zsh), environment variables, pipes, redirections. 3. You can also assign keys to arbitrary non-background cli commands (non-shell-interpreted) you use frequently and invoke like plugins. ([instructions](https://github.com/jarun/nnn/tree/master/plugins#running-commands-as-plugin)). -#### Copy command from spawned shell to prompt - -The prompt (non-readline `nnn`-internal one) can remember the last executed command. Sometimes it may be desirable copy a command from shell history to the prompt. Keybinds can be configured to copy a command from bash/zsh prompt to the system clipboard. You can use these at the subshell prompt and paste the command at the prompt with Ctrl-Shift-V. - -```bash -# bash: add in ~/.bashrc -# copy current line to clipboard with ^] - -if [[ -n $DISPLAY ]]; then - copy_line_to_x_clipboard () { - printf %s "$READLINE_LINE" | xsel -ib - } - bind -x '"\C-]": copy_line_to_x_clipboard' -fi -``` - -```zsh -# zsh: add in ~/.zshrc -# copy current line to clipboard with ^U - -if [[ -n $DISPLAY ]]; then - x-kill-whole-line () { - zle kill-whole-line - print -rn -- "$CUTBUFFER" | xsel -ib - } - zle -N x-kill-whole-line - bindkey '\C-u' x-kill-whole-line -fi -``` - #### Shell depth indicator If you use `!` to spawn a shell in the current directory and your shell is bash or zsh, it could be nice to add: