小编NVa*_*han的帖子

zsh的历史太短了

当我history在Bash中运行时,我得到了大量的结果(1000+).但是,当我运行historyzsh shell时,我只得到15个结果.这使得在zsh中的grepping历史大多无用.我的.zshrc文件包含以下行:

HISTFILE=~/.zhistory
HISTSIZE=SAVEHIST=10000
setopt sharehistory
setopt extendedhistory
Run Code Online (Sandbox Code Playgroud)

如何修复zsh以使我的shell历史记录更有用?


UPDATE

如果在zsh中我打电话给history 1我得到我的所有历史,就像我在Bash中一样history.我可以使用别名命令来获得相同的结果,但我想知道为什么history在zsh和Bash 中表现不同.

history zsh

19
推荐指数
3
解决办法
8730
查看次数

.emacs代码识别操作系统?

我在Mac OS X和Ubuntu上都使用emacs.我的.emacs在两个平台上大致相同,有几行关于本地字体和其他与操作系统相关的东西.正如我通常对我的.emacs文件添加内容,我想以准自动方式同步它们.我的问题是---在Lisp中是否有一种方法可以添加条件过程来检测正在运行的操作系统?像(伪代码)的东西:

If OS X: 
  run this and that command;
If Linux:
  run that other command;
Fi
Run Code Online (Sandbox Code Playgroud)

提前致谢.

macos emacs ubuntu operating-system elisp

7
推荐指数
2
解决办法
377
查看次数

将命令或环境添加到AucTeX自动完成列表

我通过TeX-insert-macroLaTeX-environment函数在AucTeX的命令和环境中使用了很多自动完成功能。但是,有没有办法添加到内置列表的详细命令和宏(\enquote{}\noindent,等)?

lisp emacs auctex

3
推荐指数
1
解决办法
1066
查看次数

如何在zsh中获得“彩虹提示符”?

我喜欢 bash 中所谓的“彩虹提示符”:

在此输入图像描述

我这样制作:

export PS1="\[$(tput bold)\]\[$(tput setaf 1)\][\[$(tput setaf 3)\]\u\[$(tput setaf 2)\]@\[$(tput setaf 4)\]\h \[$(tput setaf 5)\]\W\[$(tput setaf 1)\]]\[$(tput setaf 7)\]\\$ \[$(tput sgr0)\]"

不幸的是,该代码在 zsh(这是我的主 shell)中不起作用。

我怎样才能在 zsh 中达到相同的结果?

zsh prompt zshrc

1
推荐指数
1
解决办法
2418
查看次数

标签 统计

emacs ×2

zsh ×2

auctex ×1

elisp ×1

history ×1

lisp ×1

macos ×1

operating-system ×1

prompt ×1

ubuntu ×1

zshrc ×1