diff --git a/Basic-use-cases.md b/Basic-use-cases.md index 726efdf..2d9284e 100644 --- a/Basic-use-cases.md +++ b/Basic-use-cases.md @@ -192,7 +192,7 @@ 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 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. +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. 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 @@ -225,28 +225,6 @@ if [[ -n $DISPLAY ]]; then fi ``` -#### Executing a command for each file in selection - -While in the prompt you are able to execute a command with each item from the selection as its arguments. Etiher one by one or all at once. - -To execute a command on a per file basis place `%j` where the file path should be placed. The following example searches for a string in each file. - -```sh -printf "Searching for string in %s\n" "%j"; grep "string" "%j" -``` - -To execute a command with the entire selection as arguments place `%J` where the file paths should be placed. The following example updates a tar archive with the entire selection. - -```sh -tar uvf archive.tar %J -``` - -There are some limitations when using `%j` and `%J`: -* You can use multiple `%j` inside a single command. -* You can only use one `%J` inside a single command. If multiple `%J` are used only the last one will be replaced with the selection. -* You can only use either `%j` or `%J` inside a single command. If both are encountered the prompt will close. No command will be executed. -* When using `%J` `nnn` won't quote the file paths from selection. Quoting `%J` will just place quotes around the entire selection, it won't quote each item individually. - #### 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: