Prash | 3 Aug 2012 16:44
Picon
Gravatar

launch scite with a particular language lexer pre-selected

Hi,
The nature of my query makes it difficult to figure out if the
question has been asked already. If so, I'd be grateful if you could
direct me to that thread.

I have a shell script (yaourt on Arch Linux) that launches a text
editor for some files (the names could be PKGBUILD, *.install, or
something else). The opened file is either a Bash script or has a bash-
like syntax. If I want syntax highlighting, I have to click on
Language->Shell. What command-line arguments could I use to launch
scite such that the subsequent "-open:xxx" would pre-select the Shell
lexer for xxx?

Going through http://www.scintilla.org/SciTEDoc.html and
http://www.scintilla.org/SciTEFAQ.html did not help.

--

-- 
You received this message because you are subscribed to the Google Groups "scite-interest" group.
To post to this group, send email to scite-interest <at> googlegroups.com.
To unsubscribe from this group, send email to scite-interest+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scite-interest?hl=en.

Neil Hodgson | 3 Aug 2012 23:47

Re: launch scite with a particular language lexer pre-selected

Prash:

> I have a shell script (yaourt on Arch Linux) that launches a text
> editor for some files (the names could be PKGBUILD, *.install, or
> something else). The opened file is either a Bash script or has a bash-
> like syntax.

   If you use #! to specify the interpreter in these files then you can use http://www.scintilla.org/SciTEDoc.html#property-shbang

   Neil

--

-- 
You received this message because you are subscribed to the Google Groups "scite-interest" group.
To post to this group, send email to scite-interest <at> googlegroups.com.
To unsubscribe from this group, send email to scite-interest+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scite-interest?hl=en.

Prash | 5 Aug 2012 00:46
Picon
Gravatar

Re: launch scite with a particular language lexer pre-selected

Thank you for the reply. But I can't really control the content of
these files.

Here is some more context: Arch Linux has a package build system that
calls various shell scripts, and these scripts are not meant to be
executed on their own, and so, do not have the #! line. Also, these
scripts are written by many (hundreds of?) people, and in a very
specific format. The scripts sets a few specific variables, defines a
few specific functions, etc. The package installer that I use launches
my chosen editor to let me quickly examine or modify these files
before I install each package.

On Aug 3, 11:47 pm, Neil Hodgson <nyamaton... <at> me.com> wrote:
> Prash:
>
> > I have a shell script (yaourt on Arch Linux) that launches a text
> > editor for some files (the names could be PKGBUILD, *.install, or
> > something else). The opened file is either a Bash script or has a bash-
> > like syntax.
>
>    If you use #! to specify the interpreter in these files then you can usehttp://www.scintilla.org/SciTEDoc.html#property-shbang
>
>    Neil

--

-- 
You received this message because you are subscribed to the Google Groups "scite-interest" group.
To post to this group, send email to scite-interest <at> googlegroups.com.
To unsubscribe from this group, send email to scite-interest+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scite-interest?hl=en.

(Continue reading)

Neil Hodgson | 6 Aug 2012 01:17

Re: launch scite with a particular language lexer pre-selected

Prash:

> Here is some more context: Arch Linux has a package build system that
> calls various shell scripts, and these scripts are not meant to be
> executed on their own, and so, do not have the #! line.

   You can try setting the lexer for files called * but that will interfere with settings for particular extensions:
lexer.*=bash

   Neil

--

-- 
You received this message because you are subscribed to the Google Groups "scite-interest" group.
To post to this group, send email to scite-interest <at> googlegroups.com.
To unsubscribe from this group, send email to scite-interest+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scite-interest?hl=en.

Martin Panter | 17 Aug 2012 08:05
Picon

Re: launch scite with a particular language lexer pre-selected

On 05/08/2012, Neil Hodgson <nyamatongwe <at> me.com> wrote:
> Prash:
>
>> Here is some more context: Arch Linux has a package build system that
>> calls various shell scripts, and these scripts are not meant to be
>> executed on their own, and so, do not have the #! line.
>
>    You can try setting the lexer for files called * but that will interfere
> with settings for particular extensions:
> lexer.*=bash

Hi Prash

I also use Arch and occasionally use Scite to edit PKGBUILD files. In
my “.SciTEUser.properties” file I have the following line which
automatically sets the lexer:

lexer.PKGBUILD=bash

Link to full file: (but I’m pretty sure the only relevant bit is the
line line above)
https://github.com/vadmium/etc/blob/master/scite/SciTEUser.properties

--

-- 
You received this message because you are subscribed to the Google Groups "scite-interest" group.
To post to this group, send email to scite-interest <at> googlegroups.com.
To unsubscribe from this group, send email to scite-interest+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scite-interest?hl=en.

(Continue reading)

Philippe Lhoste | 8 Aug 2012 10:57
Picon

Re: launch scite with a particular language lexer pre-selected

On 05/08/2012 00:46, Prash wrote:
> Thank you for the reply. But I can't really control the content of
> these files.
>
> Here is some more context: Arch Linux has a package build system that
> calls various shell scripts, and these scripts are not meant to be
> executed on their own, and so, do not have the #! line. Also, these
> scripts are written by many (hundreds of?) people, and in a very
> specific format. The scripts sets a few specific variables, defines a
> few specific functions, etc. The package installer that I use launches
> my chosen editor to let me quickly examine or modify these files
> before I install each package.

If the others suggestions don't suit you, you can use a solution to 
reduce the inconvenience: if you look into the global properties file, 
you will find keyText and some other definitions used in the 
menu.language property.
You can copy these definitions into your user properties file and modify 
it to your taste (I have my own set of language choice.
And I defined, for example, a
   keyJava=Ctrl+Shift+F12
property that I used in the Java entry:
   &Java|java|$(keyJava)|\

You can do the same for your language, thus after opening it you will 
see it in plain text, but with a key hit (eg. F12 for quick access) you 
will switch to your language. That's an additional operation, so not as 
convenient as a default setting, but that becomes a minor annoyance.

--

-- 
(Continue reading)

Prash | 9 Aug 2012 16:33
Picon
Gravatar

Re: launch scite with a particular language lexer pre-selected


On Aug 8, 10:57 am, Philippe Lhoste <Phi... <at> GMX.net> wrote:
> If the others suggestions don't suit you, you can use a solution to
> reduce the inconvenience: if you look into the global properties file,
> you will find keyText and some other definitions used in the
> menu.language property.
> You can copy these definitions into your user properties file and modify
> it to your taste (I have my own set of language choice.
> And I defined, for example, a
>    keyJava=Ctrl+Shift+F12
> property that I used in the Java entry:
>    &Java|java|$(keyJava)|\
>
> You can do the same for your language, thus after opening it you will
> see it in plain text, but with a key hit (eg. F12 for quick access) you
> will switch to your language. That's an additional operation, so not as
> convenient as a default setting, but that becomes a minor annoyance.
>
> --
> Philippe Lhoste
> --  (near) Paris -- France
> --  http://Phi.Lho.free.fr
> --  http://PhiLho.deviantART.com
> --  --  --  --  --  --  --  --  --  --  --  --  --  --

Thanks! I have done as you suggested now.

--

-- 
You received this message because you are subscribed to the Google Groups "scite-interest" group.
To post to this group, send email to scite-interest <at> googlegroups.com.
(Continue reading)


Gmane