momodalo / vimtouch

vimtouch
Apache License 2.0
349 stars 71 forks source link

detect vimtouch in vimrc? #37

Closed teranex closed 11 years ago

teranex commented 11 years ago

Is it somehow possible to detect that the current vim instance is Vimtouch from inside the .vimrc?

rtfb commented 11 years ago

On Mon, Feb 11, 2013 at 11:03 PM, Jeroen notifications@github.com wrote:

Is it somehow possible to detect that the current vim instance is Vimtouch from inside the .vimrc?

I don't remember seeing such code, but I might have not paid attention in the right place. I guess we should expose the OS name, a-la if has("android") if we don't do that yet.

Vytautas Šaltenis On the Web: http://rtfb.lt/

teranex commented 11 years ago

has('android') was indeed what I was hoping for. From a quick test that doesn't seem to work. For now the best I could come up with is $VIM =~ 'vimtouch'.

momodalo commented 11 years ago

to implement has("android") needs to modify the vim/src/eval.c but I didn't decide to hard code anything in the vim source tree yet. Any better idea?

untitaker commented 11 years ago

:version shows who compiled the current vim. Maybe you could use that to determine if you're using vimtouch?

teranex commented 11 years ago

@untitaker I currently use $VIM =~ 'vimtouch' which works.

@momodalo since it is possible to determine vimtouch with the above trick I don't think starting to modify the Vim source just for that. If you ever start modifying the vim source it might be a nice addition, but for now I would just leave it untouched. I'll close the issue as the aforementioned method is good enough for now.