lzzluca lzzluca - 1 month ago 7
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
alias ciao='vim -p $(
    git status --short | awk "{print $2}";
    git show --pretty="format:" --name-only
)'
Comments