50

Thats three questions in one ;-) AUTO_CD Option and howto find it First of all the option you are looking for is AUTO_CD. You can easily find it by looking up man zshoptions. Use your pagers search function, usually you press / and enter the keyword. With n you jump to the next occurrence. This will bring up the following: [..] Changing Directories ...


35

If the characters on your command line are sometimes displayed at an offset, this is often because zsh has computed the wrong width for the prompt. The symptoms are that the display looks fine as long as you're adding characters or moving character by character but becomes garbled (with some characters appearing further right than they should) when you use ...


28

zsh -x 2>zsh.trace exit grep 'alias.*subl' zsh.trace The -x option causes zsh to print out every command that it executes on stderr. Any command that was executed from reading a file has a prefix with the file name and line. So look for the alias definition in the trace file and you'll know where it was defined.


21

Add this to your ~/.zshrc alias sudo='nocorrect sudo'


21

Add this to your .zshrc and ..[TAB] will complete to ../ as per bash. zstyle ':completion:*' special-dirs true


21

From the man pages: STARTUP/SHUTDOWN FILES Commands are first read from /etc/zshenv; this cannot be overridden. Subsequent be‐ haviour is modified by the RCS and GLOBAL_RCS options; the former affects all startup files, while the second only affects global startup files (those shown here with an path starting with a /). If ...


20

The wording of your question is ambiguous, so I can't tell if you mean you want to stop using zsh or you want to stop using oh-my-zsh. I will cover both. Disabling zsh Simply run chsh and select whatever shell you were using before. If you don't know what shell you were using before, it is almost certainly bash. This command changes the "login shell" that ...


17

I am unable to give a detailed report of their differences but I can at least give a broad overview that may help to answer some basic questions and lead you to places where you can learn more. oh-my-zsh: Built-in plugin/theme system Auto updater for core, plugins, and themes Default behavior easily overridden or extended Widely popular (which means an ...


15

I had the same problem and found my solution here: https://github.com/robbyrussell/oh-my-zsh/issues/5157#issuecomment-226031519. Simply put the following into your ~/.zshrc. export LC_CTYPE=en_US.UTF-8


15

You can list those insecure folders by: compaudit The root cause of "insecure" is these folders are group writable. There's a one line solution to fix that: compaudit | xargs chmod g-w Please see zsh, Cygwin and Insecure Directories and zsh compinit: insecure directories for reference.


12

Shell's prompt Inside your virtualenv environment is a file, bin/activate. You can edit this file to change your prompt to whatever you want it to look like. Specifically this section of the file: ... else PS1="(`basename \"$VIRTUAL_ENV\"`)$PS1" fi ... The variable PS1 is a special variable that controls what a shell's prompt will look like. Changing ...


11

I have this alias alias sudo='sudo 'defined in a file which I sourced at the end of ~/.zshrc file which overwrote alias sudo='nocorrect sudo' which is defined in .oh-my-zsh/lib/correction.zsh alias sudo='nocorrect sudo' is required by zsh's auto-completion feature to work More: How to disable autocorrection for sudo [command] in zsh? But at same time I ...


10

First of all, there is a significant difference between the terminals types rxvt and unicode-rxvt (often abbreviated to urxvt). You have indicated that the terminal you are using is "URXVT Version 9.22", so to avoid confusion, please use the correct name which is not rxvt but urxvt. As Mikel has pointed out, the Xresources file is telling urxvt to use the ...


9

Turns out that removing all ~/.zcompdump files solved it: rm -r ~/.zcompdump*


9

In zsh, the time keyword has no effect on builtins (or other similar shell-internal constructs). From this mailing list post: Additional note: The time builtin applied to any construct that is executed in the current shell, is silently ignored. So although it's syntactically OK to put an opening curly or a repeat-loop or the like immediately after ...


8

Installing zsh doesn't install Oh My Zsh, which might explain if you don't have an oh-my-zsh.sh file at all (this was the case for me). You can install Oh My Zsh by running sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"


8

If you don't want any of oh-my-zsh's aliases, but you want to keep other aliases, you can save the aliases before loading oh-my-zsh save_aliases=$(alias -L) and restore them afterwards. eval $save_aliases; unset save_aliases If you want to remove all aliases at some point, you can use unalias -m '*' (remove all aliases matching *, i.e. all of them). If ...


8

This works for me : rm $ZSH_COMPDUMP && exec zsh


8

You had the options auto_cd and cdable_vars turned on. With auto_cd, if you type a directory as a command name, the cd command is implied. With cdable_vars, if a directory doesn't exist, or a command doesn't exist with auto_cd, then the name is looked up in the directory hash table. As long as you're using the “new-style” (compinit) completion system, which ...


7

You can use unalias with -m option: unalias -m '*' to delete all defined aliases


7

You can set the size of the history file zsh uses with the SAVEHIST variable. just put a line in your .zshrc (found in your home directory) like SAVEHIST=n to save up to n commands in your history (replacing n with a number of course). By default, I think that both zsh and oh-my-zsh aleady has a line in your .zshrc that assignes SAVEHIST, so just change the ...


7

The standard way to define directory abbreviations for the prompt is to use named directories. Named directories are used when expanding the %~ prompt escape sequence, generalizing ~ to abbreviate your home directory and ~bob to abbreviate Bob's home directory. mu3 [~]: cd /Users/mu3/Development/Web/test mu3 [~/Development/Web/test]: hash -d test=$PWD mu3 [~...


7

That is because you are trying to use the GNU find, which is default in Linux, but Mac OS X comes with BSD find which has many differences. To install GNU find you will need Homebrew, pretty easy to install, just follow http://brew.sh/ After that you can install findutils: brew install findutils More info and other tools to mimic a Linux environment on ...


7

I think it's better to use precmd() instead of preexec(): # .zshrc _fix_cursor() { echo -ne '\e[5 q' } precmd_functions+=(_fix_cursor) This way: you don't have to change .vimrc cursor is fixed also when you create a new prompt without executing a command you don't have to write echo -ne '\e[5 q' twice in your .zshrc.


6

You tagged the question with oh-my-zsh, but did not mention it in the question. I suspect that oh-my-zsh is creating its own ls alias. If this happens after you define your alias, then it will override yours. You should probably uncomment DISABLE_LS_COLORS="true" in your .zshrc, or put your alias after the line that does source $ZSH/oh-my-zsh.sh.


6

I think you need to retrieve the existing items and append yours. zstyle -s ':completion:*:hosts' hosts _ssh_config [[ -r ~/.ssh/config ]] && _ssh_config+=($(cat ~/.ssh/config | sed -ne 's/Host[=\t ]//p')) zstyle ':completion:*:hosts' hosts $_ssh_config


6

The prompt escape sequence %~ (included in $current_dir) expands to the current directory, taking abbreviations into account. The abbreviations are: ~ for your home directory; ~joe for the home directory of user joe; ~foo for a named directory: the directory aliased to foo with hash -d foo=…; ~[bar] for a dynamic named directory. You can use %/ instead of %...


6

.oh-my-zsh isn't used by anything but oh-my-zsh. If you use bash, you can just remove it. The instructions tell you to run the command uninstall_oh_my_zsh. This is a function that you can invoke from zsh running oh-my-zsh. If you aren't running oh-my-zsh, you can run tools/uninstall.sh, but all it does is: remove ~/.oh-my-zsh, which you were going to do ...


6

You've made grep an alias for grep $GREP_OPTIONS. Don't do that: the GNU grep command itself parses the GREP_OPTIONS environment variable. If you want to put options to a command in a variable, make that variable an array, and don't export it (you can't export arrays anyway, environment variables have string values only). LS_OPTIONS=(--color=auto -q) alias ...


6

I looked through the .zshrc and /etc/zshrc of my systems. From experimenting, to expand /v/L/S/c to /var/log/squid/cache.log, I needed three settings: # These two initialize the completion system, # providing the case-sensitive expansion autoload -U compinit compinit # This sets the case insensitivity zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:...


Only top voted, non community-wiki answers of a minimum length are eligible