Re: Local-to-dir mcedit prefs or quick profiles?

2017-02-21 Thread Mooffie
On 2/20/17, wwp  wrote:
> I'm using mcedit to edit sources in many projects, some of them have
> coding conventions that require [...] and some require [...]
>
> What feature or best practice would you suggest in order to quickly
> switch mcedit settings (general editor options) according to the file
> location?

You can use mc^2 with a simple snippet like this:

ui.Editbox.bind("<>", function(edt)

  if edt.filename and edt.filename:find "/projects/lambda/" then
ui.Editbox.options.tab_size = 4
ui.Editbox.options.expand_tabs = true
  else
ui.Editbox.options.tab_size = 8
ui.Editbox.options.expand_tabs = false
  end

end)

(For documentation, see [1])

(The 'else' case is needed because in MC the editor options are
global, not local to each edit buffer.)

mc^2 also comes with a modeline module (if you decide to use it just
remember to require() it before the snippet above so it doesn't
overwrite your settings).

[1] 
http://www.typo.co.il/~mooffie/mc-lua/docs/html/classes/ui.Editbox.html#ui.Editbox.options
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: Local-to-dir mcedit prefs or quick profiles?

2017-02-20 Thread Andrew Borodin
On Mon, 20 Feb 2017 11:24:48 +0100 (CET) "Yury V. Zaytsev" wrote:
> On Mon, 20 Feb 2017, wwp wrote:
> 
> > What feature or best practice would you suggest in order to quickly 
> > switch mcedit settings (general editor options) according to the file 
> > location? What do you guys do in such situation? (note that I'm using it 
> > for more 15 years, and decide to ask the community about this only now 
> > :-D )
> 
> Maybe we need some limited support for vim / emacs modelines...

https://midnight-commander.org/ticket/3068

-- 
Andrew
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: Local-to-dir mcedit prefs or quick profiles?

2017-02-20 Thread wwp
Hello,


On Mon, 20 Feb 2017 13:32:32 +0300 Andrew Borodin  wrote:

> On Mon, 20 Feb 2017 11:24:48 +0100 (CET) "Yury V. Zaytsev" wrote:
> > On Mon, 20 Feb 2017, wwp wrote:
> >   
> > > What feature or best practice would you suggest in order to quickly 
> > > switch mcedit settings (general editor options) according to the file 
> > > location? What do you guys do in such situation? (note that I'm using it 
> > > for more 15 years, and decide to ask the community about this only now 
> > > :-D )  
> > 
> > Maybe we need some limited support for vim / emacs modelines...  
> 
> https://midnight-commander.org/ticket/3068

I must say that the kate approach is probably less invasive towards the
code (whatever mc could also support vim modelines), source code in
where the use might not find those modelines or not be allowed to put
them into.


Regards,

-- 
wwp


pgpQ3bEQLevl7.pgp
Description: OpenPGP digital signature
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: Local-to-dir mcedit prefs or quick profiles?

2017-02-20 Thread Yury V. Zaytsev

On Mon, 20 Feb 2017, wwp wrote:

What feature or best practice would you suggest in order to quickly 
switch mcedit settings (general editor options) according to the file 
location? What do you guys do in such situation? (note that I'm using it 
for more 15 years, and decide to ask the community about this only now 
:-D )


Maybe we need some limited support for vim / emacs modelines...

--
Sincerely yours,
Yury V. Zaytsev
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Local-to-dir mcedit prefs or quick profiles?

2017-02-20 Thread wwp
Hello there,


I'm using mcedit to edit sources in many projects, some of them have
coding conventions that require the sources format to contain tabs
(8-char wide tabs, 4-char, sometimes 2-) and some require tabs to
be filled w/ spaces instead. mcedit works very well w/ this, but unless
I use separate Unix accounts, I don't see how I could switch general
editor options to match coding conventions (won't change options by
hand every time).

What feature or best practice would you suggest in order to quickly
switch mcedit settings (general editor options) according to the file
location? What do you guys do in such situation? (note that I'm using
it for more 15 years, and decide to ask the community about this only
now :-D )


Regards, 

-- 
wwp


pgp1PxWZRbybj.pgp
Description: OpenPGP digital signature
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc