[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    Re: A doubt on language-specific indentation settings
From:       Miquel_Sabaté <mikisabate () gmail ! com>
Date:       2014-11-24 10:33:52
Message-ID: CAJLXPb69UzExyo4=Agg1X_XpGue2LEEDonjYka1iiiuz6Tdtrw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hello Andrew,

On Mon, Nov 24, 2014 at 11:21 AM, Andrew Udvare <audvare@gmail.com> wrote:

>
> > On 2014-11-24, at 01:46, Miquel Sabat=C3=A9 <mikisabate@gmail.com> wrot=
e:
> >
> > Hi there,
> >
> > Currently we have in KTE the "Open/Save > Modes & Filetypes"
> configuration tab. In there we can edit indentation settings per language
> through the variable editor. This nice but this just works globally as fa=
r
> as I can see. In my case I have a global config for C++ but for a specifi=
c
> project I need another indentation settings. I've tried to write my own
> .kateconfig file in the root of the project., but doing this only updates
> the indentation settings of all the non-C++ files :/
>
> There is no way at this time to specify per-file type rules in .kateconfi=
g
> files. I would love to see this implemented although I am not sure of the
> best way.
>
> Can you live with Kate mode lines in your files? You do have to do it for
> every file that the .kateconfig file (or your Kate settings) does not app=
ly
> to (and they might be annoying to other people). If your .kateconfig is t=
he
> general case (like all C++ files), then maybe you only have a few files t=
o
> add mode lines to? That is generally how I handle it. But it is two-fold:
> have a good default Kate configuration (your preferences), and decide on
> mode lines or .kateconfig for special cases (project specific). One proje=
ct
> I have dictates tabs (which I hate; applies to almost all files), so I us=
e
> a .kateconfig file for that which even keeps them hidden.
>

Nope, adding the mode line in my files is not an option.


>
> .kateconfig can target a directory too, so you can have a base
> configuration at root, another inside, etc:
> root/.kateconfig <-- C++ rules
> root/scripts/.kateconfig <-- Other language rules?
>

I know that. That's what I tried to accomplish: set a .kateconfig for the
root of my project with the indentation settings that I wanted. But it
turned out that the general indentation settings for C++ override any local
.kateconfig that I may have :/

Maybe the best idea would be that in the .kateconfig file we could set
different settings per language and that these settings effectively
override the global settings for each language ? This was my first idea but
I wanted to check if there was an existing solution to this. Another take
on this would be that Kate's project plugin and KDevelop handled this
gracefully for each project, even though I'm not sure how this would work
out :P


>
> I know in some files it is not possible to have to a comment for a mode
> line (package.json comes to mind), so for those you have to rely on Kate
> memorising the settings you placed on that specific file path which is at
> ~/.kde4/share/apps/kate/metainfos for me.
>
> Andrew
> _______________________________________________
> KWrite-Devel mailing list
> KWrite-Devel@kde.org
> https://mail.kde.org/mailman/listinfo/kwrite-devel


Greetings,
Miquel

[Attachment #5 (text/html)]

<div dir="ltr">Hello Andrew,<div class="gmail_extra"><br><div class="gmail_quote">On \
Mon, Nov 24, 2014 at 11:21 AM, Andrew Udvare <span dir="ltr">&lt;<a \
href="mailto:audvare@gmail.com" target="_blank">audvare@gmail.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex"><span class=""><br> &gt; On 2014-11-24, at 01:46, Miquel \
Sabaté &lt;<a href="mailto:mikisabate@gmail.com">mikisabate@gmail.com</a>&gt; \
wrote:<br> &gt;<br>
&gt; Hi there,<br>
&gt;<br>
&gt; Currently we have in KTE the &quot;Open/Save &gt; Modes &amp; Filetypes&quot; \
configuration tab. In there we can edit indentation settings per language through the \
variable editor. This nice but this just works globally as far as I can see. In my \
case I have a global config for C++ but for a specific project I need another \
indentation settings. I&#39;ve tried to write my own .kateconfig file in the root of \
the project., but doing this only updates the indentation settings of all the non-C++ \
files :/<br> <br>
</span>There is no way at this time to specify per-file type rules in .kateconfig \
files. I would love to see this implemented although I am not sure of the best \
way.<br> <br>
Can you live with Kate mode lines in your files? You do have to do it for every file \
that the .kateconfig file (or your Kate settings) does not apply to (and they might \
be annoying to other people). If your .kateconfig is the general case (like all C++ \
files), then maybe you only have a few files to add mode lines to? That is generally \
how I handle it. But it is two-fold: have a good default Kate configuration (your \
preferences), and decide on mode lines or .kateconfig for special cases (project \
specific). One project I have dictates tabs (which I hate; applies to almost all \
files), so I use a .kateconfig file for that which even keeps them \
hidden.<br></blockquote><div><br></div><div>Nope, adding the mode line in my files is \
not an option.</div><div>  </div><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex"> <br>
.kateconfig can target a directory too, so you can have a base configuration at root, \
another inside, etc:<br> root/.kateconfig &lt;-- C++ rules<br>
root/scripts/.kateconfig &lt;-- Other language \
rules?<br></blockquote><div><br></div><div>I know that. That&#39;s what I tried to \
accomplish: set a .kateconfig for the root of my project with the indentation \
settings that I wanted. But it turned out that the general indentation settings for \
C++ override any local .kateconfig that I may have :/</div><div><br></div><div>Maybe \
the best idea would be that in the .kateconfig file we could set different settings \
per language and that these settings effectively override the global settings for \
each language ? This was my first idea but I wanted to check if there was an existing \
solution to this. Another take on this would be that Kate&#39;s project plugin and \
KDevelop handled this gracefully for each project, even though I&#39;m not sure how \
this would work out :P</div><div>  </div><blockquote class="gmail_quote" \
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br>
I know in some files it is not possible to have to a comment for a mode line \
(package.json comes to mind), so for those you have to rely on Kate memorising the \
settings you placed on that specific file path which is at \
~/.kde4/share/apps/kate/metainfos for me.<br> <br>
Andrew<br>
_______________________________________________<br>
KWrite-Devel mailing list<br>
<a href="mailto:KWrite-Devel@kde.org">KWrite-Devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/kwrite-devel" \
target="_blank">https://mail.kde.org/mailman/listinfo/kwrite-devel</a></blockquote><div><br></div><div>Greetings,</div><div>Miquel \
</div></div><br></div></div>



_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic