[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Nano-devel] tabsizes and indentsizes
From: |
Benno Schulenberg |
Subject: |
[Nano-devel] tabsizes and indentsizes |
Date: |
Sat, 11 Jun 2016 11:17:56 +0200 |
On Fri, Jun 10, 2016, at 03:09, Mike Scalora wrote:
> Right now tabsize is global (from the .nanorc) or overridable by
> session (command line arg) but for me tabsize (and TABTOSPACES and
> indent size) has been more file type and/or project related. CSS files
> are sometimes two column indents with js files 4 column in the same
> project. Some filetypes are tab-to-spaces while others are used with
> tabs by convention.
>
> I've spent a lot of time thinking about tabs and indents while I been
> working on the code to make it more predictable and add undo support.
>
> Proposal:
>
> To allow filetype specific settings in .nanorc for tabsize, indentsize
> & tab-to-spaces:
>
> # global defaults (and for legacy and COLORless support)
> set tabsize 8
> set indentsize 4
No, indentsize has always been the same as tabsize. So the
backward-compatible setting would be:
set indentsize 8
> set tabstospaces
Also here, the default is:
unset tabstospaces
> # syntax specific settings
> syntax "c" "\.[ch]$"
> tabsize 8
> indentsize 4
Is there anyone who uses tabsize != indentsize? Yes, nano does,
but that is a /bad/ example.
Also, we can't set any tabsize or indentsize in any of the example
syntaxes, because they would override what the user has set in
their ~/.nanorc. (with the 'set' command, not with 'extendsyntax').
> I'm not quite sure what the syntax should be for setting tabstospaces
> on/off for a syntax without breaking compatibility.
>
> syntax "html" "\.html$"
> tabstospaces
>
> extendsyntax "css" notabstospaces
Don't know. Don't want to go there.
> For the command line, I've implement a new --indentsize and added
> support to --tabsize to optionally take two values with a comma for
> tabsize,indentsize.
>
> nano -T 8,4 src/text.c
Hm. Two different ways to set indentsize on the command line?
Don't like that.
Benno
--
http://www.fastmail.com - A fast, anti-spam email service.