Most people seem to recommend using source for reloading .zshrc. Why?
First I tried out source ~/.zshrc. But it resulted in a compinit error (at reload, not for new shell instances at first .zshrc load).
My reload alias is now:
alias…
I'm having problem with setting up simple function in ZSH.
I want to make function which downloads only mp3 file from youtube.
I used youtube-dl and i want to make simple function to make that easy for me
ytmp3(){
youtube-dl -x --audio-format mp3…
Still dipping my toes in bash coding and trying to crate a 1 liner alias to:
if 'perms' is entered w/out a parameter, it does a stat -c '%a - %n' *
else if 'perms' is entered with a parameter it does stat -c '%a - %n'
Goal is if no…
I try to refresh my .zshrc file by:
$ source .zshrc
but I get weird errors from npm (I don't know the connection to npm on this situation) about looking for package.json file inside my root user folder.
I don't why the source command trigger…
I'm trying to write a zsh function for open files or folders from terminal.
function osub () {
if [[ -z $@ ]]; then
/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl $@
else
/Applications/Sublime\…
I'm using oh-my-zsh a have the following alias in .zshrc:
alias composer="php -d memory_limit=-1 $(which composer)"
I get the following output:
$ composer
Could not open input file: composer:
And for:
$ which composer
composer: aliased to php -d…
I've noticed that I have a tendency to mistype ls as ;s, so I decided that I should just create an alias so that instead of throwing an error, it just runs the command I mean.
However, knowing that the semi-colon character has a meaning in shell…
If I type the following into Terminal I can accomplish everything I want:
git commit -am "my commit message" ; git pull ; git push ; ssh user@server 'cd /path/to/git/repo/ ; git pull ; exit'
I'd like to create the same as an alias in my ~/.zshrc.…
My goal is to type client air tab and complete the list of clients i have within my ~/clients directory.
Since hopefully my client list will grow i don't want to hardcode alias commands anymore but use client that will handle the cd…
I'm trying to add zsh completions for some aliases which are prefixed by a command and some args. More specifically, I have some commands which are aliased to an envchain ENV_NAME prefix.
For example:
alias brew='envchain homebrew-credentials brew'…
When I use a terminal or zsh I can't run commands, And this is what appears:
# /dev/fd/14:18: command not found: compdef #
Does anyone know how to reset the terminal to normal mode?
I tried to solve it and the only thing that got my terminal…
I'm trying to create a zsh alias pog that force-pushes a local branch to a non-existent remote branch of the same name, creating it in the process.
While I've been able to get this to work -- sort of -- it requires me to run the alias function twice…
On MacOS Big Sur 11.3, here is my .zshrc. I would like to get the newest files or directories near to the prompt (sorted from the most recent up to the oldest ones).
For the moment, I make test with the following command alias of ls :
The issue is…
I'd like to do something like this:
function invim () {
vim $(!!)
}
However when I run it, it says:
invim:1: command not found: !!
I assume this is because !! is an interactive shell expansion not available in noninteractive scripts/functions. In…
In ~/.tcshrc, I have the following aliases:
alias trash 'echo ./*{~,.bak,.save} ./.*{~,.bak,.save} ./#*#'
alias trashit 'rm -f ./*{~,.bak,.save} ./.*{~,.bak,.save} ./#*#'
How can I implement the same in zsh? The curly brace expansion seems…