TextExpander

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

TextExpander

Joseph Retzer-2
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_multibyte" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Hi All,
  I was wondering if anyone knew of a way to use the package "TextExpander" (from www.smileonmymac.com/TextExpander) in MacVim?

  The package simply allows for "snippets" of text or graphics to be inserted in multiple applications on the Mac.

  I downloaded the demo and it did not work in MacVim but did in textedit (and I have no intention of switching to anything from MacVim :-)

Many thanks,
Joe Retzer
Reply | Threaded
Open this post in threaded view
|

Re: TextExpander

David Morel-2


Le 8 juil. 08 à 01:18, Joseph Retzer a écrit :

> Hi All,
>   I was wondering if anyone knew of a way to use the package  
> "TextExpander" (from www.smileonmymac.com/TextExpander) in MacVim?
>
>   The package simply allows for "snippets" of text or graphics to be  
> inserted in multiple applications on the Mac.
>
>   I downloaded the demo and it did not work in MacVim but did in  
> textedit (and I have no intention of switching to anything from  
> MacVim :-)
>
> Many thanks,
> Joe Retzer
>

there is something similar in MacVim:

:help iab

a more sophisticated version is snippetsEmu:

http://www.vim.org/scripts/script.php?script_id=1318

David


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_multibyte" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: TextExpander

David Morel-2


Le 8 juil. 08 à 07:22, David Morel a écrit :

>
>
> Le 8 juil. 08 à 01:18, Joseph Retzer a écrit :
>
>> Hi All,
>>  I was wondering if anyone knew of a way to use the package
>> "TextExpander" (from www.smileonmymac.com/TextExpander) in MacVim?
>>
>>  The package simply allows for "snippets" of text or graphics to be
>> inserted in multiple applications on the Mac.
>>
>>  I downloaded the demo and it did not work in MacVim but did in
>> textedit (and I have no intention of switching to anything from
>> MacVim :-)
>>
>> Many thanks,
>> Joe Retzer
>>
>
> there is something similar in MacVim:
>
> :help iab

Duh!

:help :iabbrev will work better, or even :h abbreviations

David
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_multibyte" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: TextExpander

Nico Weber-3
In reply to this post by Joseph Retzer-2

Hi,

>   I was wondering if anyone knew of a way to use the package  
> "TextExpander" (from www.smileonmymac.com/TextExpander) in MacVim?

it looks like MacVim does not implement some stuff TextExpander  
expects to be there. There was a similar problem a while back ( http://groups.google.com/group/vim_mac/browse_thread/thread/f8b057ec6afe12e7/5516236a1466978b?lnk=gst&q=applescript#5516236a1466978b 
  . By the way, why has this patch not been merged?), but the fix  
proposed in that thread does not help here.

I'll get in touch with the TextPander guys and will try to fix this.

Nico

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_multibyte" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: TextExpander

Nico Weber-3

Hi,

>>  I was wondering if anyone knew of a way to use the package
>> "TextExpander" (from www.smileonmymac.com/TextExpander) in MacVim?
>
> it looks like MacVim does not implement some stuff TextExpander
> expects to be there. There was a similar problem a while back ( http://groups.google.com/group/vim_mac/browse_thread/thread/f8b057ec6afe12e7/5516236a1466978b?lnk=gst&q=applescript#5516236a1466978b
>  . By the way, why has this patch not been merged?), but the fix
> proposed in that thread does not help here.

MacVim _does_ work with TextExpander. It just does not work right  
after entering insert mode. Why?

TextExpander starts a small background process ('textexpanderd', you  
can find it in Activity Monitor). This process logs all of your  
keypresses. When it sees one of the macros (for example the default  
macro "ttime"), it replaces that macro with its replacement: It  
somehow deletes the macro text, stores the current pasteboard content,  
then puts the replacement text in the pasteboard, activates ⌘V in the  
current application, and restores the old pasteboard content. Nearly  
all of this does work with MacVim.

However, MacVim uses modes, and you need to press 'i' to enter insert  
mode. So when you enter insert mode and the type 'ttime', TextExpander  
sees 'ittime' (it doesn't know about modes) and thus, the keyword is  
not triggered. It seems it does not work to add 'i' as a delimiter in  
SysPrefs->TextExpander->Preferences.

What you can do: Put `map <Space> i` in your _vimrc and use Space to  
enter insert mode. Then TextExpander sees a space before your macro,  
but the space is remapped to 'i' for vim. Cons: You have to use Space  
instead of 'i' to enter insert mode, and this doesn't work if you  
enter insert mode through other keys (e.g. 'o', 'O').

I've cc'd the TextExpander guys, perhaps they have a better suggestion.

HTH,
Nico
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_multibyte" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: TextExpander

Björn Winckler
In reply to this post by Nico Weber-3

2008/7/8 Nico Weber <[hidden email]>:
>
>>   I was wondering if anyone knew of a way to use the package
>> "TextExpander" (from www.smileonmymac.com/TextExpander) in MacVim?
>
> it looks like MacVim does not implement some stuff TextExpander
> expects to be there. There was a similar problem a while back ( http://groups.google.com/group/vim_mac/browse_thread/thread/f8b057ec6afe12e7/5516236a1466978b?lnk=gst&q=applescript#5516236a1466978b
>  . By the way, why has this patch not been merged?), but the fix
> proposed in that thread does not help here.

That patch was never merged because it is incomplete.  I need to
figure out a reliable way to replace the current selection with a
given string (or just insert the string if there is no selection).
The problem is that it needs to work in all modes and the above patch
only works in Visual mode (it doesn't even do the right thing in
Select mode).  If somebody could help me with this I could finish the
patch and merge it.

Thanks,
Björn

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_multibyte" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: TextExpander

Joseph Retzer-2
In reply to this post by Nico Weber-3
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_multibyte" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Hi All,
  First, thanks very much Nico for looking into this and providing valuable information. I too wrote the support folks for TextExpander and got this reply:

"Hi Joe,

Thanks for the feedback. I don't think we'll pursue a MacVIM-specific modification to TextExpander. However, we are considering no longer requiring space, tab, or return (whitespace) to precede abbreviations. If we make that change, things will work well with MacVIM.

Thanks for using TextExpander from SmileOnMyMac!

Regards,

Greg
TextExpander Support
[hidden email]


I'm hoping they implement this change soon. If I hear back that they have, I'll notify the list.

Thanks,
Joe


--- On Tue, 7/8/08, Nico Weber <[hidden email]> wrote:
From: Nico Weber <[hidden email]>
Subject: Re: TextExpander
To: [hidden email]
Cc: [hidden email]
Date: Tuesday, July 8, 2008, 12:08 PM

Hi,

>> I was wondering if anyone knew of a way to use the package
>> "TextExpander" (from www.smileonmymac.com/TextExpander) in
MacVim?
>
> it looks like MacVim does not implement some stuff TextExpander
> expects to be there. There was a similar problem a while back (
http://groups.google.com/group/vim_mac/browse_thread/thread/f8b057ec6afe12e7/5516236a1466978b?lnk=gst&q=applescript#5516236a1466978b
> . By the way, why has this patch not been merged?), but the fix
> proposed in that thread does not help here.

MacVim _does_ work with TextExpander. It just does not work right
after entering insert mode. Why?

TextExpander starts a small background process ('textexpanderd', you
can find it in Activity Monitor). This process logs all of your
keypresses. When it sees one of the macros (for example the default
macro "ttime"), it replaces that macro with its replacement: It
somehow deletes the macro text, stores the current pasteboard content,
then puts the replacement text in the pasteboard, activates ⌘V in the
current application, and restores the old pasteboard content. Nearly
all of this does work with MacVim.

However, MacVim uses modes, and you need to press 'i' to enter insert
mode. So when you enter insert mode and the type 'ttime', TextExpander

sees 'ittime' (it doesn't know about modes) and thus, the keyword
is
not triggered. It seems it does not work to add 'i' as a delimiter in
SysPrefs->TextExpander->Preferences.

What you can do: Put `map <Space> i` in your _vimrc and use Space to
enter insert mode. Then TextExpander sees a space before your macro,
but the space is remapped to 'i' for vim. Cons: You have to use Space
instead of 'i' to enter insert mode, and this doesn't work if you
enter insert mode through other keys (e.g. 'o', 'O').

I've cc'd the TextExpander guys, perhaps they have a better suggestion.

HTH,
Nico
Reply | Threaded
Open this post in threaded view
|

Re: TextExpander

sedmonds
In reply to this post by Nico Weber-3
Hi,

Have you found a solution for using VIm with Textexpander.

I discovered that by first inserted successive blank lines(more than 8) that textexpander rules work just fine.

I am running 10.6.4 and the latest version TE.

Let me know if this works for you.
Reply | Threaded
Open this post in threaded view
|

Re: TextExpander

Donald Ephraim Curtis
There is now an option in TextExpander that says "Always use clipboard to insert snippet" and this seems to work in MacVim for me.

There is a problem with the main MacVim window that they disabled inserting to a range for some reason.  I think they need to fix it but for now this works.

--
You received this message from the "vim_multibyte" maillist.
For more information, visit http://www.vim.org/maillist.php