Tag Info

Hot answers tagged

7

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


4

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


4

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


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.


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

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

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

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


3

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


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

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


2

As Skippy said, you should add them to the ~/.xinitrc file. This is because: /etc/rc.local executes at boot time, before the Xserver is up .zshrc gets loaded only when you start a zsh shell. /etc/xdg/lxsession/Lubuntu/autostart needs an special name and format: they should be named <something>.conf and has proper exec= values and be stored in ...


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.


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

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


1

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


1

Under Linux, the main effect of ps x is to include all processes running as the same user. By default, ps only includes processes running on the same terminal. In contrast, the BSD default is to include processes that have a controlling terminal, whether it's the same or not. The corresponding BSD option is -x. In addition, ps x selects a slightly different ...


1

You probably installed scm_breeze, and my theory is that in your .zshrc the sourcing of scm_breeze.sh is preceeded by oh-my-zsh.sh. And if you put your git function definition at the very end of .zshrc, then you probably exceed the scm_breeze.sh, so that's the reason why it works. Try to move the line that sources oh-my-zsh.sh to the very end of your ...


1

I don't really see how .xinitrc is relevant here. That file is read by xinit, an old way of starting an X session and one you are almost certainly not using. In most modern Linux systems, the X session is started by a login manager service, for example lightdm or gdm2 or whatever and not by xinit. Anyway, according to the LXDE wiki, you need to add these ...


1

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.


1

Both the theme and the plugins are sourced in oh-my-zsh/oh-my-zsh.sh, so technically there should be no difference. But a theme should only be used to change the appearance and a plugin is there to add new functionality. With appearance I mean setting the values of $PS1, $PS2, $RPS1 and etc. There are some plugins which also set some appearances, like ...


1

Default paths are defined in /etc/paths on OSX. As a sub-process inherits environment variables and you explicitly set /usr/bin/ in your $PATH you have duplicate entries. To remove the duplicate entries you can use: typeset -U PATH


1

I don't know which other file is setting your $PATH but the duplicated entries are /opt/X11/bin /usr/bin /usr/local/bin /usr/sbin All of these are set in your ~/.zshrc so all you need to do is not set them there. In any case, these should all be in the default $PATH and there is no need to add them. Most systems come with a default $PATH that will include ...


1

I haven't used oh-my-zsh (uh-oh) but I do use zsh and it and other shells do not reload configuration files between commands. You must explicitly reload them with the source command: source ~/.zsh_config_file_you_modified_or_another_file or . ~/.zsh_config_file_you_modified_or_another_file Starting a new zsh shell does that (completely with a new ...


1

Most likely the version of zsh you are using is from before the %F color escape sequence was added. This means that, in addition to not coloring the prompt correctly, it will leave the arguments to this sequence lying around. To solve this you should replace the current theme file with this: function _prompt_char() { if $(git rev-parse ...


1

Ignoring directory patterns is fairly painless. You can add the following to your ~/.zshrc. The first line ignores .mc and .gem patterns after issuing cd [TAB]. The next line ignores them after issuing sudo [TAB]. zstyle ':completion:*:cd:*' ignored-patterns '(*/)#.mc' '(*/)#.gem' zstyle ':completion:*:sudo:*' ignored-patterns '(*/)#.mc' '(*/)#.gem'



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