1

I'm trying to run gvim work with Unity but I can't seem to get it working.

A workaround is I can run the command gvim -f MYARGS& to make it play nice with Unity.

This lets unity manage the menu bar or something. To do this I tried a command like: alias gvim=gvim& -f, but that didn't work. Then I tried making it a function

alias gvim=gvim_hack
# Why isnt this passing all args (if any) to gvim and running it the way I want?
gvim_hack()
{
  gvim -f $@ &
}

but that seems to not work as well. I'm pretty new to linux.

SOLVED: I had a name conflict

alias gvim=gvim_hack
gvim_hack()
{
  /usr/bin/gvim -f $@ &
}
Erotemic
  • 4,806
  • 4
  • 39
  • 80
  • 2
    Try quoting your expansion: `"$@"` – Todd A. Jacobs Jan 31 '13 at 22:29
  • 1
    When you end a command with `&`, you are sending it to its own process, rather than making it "hog" your current shell. Why can't you use your "workaround"? It might help to expand the question a little bit "I want to type `xxx` and I want the result to be `yyy` but instead I am getting `zzz`. Here are some of the things I tried..." – Floris Jan 31 '13 at 22:31

1 Answers1

2

Use quotes when you define the alias.

alias gvim='gvim -f &'
John Kugelman
  • 349,597
  • 67
  • 533
  • 578