Tuesday, May 25, 2010

Re: How to avoid use original command while execute !cmd

On 25/05/10 15:52, robert song wrote:
> Hi, everyone.
>
> I add one rm function in .bashrc, so if I use rm to delete the file,
> the file will be moved to ~/.Trash directory.
> But When I use "!rm /tmp/1" command, I can't find the file in ~/.Trash
> dir, it seems that the real rm command is called.
>
> How can I use the function defined by myself ?
>
> Best Regards,
> robert
>

~/.bashrc is only sourced by interactive shells. So:

Solution 1. Start gvim from an interactive bash shell, it will inherit
your settings.

Solution 2. Use Console Vim instead (you will have started it from an
interactive bash shell).

Solution 3. Place your rm function in ~/.profile instead, and invoke it
as "bash -l -c rm whatever" (~/.profile is sourced by login shells).


Best regards,
Tony.
--
Nasrudin walked into a teahouse and declaimed, "The moon is more useful
than the sun." "Why?", he was asked. "Because at night we need the
light more."

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment