zsh

Unable to read the timestamp of Zsh history

巧了我就是萌 提交于 2019-12-20 10:32:51
问题 Problem: to understand the following timestamp 1241036430 at ~/.history : 1241036336:0;vim ~/.zshrc : 1241036379:0;vim ~/bin/HideTopBar : 1241036421:0;ls : 1241036430:0;cat ~/.history when I have setopt EXTENDED_HISTORY HISTFILE=~/.history in .zshrc. How can you read the timestamp? 回答1: This simple util, called localtime is gold for reading files with timestamps: #!/usr/bin/perl # http://perl.plover.com/classes/mybin/samples/source/localtime if ($ARGV[0] eq '-f') { *show_localtime = \&show

Unable to read the timestamp of Zsh history

放肆的年华 提交于 2019-12-20 10:31:06
问题 Problem: to understand the following timestamp 1241036430 at ~/.history : 1241036336:0;vim ~/.zshrc : 1241036379:0;vim ~/bin/HideTopBar : 1241036421:0;ls : 1241036430:0;cat ~/.history when I have setopt EXTENDED_HISTORY HISTFILE=~/.history in .zshrc. How can you read the timestamp? 回答1: This simple util, called localtime is gold for reading files with timestamps: #!/usr/bin/perl # http://perl.plover.com/classes/mybin/samples/source/localtime if ($ARGV[0] eq '-f') { *show_localtime = \&show

Installing powerline fonts for zsh + Prezto theme

谁说我不能喝 提交于 2019-12-20 10:06:10
问题 I am currently using Zsh + Prezto for my scripting shell configuration. I have been using the sorin theme but am a little dissatisfied with it. I'd like to switch to the paradox theme! It is supposed to look like this: I'm having some trouble doing that. When I switch to the theme, the symbols aren't able to load, so I get a prompt that looks like this: Notice the boxed question marks where there should be an edge border for the background or a branch symbol for the git branch. (Take a look

zsh alias -> function?

心已入冬 提交于 2019-12-20 09:12:03
问题 Suppose I have: alias gg="git grep" then stuff like: gg "int x" works, but gg int x gets complaints. Is there a way to rewrite gg as a function in zsh so that it takes all the arguments after gg, and stuffs them into a string? Thanks! 回答1: gg() { git grep "$*"; } 回答2: For your particular use case, this is a bad idea. git-grep is expecting a single-arg pattern . You're trying to get the shell to treat your space (between int and x) as part of the pattern. This will break quickly when you try

zsh: stop backward-kill-word on directory delimiter

ぐ巨炮叔叔 提交于 2019-12-20 08:27:40
问题 In zsh, how can I set up the line editor such that backward-kill-word stops on a directory separator? Currently in my bash setup, if I type cd ~/devel/sandbox and then hit C-w point will be right after "devel/". In my zsh setup, point would be after "cd ". I'd like to set up zsh so it behaves similarly to bash. 回答1: A quick google reveals: Backward Kill Or, perhaps a better fix: Bash Style Backward Kill 回答2: For recent versions of zsh, you can simply add: autoload -U select-word-style select

ZSH iterm2 increase number of lines history

百般思念 提交于 2019-12-20 08:09:35
问题 Not sure if this is zsh, iterm2 or the interaction between them. Trying to change the number of recallable lines in the terminal - not the command history, the output history. In .zshrc I have : HISTFILE=~/.histfile HISTSIZE=100000 SAVEHIST=100000 This seems to be ignored =( Not sure of the correct term to google, "Terminal output history?" 回答1: It's not immediately obvious in the iTerm2 documentation on how to change it. open the iTerm2 preferences ⌘ + , select the Profiles tab then select

Exit zsh, but leave running jobs open?

霸气de小男生 提交于 2019-12-20 08:06:12
问题 Just switched from bash to zsh. In bash, background tasks continue running when the shell exits. For example here, dolphin continues running after the exit : $ dolphin . ^Z [1]+ Stopped dolphin . $ bg [1]+ dolphin . & $ exit This is what I want as the default behavior. In contrast, zsh's behavior is to warn about running jobs on exit , then close them if you exit again. For example here, dolphin is closed when the second exit -command actually exits the shell: % dolphin . ^Z zsh: suspended

How can you export your .bashrc to .zshrc?

与世无争的帅哥 提交于 2019-12-20 08:04:10
问题 I am trying to move to zsh from Bash. I put my .bashrc directly to my .zshrc, and it caused a lot of errors when I try to use Bash again. How can you export your .bashrc to .zshrc? 回答1: While lhunath's answer pushed me in the right direction, zsh does not seem to source .profile automatically. Lot's of good info on this topic can be found on this superuser post. The adaption I'm using is putting common aliases and functions in .profile and manually sourcing them as follows: .bashrc source ~/

How can you export your .bashrc to .zshrc?

筅森魡賤 提交于 2019-12-20 08:03:14
问题 I am trying to move to zsh from Bash. I put my .bashrc directly to my .zshrc, and it caused a lot of errors when I try to use Bash again. How can you export your .bashrc to .zshrc? 回答1: While lhunath's answer pushed me in the right direction, zsh does not seem to source .profile automatically. Lot's of good info on this topic can be found on this superuser post. The adaption I'm using is putting common aliases and functions in .profile and manually sourcing them as follows: .bashrc source ~/

How do I update zsh to the latest version?

北城余情 提交于 2019-12-20 07:56:49
问题 I recently switched to zsh on my Terminal.app on my OS X machine successfully. The version number of zsh is 4.3.11. 回答1: If you have Homebrew installed, you can do this. # check the zsh info brew info zsh # install zsh brew install --without-etcdir zsh # add shell path sudo vim /etc/shells # add the following line into the very end of the file(/etc/shells) /usr/local/bin/zsh # change default shell chsh -s /usr/local/bin/zsh Hope it helps, thanks. 回答2: If you're using oh-my-zsh Type upgrade_oh