1
vote
2answers
18 views

Livesearch with first 10 matches as preview for zsh-history?

I have seen a history-livesearch with a preview, that shows the 10 first matches in the history in a list below the BUFFER-line, which is updated on every keystroke, and acts like the standard ctrl+r ...
3
votes
2answers
49 views

Show older or newer history items with the history command in zsh

I typed in the history command and it showed me the last 10 commands executed by me. Now I wanted to see the last 20 commands executed by me so (after reading the documentation): An argument of n ...
2
votes
1answer
33 views

Persistent directory stacks across sessions in zsh

I would like to share my directory stack (the one accessed with dirs) across sessions and tmux panes/windows. In the zshbuiltins man page I have found autopushd to add every directory I switch into ...
1
vote
1answer
38 views

Unable to make .zhistory a symbolic link

Every time I try to make my Zsh history file (.zhistory file) a symbolic link to a file (previously existing .zhistory file) that lives in another folder, Zsh deletes the symbolic link and makes it a ...
2
votes
1answer
955 views

Command history in Zsh

How does Zsh keep track of command history? I see two files in my home directory: .zhistory and .zsh_history. What is the difference between them? Does Zsh keep appending lines to one of them ...
3
votes
3answers
166 views

How can I search history with what is already entered at the prompt in zsh?

In zsh, I know that I can search history with Ctrl+r. However, oftentimes I start to type a command directly at the prompt, but then realize I should be searching history. When I hit Ctrl+r, it brings ...
10
votes
4answers
669 views

Search for a previous command with the same prefix when I press Up at a shell prompt

Coming from a FreeBSD world I wish to make the Linux terminal behave like FreeBSD one, especially the 9.1 version, basically when you type cd in the terminal and push the "up" arrow you can browse all ...
3
votes
3answers
143 views

Persistent shell arguments

I often find myself running a series of commands on a single set of arguments. For example: $ nmap -Pn -sS 192.168.1.5 $ ssh 192.168.1.5 $ curl 192.168.1.5 $ wget -r 192.168.1.5 This can be sped ...
1
vote
0answers
102 views

Zsh: quickly bookmark commands

I just had an idea, I'm sure it must exist though I could not find anything on the web. This topic gets close to my idea but not enough: How to quickly store and access often used commands? I'd like ...
4
votes
1answer
232 views

Per-directory history in zsh

I am happily using zsh since a while now, and I am quite satisfied with my history settings, which are: # Write to history immediately setopt inc_append_history # History shared among terminals ...
4
votes
3answers
134 views

Can any shell do argument-level interactive search?

Sometimes I need to reuse certain long arguments like paths. If I use history search (CTRL+R), I may find some command that contains the path, but I still need to delete anything else in the old ...
10
votes
2answers
1k views

How can I run a command in zsh without pushing it onto the current session's history?

Both bash and zsh support a shorthand of not placing a command in history if you prepend it with a space. This works great across sessions (if you've setopt histignorespace). However, the command is ...
13
votes
1answer
4k views

How do I perform a reverse history search in ZSH's vi-mode?

I use vim for essentially all my editing needs, so I decided to once again try vi-mode for my shell (currently ZSH w/ oh-my-zsh on OS X), but I find myself trying (and failing) to use Ctrl-R ...
3
votes
1answer
205 views

zsh !! and !$ auto execute as it does in bash

I recently made the switch from bash to zsh. I discovered two minuscule issues and differences between zsh and bash. I was slightly disappointed when my favorite two shortcuts !! & !$ don't behave ...
4
votes
3answers
329 views

Converting a history to a script?

Often times I've typed in a bunch of commands when I realize that I am going to keep typing them in and that I would really like a script. Now I understand that no matter how I save my history, I am ...
9
votes
1answer
2k views

How to enable reverse search in zsh?

I recently switched to zsh (finally) and am loving it! So far one thing that I am missing is Ctrl+R to do incremental history search. I have the history set up properly HISTSIZE=10000 SAVEHIST=10000 ...
1
vote
2answers
188 views

Auto correct path when running a command from history?

I perform a recursive search to find a command I executed few days back and I want to run it. However that command should run from the path from where I ran it previously from and not where I ...
4
votes
2answers
84 views

If ^a^b replaces “a” once in the last command, what do I use to replace all occurrences of “a”?

In bash, if I run this command: echo aaaaaaa I get aaaaaaa (duh) But then if I type in ^a^b I end up with baaaaaa What would I type to end up with bbbbbbb ?
2
votes
1answer
118 views

History-search in zsh working only for commands?

Say I have the following entries in my command history: less documents/doc1.txt less documents/doc2.txt less files/file1.txt less files/file2.txt ls pwd and that I have the following keyboard ...
7
votes
2answers
826 views

sharing or synchronizing history between Zsh and Bash

I often find myself switching between Bash and Zsh, and using the history search functionality to recover a command. However, since Bash and Zsh have different history files, I often find that the ...
7
votes
3answers
2k views

ZSH: search history on up and down keys?

Currently, I have the following in my .zshrc: bindkey '^[[A' up-line-or-search bindkey '^[[B' down-line-or-search However, this only seems to match the content of my current input before a space ...
2
votes
1answer
273 views

zsh history - full path

Suppose I do the following in zsh cd ~ cd dir1 cd dir2 cd dir3 evince foo.pdf zsh writes exactly the same in its history file. Now my question is whether it is possible to have cd ~ cd ~/dir1 cd ...
6
votes
1answer
320 views

Can I have my shell history record how wildcards expanded?

If I run: $ ls * foo bar buzz $ history | tail -1 ls * You can see that in my shell history it remembers that I ran ls * rather than ls foo bar buzz. Ideally, I'd like to record both in separate ...
35
votes
4answers
4k views

Is there any way to keep a command from being added to your history?

Is there any way to keep a command from being added to your history? I have a command that I want to keep out of my history file, and I really don't care to have it there when I search the history ...
1
vote
2answers
982 views

Extending history search in zsh

How to extend Ctrl+R search in zsh? It cannot find entry despite it is in history file. Edit: My .zsh: setopt AUTO_CD setopt CORRECT_ALL setopt EXTENDED_GLOB # History SAVEHIST=10000 ...