Re: [dev] [discussion] editors

2016-10-05 Thread pranomestro
> So, which editor do you use and what features do you need,
> if any?

Mostly sam (the updated fork from https://github.com/deadpixi/sam)
and ed for commit messages.

I can't be bothered with writing an own vi/vis/vim layout for
the keyboard layout I use (neo2).

pranomostro



Re: [dev] [discussion] editors

2016-10-05 Thread Cág

Joseph Graham wrote:


Hi!

I am quite strange because I use both VIM and GNU Emacs. Emacs for 
programming
and VIM for general use (such as typing this email, editing config 
files).


You are quite strange not typing this email with Emacs and Gnus (:

VIM is really hard to use which makes it prestigious. Emacs is not much 
harder

to use than nano.


Wow, I think it's vice versa. I was in trouble remembering which one is
correct: C-x C-c or C-c C-x. Also, customising it seemed really hard
to me.


I personally find syntax highlighting usefull when programming.


I though it was too, but when I understood that I spend more time
looking for a perfect theme than writing code and tried turning it off
for a while, I realised I don't need it. Also, some say it is
distracting.

Cág



Re: [dev] [discussion] editors

2016-10-05 Thread Cág

Ingo Krabbe wrote:


Actually I stopped using vim, when I learned to use plan9. That time,
when I worked from a linux system I used ed, even for bigger projects
and I still think that ed is a very considerable editor, that can do
line numbers any time and any where you want them and yes, for fun.


Quite frankly, I don't understand Plan9 in general and Acme in
particular. I've just tried once again the latest 9front
and things seemed even more counter-intuitive then the previous
time.

I also dislike using mouse/touchpad, unless gaming.
When I moved to keyboard-driven things such as vi, dwm/dmenu/st
(I was using Xfce long before and GNOME even earlier), I tried
switching back but noticed that I tried to cycle windows with
Alt+j/k, destroying them with Ctrl+Alt+x and so on.
Muscle memory, if you want. With mouse you probably can never
reach the productivity of keyboard. Also I see Acme as Emacs of
Plan9.

Cág




Re: [dev] [discussion] editors

2016-10-05 Thread Joseph Graham
On Wed, Oct 05, 2016 at 08:16:21PM +0100, Cág wrote:
> Hi everyone,
> 
> I have been a long-time user of vi-like editors.
> Started with vim+tmux and nerdtree, then threw away tmux
> and nerdtree, then I understood that I don't need syntax
> highlighting and moved to nvi. Now I think line numbers
> are not necessary, too. And sometimes I even write code
> in ed, though mostly for fun.
> 
> So, which editor do you use and what features do you need,
> if any?
>

Hi!

I am quite strange because I use both VIM and GNU Emacs. Emacs for programming
and VIM for general use (such as typing this email, editing config files).

I think Emacs is better overall, but it's just too bloated and slow for normal
use. And it's really embarrasing when I install it on Debian and it drags in 
250MB
of deps.

VIM is really hard to use which makes it prestigious. Emacs is not much harder
to use than nano.

I personally find syntax highlighting usefull when programming.

-Joseph




Re: [dev] [discussion] editors

2016-10-05 Thread Ingo Krabbe
Hey Cág,

yet another editor discussion. Great :D

Actually I stopped using vim, when I learned to use plan9. That time, when I 
worked from a linux system I used ed, even for bigger projects and I still 
think that ed is a very considerable editor, that can do line numbers any time 
and any where you want them and yes, for fun.

In a plan9 vm I used sam that time, because that's even more fun.

But for bigger and distributed projects acme beats them all. Sam and acme are 
both very usefull from a linux system through the plan9port project. The full 
power of seperated namespaces can best be achieved in a real plan9 system, 
though.

Actually I don't want many features from an editor, but to display the code 
text in a readable way. The best thing about ed is, that it is scriptable in a 
very direct manner. just using the commands you write to it, anyway.

Using structural regular expressions is great to do quick edits of big or many 
parts of the code. http://doc.cat-v.org/bell_labs/structural_regexps/se.pdf. 
These are an essential part of sam and acme.

When you edit big projects with many files, acme is a great swiss army knife.

regards,

ingo

> Hi everyone,
> 
> I have been a long-time user of vi-like editors.
> Started with vim+tmux and nerdtree, then threw away tmux
> and nerdtree, then I understood that I don't need syntax
> highlighting and moved to nvi. Now I think line numbers
> are not necessary, too. And sometimes I even write code
> in ed, though mostly for fun.
> 
> So, which editor do you use and what features do you need,
> if any?




[dev] [discussion] editors

2016-10-05 Thread Cág

Hi everyone,

I have been a long-time user of vi-like editors.
Started with vim+tmux and nerdtree, then threw away tmux
and nerdtree, then I understood that I don't need syntax
highlighting and moved to nvi. Now I think line numbers
are not necessary, too. And sometimes I even write code
in ed, though mostly for fun.

So, which editor do you use and what features do you need,
if any?



Re: [dev] Good Morning, and a question about st (italic mode switches color).

2016-10-05 Thread Ingo Krabbe
Actually I neither undestand the joke, nor the setting. For my usage it seems 
best to set both values to 0.

What do you want to achieve with these defaults? For me it just makes 
unmodified manual pages without the described manpager, or LESS_TERMCAP_* 
exports unreadable.

> On Wed, Oct 5, 2016 at 2:19 PM, Lucas Gabriel Vuotto
>  wrote:
>> $ echo '140,146p' | ed config.def.h
>> 20475
>> /*
>>  * Colors used, when the specific fg == defaultfg. So in reverse mode this
>>  * will reverse too. Another logic would only make the simple feature too
>>  * complex.
>>  */
>> static unsigned int defaultitalic = 11;
>> static unsigned int defaultunderline = 7;
> 
> 
> Have a look at xmakeglyphfontspecs and xdrawglyphfontspecs. The
> functions are a mess and too complicated to let me have a better idea,
> so this is clearly a joke.
> Hahahahahahahahahahahahahahaha.
> 
> cheers!
> mar77i




Re: [dev] Good Morning, and a question about st (italic mode switches color).

2016-10-05 Thread Martin Kühne
On Wed, Oct 5, 2016 at 2:19 PM, Lucas Gabriel Vuotto
 wrote:
> $ echo '140,146p' | ed config.def.h
> 20475
> /*
>  * Colors used, when the specific fg == defaultfg. So in reverse mode this
>  * will reverse too. Another logic would only make the simple feature too
>  * complex.
>  */
> static unsigned int defaultitalic = 11;
> static unsigned int defaultunderline = 7;


Have a look at xmakeglyphfontspecs and xdrawglyphfontspecs. The
functions are a mess and too complicated to let me have a better idea,
so this is clearly a joke.
Hahahahahahahahahahahahahahaha.

cheers!
mar77i



Re: [dev] Good Morning, and a question about st (italic mode switches color).

2016-10-05 Thread Lucas Gabriel Vuotto

$ echo '140,146p' | ed config.def.h
20475
/*
 * Colors used, when the specific fg == defaultfg. So in reverse mode this
 * will reverse too. Another logic would only make the simple feature too
 * complex.
 */
static unsigned int defaultitalic = 11;
static unsigned int defaultunderline = 7;

On 05/10/16 08:37, Ingo Krabbe wrote:

Hey suckless developers,

first let me thank you for your great work. dwm and st have become my main 
linux tools as a base to control nearly everything, as long I don't switch to 
my plan9 virtual machine and do things in rc terminals or acme windows.

But today a bug in st burned some hours. So let me tell you the short story: 
The main systems I use have a plain gentoo installed, because that's a good way 
to keep a system up-to-date, once you got familiar with gentoo at all. I'm not 
sure yet if OpenRC is really much better than systemd, though, so if I would 
need to choose today I might switch to a plain debian, that I often use on 
servers.

Gentoo has a little trick to display manual pages, using a 
`MANPAGER=/usr/bin/manpager` command, that is a simple command compiled from 
the attached manpager.c command, which does nothing more then the shell script

LESS_TERMCAP_mb=''   # BLINK [5;31m
LESS_TERMCAP_md=''   # BOLD [1;34m
LESS_TERMCAP_me=''
LESS_TERMCAP_us=''   # UNDERLINE [4;36m
LESS_TERMCAP_ue=''
LESS_TERMCAP_so=''   # ITALIC [3;90m
LESS_TERMCAP_se=''
#export LESS_TERMCAP_{mb,md,me,us,ue,so,se}
exec less

without the _so and _se lines. But I like this italic setup, so I added the 
standout mode.

To do such switches in a more readable, suckless way one should actually use 
tput, imho, to switch the modes and select the colors:

ITALIC_BLACK=`tput sitm; tput setaf 0`

That works with xterm, but with st it selects a yellow color, which is a bit 
disturbing, as I use a light background and I cannot read yellow.

So the basic bug is, that "sitm" (start italic mode) also affects the color. Actually it 
only affects "setaf 0".  Most other colors aren't affected, which you can quick check 
with:

for i in `seq 0 255`
do tput setaf $i
tput sitm
echo -n "Test it!"
tput ritm
echo "Test it!"
done

Maybe thats a problem of the terminfo file. I didn't checked that yet, but 
maybe someone else already had such a problem too, so I wanted to ask first if 
that is considered a bug and if someone might already have a handy solution to 
it.

Actually "tput ncf" says "3", which means that the italic attribute cannot be 
used with colors. But that is a lie. I would say, the italic attribute can only be used with colors.

Best Regards,

Ingo





-- lv.



Re: [dev] Good Morning, and a question about st (italic mode switches color).

2016-10-05 Thread Ingo Krabbe

> Actually "tput ncf" says "3", which means that the italic attribute cannot be 
> used with colors. But that is a lie. I would say, the italic attribute can 
> only be used with colors.

I just found out that ncv=3 (sorry ncv, not ncf) means STANDOUT and REVERSE 
cannot be combined with colors, but that is a lie, too. STANDOUT and REVERSE do 
combine with colors!

For the italic mode, only "setaf 0" fails, so actually the yellow bug should be 
fixed and ncv should be equal 0, I think.

> Best Regards,
> 
> Ingo




Re: [dev] Good Morning, and a question about st (italic mode switches color).

2016-10-05 Thread Martin Kühne
Hi

Try to keep things short.

> I'm not sure yet if OpenRC is really much better than systemd, though, so if 
> I would need to choose today I might switch to a plain debian, that I often 
> use on servers.

We don't need to discuss these things here [0].

> Gentoo has a little trick...

As a matter of fact, Gentoo ha(ck)s a few tricks to the system, which
brought a lot of confusion onto me as well. I don't approve of that
part of Gentoo in particular.
ls colors where green is not associated with an executable bit is
really confusing to work with.

> to display manual pages, using a `MANPAGER=/usr/bin/manpager` command, that 
> is a simple command compiled from the attached manpager.c command, which does 
> nothing more then the shell script
> LESS_TERMCAP_mb=' [5;31m' # BLINK [0m [5;31m
> LESS_TERMCAP_md=' [1;34m' # BOLD [0m [1;34m
> LESS_TERMCAP_me=' [0;0m'
> LESS_TERMCAP_us=' [4;36m' # UNDERLINE [0m [4;36m
> LESS_TERMCAP_ue=' [0;0m'
> LESS_TERMCAP_so=' [3;90m' # ITALIC [0m [3;90m
> LESS_TERMCAP_se=' [0;0m'
> #export LESS_TERMCAP_{mb,md,me,us,ue,so,se}
> exec less
> without the _so and _se lines. But I like this italic setup, so I added the 
> standout mode.

So that's how gentoo gets these colorful manpages. I've been asking myself that.
Good to know Gentoo is really reliable by being unsurprising.

> To do such switches in a more readable, suckless way one should actually use 
> tput, imho, to switch the modes and select the colors:
> ITALIC_BLACK=`tput sitm; tput setaf 0`
> That works with xterm, but with st it selects a yellow color, which is a bit 
> disturbing, as I use a light background and I cannot read yellow. So the 
> basic bug is, that "sitm" (start italic mode) also affects the color. 
> Actually it only affects "setaf 0".  Most other colors aren't affected, which 
> you can quick check with:
> for i in `seq 0 255`
> do tput setaf $i
> tput sitm
> echo -n "Test it!"
> tput ritm
> echo "Test it!"
> done
> Maybe thats a problem of the terminfo file. I didn't checked that yet, but 
> maybe someone else already had such a problem too, so I wanted to ask first 
> if that is considered a bug and if someone might already have a handy 
> solution to it. Actually "tput ncf" says "3", which means that the italic 
> attribute cannot be used with colors. But that is a lie. I would say, the 
> italic attribute can only be used with colors. Best Regards, Ingo

That the italic attribute sets the color itself for not being able to
make itself noticeable in any other way means it can't be used with a
color setting diverging from the color that is used to make it italic.

cheers!
mar77i

[0] https://www.agwa.name/blog/post/how_to_crash_systemd_in_one_tweet



Re: [dev] Good Morning,

2016-10-05 Thread Greg Reagle
On Wed, Oct 5, 2016, at 07:54, Ingo Krabbe wrote:
> Did you load "TERM=st-256color" ?

$ env | grep TERM
TERM=st-256color



Re: [dev] Good Morning,

2016-10-05 Thread Ingo Krabbe
Did you load "TERM=st-256color" ?

> I can confirm that on my system (Debian stable) with the latest st (just
> ran a git pull and rebuilt), that when i is 7, the color changes.
> 
> for i in `seq 0 255`
> do tput setaf $i
> tput sitm
> echo -n $i ": Test it!"
> tput ritm
> echo "Test it!"
> done




Re: [dev] Good Morning, and a question about st (italic mode switches color).

2016-10-05 Thread Greg Reagle
I can confirm that on my system (Debian stable) with the latest st (just
ran a git pull and rebuilt), that when i is 7, the color changes.

for i in `seq 0 255`
do tput setaf $i
tput sitm
echo -n $i ": Test it!"
tput ritm
echo "Test it!"
done



[dev] Good Morning, and a question about st (italic mode switches color).

2016-10-05 Thread Ingo Krabbe
Hey suckless developers,

first let me thank you for your great work. dwm and st have become my main 
linux tools as a base to control nearly everything, as long I don't switch to 
my plan9 virtual machine and do things in rc terminals or acme windows.

But today a bug in st burned some hours. So let me tell you the short story: 
The main systems I use have a plain gentoo installed, because that's a good way 
to keep a system up-to-date, once you got familiar with gentoo at all. I'm not 
sure yet if OpenRC is really much better than systemd, though, so if I would 
need to choose today I might switch to a plain debian, that I often use on 
servers.

Gentoo has a little trick to display manual pages, using a 
`MANPAGER=/usr/bin/manpager` command, that is a simple command compiled from 
the attached manpager.c command, which does nothing more then the shell script

LESS_TERMCAP_mb=''   # BLINK [5;31m
LESS_TERMCAP_md=''   # BOLD [1;34m
LESS_TERMCAP_me=''
LESS_TERMCAP_us=''   # UNDERLINE [4;36m
LESS_TERMCAP_ue=''
LESS_TERMCAP_so=''   # ITALIC [3;90m
LESS_TERMCAP_se=''
#export LESS_TERMCAP_{mb,md,me,us,ue,so,se}
exec less

without the _so and _se lines. But I like this italic setup, so I added the 
standout mode.

To do such switches in a more readable, suckless way one should actually use 
tput, imho, to switch the modes and select the colors:

ITALIC_BLACK=`tput sitm; tput setaf 0`

That works with xterm, but with st it selects a yellow color, which is a bit 
disturbing, as I use a light background and I cannot read yellow.

So the basic bug is, that "sitm" (start italic mode) also affects the color. 
Actually it only affects "setaf 0".  Most other colors aren't affected, which 
you can quick check with:

for i in `seq 0 255`
do tput setaf $i
tput sitm
echo -n "Test it!"
tput ritm
echo "Test it!"
done

Maybe thats a problem of the terminfo file. I didn't checked that yet, but 
maybe someone else already had such a problem too, so I wanted to ask first if 
that is considered a bug and if someone might already have a handy solution to 
it.

Actually "tput ncf" says "3", which means that the italic attribute cannot be 
used with colors. But that is a lie. I would say, the italic attribute can only 
be used with colors.

Best Regards,

Ingo
/*
 * Wrapper to help enable colorized man page output.
 * Only works with PAGER=less
 *
 * https://bugs.gentoo.org/184604
 * 
https://unix.stackexchange.com/questions/108699/documentation-on-less-termcap-variables
 *
 * Copyright 2003-2015 Gentoo Foundation
 * Distributed under the terms of the GNU General Public License v2
 */

#include 
#include 
#include 
#include 

#define COLOR(c, b) "\e[" #c ";" #b "m"

#define _SE(termcap, col) setenv("LESS_TERMCAP_" #termcap, col, 0)
#define SE(termcap, c, b) _SE(termcap, COLOR(c, b))

static int usage(void)
{
puts(
"manpager: display man pages with color!\n"
"\n"
"Usage:\n"
"\texport MANPAGER=manpager\n"
"\tman man\n"
"\n"
"To control the colorization, set these env vars:\n"
"\tLESS_TERMCAP_mb - start blinking\n"
"\tLESS_TERMCAP_md - start bolding\n"
"\tLESS_TERMCAP_me - stop bolding\n"
"\tLESS_TERMCAP_us - start underlining\n"
"\tLESS_TERMCAP_ue - stop underlining\n"
"\tLESS_TERMCAP_so - start standout (reverse video)\n"
"\tLESS_TERMCAP_se - stop standout (reverse video)\n"
"\n"
"You can do so by doing:\n"
"\texport LESS_TERMCAP_md=\"$(printf '\\e[1;36m')\"\n"
"\n"
"Run 'less --help' or 'man less' for more info"
);
return 0;
}

int main(int argc, char *argv[])
{
if (argc == 2 && (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help")))
return usage();

/* Blinking. */
SE(mb, 5, 31);  /* Start. */

/* Bolding. */
SE(md, 1, 34);  /* Start. */
SE(me, 0, 0);   /* Stop. */

/* Underlining. */
SE(us, 4, 36);  /* Start. */
SE(ue, 0, 0);   /* Stop. */

#if 0
/* Standout (reverse video). */
SE(so, 1, 32);  /* Start. */
SE(se, 0, 0);   /* Stop. */
#endif

argv[0] = getenv("PAGER") ? : "less";
execvp(argv[0], argv);
perror("could not launch PAGER");
return 1;
}