Moving a word forward in z shell
In zshell how to move forward word, I can set -o vi and use vi format. Is there a way to move forward in zshell by a word ...
In zshell how to move forward word, I can set -o vi and use vi format. Is there a way to move forward in zshell by a word ...
I found this in the adam2 zsh prompt, and I have no idea what it means. Apparently it counts the length of the "string", but how it does that is beyond me. ${#${(S%%)string//(\%([KF1]|)\{*\}|\%[Bbkf])}} ...
I have a combination of: autoload -Uz compinit compinit and autoload -Uz vcs_info It actually allows for a great amount of integration between git and zsh's tab completion. Too much in fact. How do I limit the set of commands, so that git che(TAB) will expand to checkout, and not to a choice between checkout and checkout-index? ...
Bash allows me to write the statement, $ for i in {h..k} ; do echo $i ; done but zsh only allows number list expansion such as {8..13}. What's the best workaround? Something like seq for characters... ...
I have "v" aliased to "vim */.cpp */.hpp */.cxx" Problem is, if I'm in a directory without any .cxx files, zsh treats this as an error. Is there anyway to tell zsh to create the absence of */*.cxx files as "" instead of an error? ...
I want to adjust zsh so that I can tab complete: myprog <tab> using all *.foo files in ~/somedir, but have it so that it displays them without the .foo extension. Is there any way to do this? This is what I have so far: #compdef myprog typeset -A opt_args local context state line local -a mydirs mydirs="(. ~/somedir)" _arguments -...
I'm trying to write an alias for cd !!:1, which takes the 2nd word of the previous command, and changes to the directory of that name. For instance, if I type rails new_project cd !!:1 the second line will cd into the "new_project" directory. Since !!:1 is awkward to type (even though it's short, it requires three SHIFTed keys...
I'd like to be able to switch temporarily from emacs mode to vi mode, since vi mode is sometimes better, but I'm usually half-way through typing something before I realize I want I don't want to switch permanently to vi mode, because I normally prefer emacs mode on the command line, mostly because it's what I'm used to, and over the yea...
You can push things to buffer with ^Q and pop them with ESC-g. Alt+x vi-set-buffer changes buffer somehow. How can I see all the buffers? They are probably some files to look at. ...
I forgot the array syntax while on Zsh-commandline: $ hello=[1,2,3,4] %ERR: I want to fix the problem by substitution. In Vim, I would do :.s@,@ @g. So how can I edit the current line, or let call it a current buffer, by running a command on it? ...
Hi there, I want to have a function in my zsh for faster accessing my todo-files. It should look inside the folder ~/tasks where i put my todo-lists and stuff. Now i want to type task p and when I hit tab, it should use the files in that directory for autocompletition. Can anyone point me some direction? Or share some snippet to work wi...
Sometimes I want a filename instead of what zsh guesses for me. For example, I have a PNG file without a proper .png suffix, which makes zsh think it isn't a picture and won't list it when I type Tab to complete arguments of display. I am wondering if there is a key sequence that completes for a filename wherever the context is, like ^X...
$ values=( 300 400 ) $ echo "scale=20; $values[1]-$values[2]" | bc (standard_in) 1: illegal character: ^M // Why does it not print -100? $ echo $values // no ^M sign found! 300 400 [Update] Why is 5E 4d 0a, ie ^M, 13th char in ASCII? Why is the ending sign 0a shown as .? . is 2E in DEC. Hex nu...
I am currently learning the zsh and now I wanted to use strftime but i get: zsh: command not found: strftime I think I'm doin' something wrong, since I see people using that function all the time in their dotfiles. ...
When I say 'git checkout ' I want zsh to autocomplete names of my git branches. Is that possible? ...
I'm having a rather strange problem with zsh. When I start up my shell, everything - functions, environment vars, aliases, etc. - all work fine. I've created the following function and sourced it in zsh: clean() { path=/tmp for i in ${path}/*; do echo $i done } Running clean in the terminal works as expected, i...
I used to do this with bash... /bin/bash --rcfile /home/sindhu/bin/misc_scripts/shellrc/.bashrc_1 how can I accomplish the same with zsh? Thank you.z ...
Good morning, In zshell I have an alias as follows: alias foo='echo FooBar!' Which of course works fine. I have a function wherein I'm trying to actually 'execute' the alias, where it doesn't. foo_fun () { echo "About to foo!" `$foo` $foo eval $foo eval `$foo` echo "Just food...wait what?" } I'm having a b...
I'm currently writing a little zsh function that checks all of my git repositories to see if they're dirty or not and then prints out the ones that need a commit. Thus far, I've figured out that the quickest way to figure out a git repository's clean/dirty status is via git-diff and git-ls-files: if ! git diff --quiet || git ls-files -...
Hi there, I have zsh set up as my default shell. It works fine as long as i am not within a screen. When i start screen it looks as if some dotfiles are not loaded. For example my $PATH isn't set correctly and some directories are missing. I'm not quite sure where to start looking. Since all is fine, as long as i'm not in a screen. My ...