lzzluca lzzluca - 1 year ago 67
Git Question

bash alias not working(open git status output files as vim tab)

I am trying to make this alias working:

alias ciao="vim -p `git status --short | awk '{print $2}'; git show --pretty="format:" --name-only`

Basically I would like to open every files, printed by
git status
, as vim tab.
The command works properly when I run it in the prompt directly but I cannot make an alias of it.

Looks like
vim -p
is applied to the first file printed but not to the others (when the files from
git status
are more than one).

I would love if somebody can tell me what I am doing wrong: in the alias I pasted there are obvious problems (like escaping), sorry about that.

Answer Source
alias ciao='vim -p $(
    git status --short | awk "{print $2}";
    git show --pretty="format:" --name-only
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download