Tag Info

Hot answers tagged

13

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


10

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 ...


8

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 ...


5

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 ...


5

_kadmin is probably a completer function for the kadmin tool - not a directory. If you attempt completion on something that zsh can't find as a command, a directory or a valid and known command argument completion, it then starts to offer completion functions as possible expansion candidates. By default, zsh comes with a lot of completers, many of which you ...


5

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 ...


4

The problem is in the order the files are sourced. LS_COLORS must be defined before you run zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}. You can fix this by renaming the files to something like 00theme-and-appearance.zsh and 01completion.zsh.


4

There is a plugin that claims to do exactly what you are looking for, appropriately named per directory history plugin: https://github.com/jimhester/oh-my-zsh/commit/baa187e4b903f39422a84b580e6e617ec3738e09 "Per-directory-history - tracks previous command history both per current directory and globally, with the ability to switch between them on the fly, ...


4

To get back into the system you can boot into single user mode by appending the number 1 at the end of the linux kernel line within GRUB. The method for doing this is roughly outlined in this U&L Q&A titled: Can I launch a process as root without launching root's login shell?. Once you've done this you'll be dropped to a prompt as root from ...


4

ZSH Config Switching If you want to test different zsh configuration frameworks (oh-my-zsh, zprezto, etc) and switch between them, your best bet is using symbolic links for ~/.zsh, ~/.zshrc, ~/.zlogin, ~/.zlogout, ~/.zprofile, and ~/.zshenv. You may want to create a shell scripts for each framework to create those symlinks for faster switching. Put your ...


3

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.


3

The . command searches for the file in your $path, it does not by default search in the current directory. That is why it works when you give the absolute path ("$(pwd)"/.zshrc). From the zsh manual about the . command: . file [ arg ... ] Read commands from file and execute them in the current shell environment. If file does not contain a ...


3

.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 ...


3

This could be a consequence of running some code that clobbers the variable FPATH or fpath. Check the value of either of these variables; it should be a list of directories where zsh loads functions. The variables FPATH and fpath are tied (like PATH and path): changing one affects the other. The uppercase FPATH is a string which contains a colon-separated ...


3

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


3

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 ...


3

For this: /Users/jack/.zshrc:source:34: no such file or directory: /Users/jack/.oh-my-zsh/oh-my-zsh.sh The problem is this line: source $ZSH/oh-my-zsh.sh You don't have a file called oh-my-zsh.sh in /Users/jack/.oh-my-zsh For this: /Users/jack/.zshrc:source:38: no such file or directory: .bashrc The problem is the same as above; essentially, you ...


3

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 ...


3

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


2

As Thor pointed out in his comment, the autocompletion in braces only works, until you put the closing brace. So: touch dir/{some_file,other_f<TAB>(without the closing brace!) autocompletes the filename, so you get touch dir/{some_file,other_file touch dir/{some_file,other_f<TAB>}(with the closing brace!) expands the braces first, so you get ...


2

The option responsible for this behaviour is `cdable_vars'. It's not enabled by default. See the Manual's chapter about Options for details.


2

oh-my-zsh creates a few alias in .oh-my-zsh/lib/directories.zsh named 1, 2 ... 9 which expand to cd -, cd -1, etc. So time is functioning correctly, but the unexpected alias 1 actually does something. The reason why time's normal output isn't given is due to the fact cd is a builtin command that doesn't require forking.


2

There are two de facto standard escape sequences for cursor keys; different terminals, or even the same terminal in different modes, can send one or the other. For example, xterm sends \eOA for Up in “application cursor mode” and \e[A otherwise. For Down you can encounter both \e[B and \eOB, etc. One solution is to duplicate your bindings: whenever you bind ...


2

I think you will find much interest in this. Seems like what is done is set a title with a small function in zsh to the current directory then run this before every command then trap that in screen... I don't think using hardstatus or caption makes a difference to the method: in .zshrc: function title { if [[ $TERM == "screen" ]]; then # Use these ...


2

while with ZDOTDIR, you can tell zsh to interpret a file called .zshrc in any directory of your choosing, having it interpret any file of your choosing (not necessarily called .zshrc) proves quite difficult. In sh or ksh emulation, zsh evaluates $ENV; so you could add emulate zsh at the top of your /path/to/file and do: ssh -t host 'zsh -c "ARGV0=sh ...


2

Login as root. Verify that zsh is installed. If not apt-get install zsh


2

Any sub directory to a directory containing a git repo will be identified as a git repo. I had accidentally created a git repo in / which resulted in all directories being identified as git repos.


2

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). ...


1

su executes your login shell as indicated in the login database. This is /root/zsh, which doesn't exist, so the command su fails. chsh only accepts changing the shell of a user who currently has a valid shell (listed in /etc/shells). Since /root/zsh is not accepted, chsh fails. The root user can change anyone's shell, but this test is made after the ...


1

I think that feature that OP is looking for is called dabbrev-expand in Emacs world: Expand the word in the buffer before point as a dynamic abbrev, by searching in the buffer for words starting with that abbreviation (v-expand). xterm also has dabbrev-expand feature but it's a bit less smart than Emacs counterpart but it's very useful to me and ...



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