ratpoison-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RP] Re: useful .ratpoisonrc one-liner?


From: Björn Lindström
Subject: [RP] Re: useful .ratpoisonrc one-liner?
Date: Mon Oct 28 03:43:03 2002
User-agent: Mutt/1.4i

John Arundel <address@hidden> [021028 12:38]:
> Great tip! Thanks.

Actually, I fixed it up a bit. Now it looks like this:

DISPLAY=:0
:0 ci
| ratpoison -c 'echo New mail.' 2>&1 > /dev/null

Here is another, slightly larger thing:

I call this script ~/opt/bin/gvim-wrapper. It uses an existing
GVim session for editing files, if possible.

#!/bin/sh
if [ -n "$*" ]; then
    if gvim --serverlist | grep -q GVIM; then
        gvim --remote $*
    else
        gvim $*
        ratpoison -c split
        sleep 1
        ratpoison -c only
    fi
else
    if gvim --serverlist | grep -q GVIM; then
        ratpoison -c 'select Vim:'
    else
        gvim
        ratpoison -c split
        sleep 1
        ratpoison -c only
    fi
fi

First, you need something like this in your .zshrc (it would be
very similar in most other shells):

if [[ -n $DISPLAY ]]; then
    alias vi=gvim-wrapper
else
    alias vi=vim
fi

To make this play nice with Mutt, you can put this in your
.muttrc:

set editor="echo 'Editing message...'; if [ -n \"$DISPLAY\" ]; then 
gvim-wrapper; gvim --remote-wait %s; ratpoison -c 'select mutt'; else vim %s; 
fi"

-- 
Björn Lindström <address@hidden>   hem.fyristorg.com/bkhl/
Addr: Ramsta Svista, SE-755 91 Uppsala Ph: 018-398248/073-6171268
Listening to: Assemblage 23 - Addendum - 1 - Let Me Be Your Armor




reply via email to

[Prev in Thread] Current Thread [Next in Thread]