Specify lexer from terminal

Request Features and Feature Changes

Specify lexer from terminal

Postby linkmaster03 » Mon Mar 09, 2009 10:16 pm

I think it would be cool if it were possible to specify a lexer from terminal. For example, editra -l python to use python lexer, or editra -l c++ for C++. This would be very useful for people that use (or would like to use) Editra with multiple languages, especially when used with aliases.
linkmaster03
Limited User
 
Posts: 3
Joined: Mon Mar 09, 2009 9:56 pm

Re: Specify lexer from terminal

Postby cody » Tue Mar 10, 2009 1:51 am

Hello,

This could be interesting.

Editra should be able to detect the filetype automatically in most cases when opening a file from the command line, but this could be useful for files with non standard extensions and for opening new files.


Cody
User avatar
cody
Site Admin
 
Posts: 1315
Joined: Mon Oct 09, 2006 2:49 am
Location: United States

Re: Specify lexer from terminal

Postby linkmaster03 » Tue Mar 10, 2009 6:26 pm

Yes, I am mostly talking about new files. Having to change it manually in the GUI every time you want to start a new file in a language other than the default lexer can be annoying.

(I was surprised by such a quick response! :D)
linkmaster03
Limited User
 
Posts: 3
Joined: Mon Mar 09, 2009 9:56 pm

Re: Specify lexer from terminal

Postby cody » Tue Mar 10, 2009 7:17 pm

Yes,

I agree that this feature is useful and I have no argument against adding it,

But for example if you you start a new file like

Code: Select all
Editra myfile.cpp myfile2.pl


Editra should start two new buffers (files) one in Cpp mode and another in Perl mode. Does this not happen?

Just starting Editra

Code: Select all
Editra


Will start a blank untitled / untyped buffer. In the preferences you can set the Default Lexer to be used in this case, but it only allows for one default lexer to be set.

Another way is to just save the file after your start it with a know file extension (also configurable in preferences dialog). Then the lexer will automatically be set based on that extension.


Cody
User avatar
cody
Site Admin
 
Posts: 1315
Joined: Mon Oct 09, 2006 2:49 am
Location: United States

Re: Specify lexer from terminal

Postby linkmaster03 » Tue Mar 10, 2009 9:17 pm

Yes, running Editra with "editra prog.cpp" does start it in C++ mode.
linkmaster03
Limited User
 
Posts: 3
Joined: Mon Mar 09, 2009 9:56 pm


Return to Feature Requests

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

cron