grml-etc-core.git
2 months agoRelease new version 0.19.7 master v0.19.7
Michael Prokop [Fri, 2 Feb 2024 11:27:58 +0000 (12:27 +0100)]
Release new version 0.19.7

2 months agozshrc: bugfix for _complete_screen_display when using tmux
Bernhard Tittelbach [Thu, 1 Feb 2024 14:23:01 +0000 (15:23 +0100)]
zshrc: bugfix for _complete_screen_display when using tmux

2 months agoMerge remote-tracking branch 'origin/github/pr/156'
Michael Prokop [Mon, 29 Jan 2024 09:40:54 +0000 (10:40 +0100)]
Merge remote-tracking branch 'origin/github/pr/156'

2 months agoetc/skel/.zshrc: set file encoding to UTF8
Michael Prokop [Fri, 26 Jan 2024 15:02:40 +0000 (16:02 +0100)]
etc/skel/.zshrc: set file encoding to UTF8

The file isn't properly encoded and claims to be latin1.
Convert to UTF8 to avoid broken characters in getanchors().

Thanks: flobee for the bug report
Closes: https://github.com/grml/grml-etc-core/issues/155

9 months agoRelease new version 0.19.6 v0.19.6
Michael Prokop [Fri, 30 Jun 2023 10:55:56 +0000 (12:55 +0200)]
Release new version 0.19.6

9 months agoBump Standards-Version to 4.6.2
Michael Prokop [Fri, 30 Jun 2023 10:43:12 +0000 (12:43 +0200)]
Bump Standards-Version to 4.6.2

9 months agoMerge remote-tracking branch 'origin/github/pr/153'
Michael Prokop [Fri, 30 Jun 2023 10:39:53 +0000 (12:39 +0200)]
Merge remote-tracking branch 'origin/github/pr/153'

10 months agoweather: fixed outdated url and test -d
cb [Sat, 17 Jun 2023 23:50:09 +0000 (01:50 +0200)]
weather: fixed outdated url and test -d

11 months agoetc/skel/.zshrc: suggest J as global alias for jq usage
Michael Prokop [Mon, 1 May 2023 17:56:51 +0000 (19:56 +0200)]
etc/skel/.zshrc: suggest J as global alias for jq usage

Thanks: Christopher Bock

16 months agoRelease new version 0.19.5 v0.19.5
Michael Prokop [Fri, 25 Nov 2022 16:12:05 +0000 (17:12 +0100)]
Release new version 0.19.5

16 months agoMerge remote-tracking branch 'origin/github/pr/152'
Michael Prokop [Fri, 25 Nov 2022 14:33:29 +0000 (15:33 +0100)]
Merge remote-tracking branch 'origin/github/pr/152'

16 months agotmux.conf: detect running as tmate and disable non-supported features
Darshaka Pathirana [Fri, 25 Nov 2022 13:39:14 +0000 (14:39 +0100)]
tmux.conf: detect running as tmate and disable non-supported features

tmux versions >=2.3 support the -q option for source-file to suppress
errors for nonexistent files. Even Debian/oldoldstable has tmux v2.3-4,
so this works nice everwhere, *except* for when invoking tmate, which is
a fork based on an old version of tmux, which then complains about:

| /etc/tmux.conf:75: usage: source-file path
| /etc/tmux.conf:36: usage: source-file path

Try to detect tmate from within the environment, and then enable
the configuration only when *not* running from within tmate.

This commit relies on @mika's commit grml/grml-etc-core@71101e0 (the
commit message was shamelessly copied, thx!), but two things changed:

* Use "! (env | grep -q TMUX=/tmp/tmate)" instead of "env | grep -q
  TMUX=/tmp/tmate && false" which always results in false:

  $ true && false; echo $?
  1

* Double escape the semicolon (;) (i.e. \\;).

  Because if bind-key is set up to call multiple commands, each command
  needs to be separated with \;.
  (Each command is terminated by a newline or a semicolon. Commands
  separated by semicolons together form a ‘command sequence’).
  And if bind-key is called within if-shell \; needs to be escaped one
  more time. (No escaping would have been needed when using braces ({}),
  but tmate does not seem to support braces.)

  See: COMMAND PARSING AND EXECUTION + PARSING SYNTAX in man page tmux(1).

Replaces the PR: grml/grml-etc-core#151

18 months agoRelease new version 0.19.4 v0.19.4
Michael Prokop [Mon, 10 Oct 2022 17:00:44 +0000 (19:00 +0200)]
Release new version 0.19.4

18 months agoMerge remote-tracking branch 'origin/github/pr/149'
Michael Prokop [Tue, 4 Oct 2022 06:33:31 +0000 (08:33 +0200)]
Merge remote-tracking branch 'origin/github/pr/149'

18 months agozshrc: run tlog alias with --follow=name
Michael Prokop [Mon, 3 Oct 2022 15:54:59 +0000 (17:54 +0200)]
zshrc: run tlog alias with --follow=name

It's annoying to follow the syslog, but then tools like logroate kicking
in to rename syslog to syslog.1. Then you're stuck with the "old" syslog
file content, by using the --follow=name option we can fix this.

Quoting from tail(1):

| With --follow (-f), tail defaults to following the file descriptor,
| which means that even if a tail'ed file is renamed, tail will continue
| to track its end. This default behavior is not desirable when you really
| want to track the actual name of the file, not the file descriptor
| (e.g., log rotation). Use --follow=name in that case. That causes tail
| to track the named file in a way that accommodates renaming, removal and
| creation.

19 months agoiwconfig zsh completion: replace egrep usage with grep -E
Michael Prokop [Wed, 7 Sep 2022 11:54:43 +0000 (13:54 +0200)]
iwconfig zsh completion: replace egrep usage with grep -E

grep 3.8 deprecated support for egrep + fgrep, and now prints a warning on stderr:

| egrep: warning: egrep is obsolescent; using grep -E
| fgrep: warning: fgrep is obsolescent; using grep -F

19 months agoMerge remote-tracking branch 'origin/github/pr/147'
Michael Prokop [Mon, 5 Sep 2022 08:17:19 +0000 (10:17 +0200)]
Merge remote-tracking branch 'origin/github/pr/147'

19 months agozshrc: fix grmlcomp conditionals, fixup for 220d6ffa
Michael Prokop [Mon, 5 Sep 2022 08:03:37 +0000 (10:03 +0200)]
zshrc: fix grmlcomp conditionals, fixup for 220d6ffa

Thanks, miles170 for reporting

19 months agoMerge remote-tracking branch 'origin/github/pr/145'
Michael Prokop [Mon, 5 Sep 2022 05:45:11 +0000 (07:45 +0200)]
Merge remote-tracking branch 'origin/github/pr/145'

19 months agozshrc: refactor and convert host completion one-liner into multi-line
Michael Prokop [Sun, 4 Sep 2022 09:45:38 +0000 (11:45 +0200)]
zshrc: refactor and convert host completion one-liner into multi-line

This should improve readability and reduce code duplication.

19 months agoMerge remote-tracking branch 'origin/github/pr/144'
Michael Prokop [Sun, 4 Sep 2022 09:38:53 +0000 (11:38 +0200)]
Merge remote-tracking branch 'origin/github/pr/144'

19 months agoFix a typo in `zshrc`
Hanabishi [Sat, 3 Sep 2022 14:18:55 +0000 (19:18 +0500)]
Fix a typo in `zshrc`

20 months agoRelease new version 0.19.3 v0.19.3
Michael Prokop [Wed, 17 Aug 2022 11:22:54 +0000 (13:22 +0200)]
Release new version 0.19.3

2 years agoMerge remote-tracking branch 'origin/github/pr/138'
Michael Prokop [Fri, 25 Mar 2022 15:02:13 +0000 (16:02 +0100)]
Merge remote-tracking branch 'origin/github/pr/138'

2 years agoMerge remote-tracking branch 'origin/github/pr/137'
Michael Prokop [Fri, 25 Mar 2022 14:55:19 +0000 (15:55 +0100)]
Merge remote-tracking branch 'origin/github/pr/137'

2 years agoRelease new version 0.19.2 v0.19.2
Michael Prokop [Mon, 21 Mar 2022 15:22:16 +0000 (16:22 +0100)]
Release new version 0.19.2

2 years agotmux.conf: Add bind-key J to join marked pane to active window
Darshaka Pathirana [Fri, 4 Mar 2022 21:42:15 +0000 (22:42 +0100)]
tmux.conf: Add bind-key J to join marked pane to active window

We have "bind-key j" which joins "the last active pane to the currently
active window". This is cool, if you are able to directly jump to the
window where the pane should go to. Old people like me do not remember
the window (number) where they came from and skim around until they find
the window in question, try to remember the window number, jump back and
forth from window with the needed pane and finally "join the last active
pane to the currently active window".

This is a bit cumbersome, but with "bind-key m" it is possible to
mark the pane in question, skim around until one fine the window where
the pane belongs and "join the marked pane to the currently active
window".

2 years agotmux.conf: source user-specific local conf file ~/.tmux.conf.local
Darshaka Pathirana [Fri, 4 Mar 2022 21:15:54 +0000 (22:15 +0100)]
tmux.conf: source user-specific local conf file ~/.tmux.conf.local

To manage a user-specific local configuration file (like in Grml's
'.vimrc.conf' + '.zshrc.conf') we need to source '~/.tmux.conf.local'.

"bind-key R" (Reload Config) does now reload the 'main" config file
'~/.tmux.conf' and the user-specific local configuration file
'~/.tmux.conf.local'.

With 'source-file -q', no error will be returned if the file does not exist.

2 years agodoc: Error out properly when a generator fails
Frank Terbeck [Tue, 8 Feb 2022 19:50:52 +0000 (20:50 +0100)]
doc: Error out properly when a generator fails

In make only timestamps and return values matter. And the shell will create a
file and update its timestamp when it sees an output redirection. No matter if
the program driving the redirected data fails or not.

So even if the first generator run fails, rerunning make will work, with things
looking like they worked out just fine.

This fixes the issue by running the separate steps toward file generation one
by one.

This issue was brought up by Edward E. (cbrt64 on github) in PR#135 on github¹,
including a proof-of-concept implementation, as well as valuable feedback. This
implementation was derived from it. See the pull-request log for details.

¹ https://github.com/grml/grml-etc-core/pull/135

2 years agoRelease new version 0.19.1 v0.19.1
Michael Prokop [Mon, 24 Jan 2022 15:59:47 +0000 (16:59 +0100)]
Release new version 0.19.1

2 years agoMerge remote-tracking branch 'origin/github/pr/134'
Michael Prokop [Mon, 24 Jan 2022 15:58:15 +0000 (16:58 +0100)]
Merge remote-tracking branch 'origin/github/pr/134'

2 years agozshrc: fix ip command coloring
Pásztor János [Tue, 21 Dec 2021 14:44:18 +0000 (15:44 +0100)]
zshrc: fix ip command coloring

The previous version broke auto-completion. With this fix both of them
are working properly.

2 years agoMerge remote-tracking branch 'origin/github/pr/129'
Michael Prokop [Mon, 6 Dec 2021 16:08:04 +0000 (17:08 +0100)]
Merge remote-tracking branch 'origin/github/pr/129'

2 years agozshrc: ignore hosts set to invalid/loopback addresses for $_etc_hosts
Atrate [Sat, 4 Dec 2021 12:22:12 +0000 (13:22 +0100)]
zshrc: ignore hosts set to invalid/loopback addresses for $_etc_hosts

Signed-off-by: Atrate <Atrate@protonmail.com>
2 years agoMerge remote-tracking branch 'origin/github/pr/133'
Michael Prokop [Fri, 3 Dec 2021 12:24:37 +0000 (13:24 +0100)]
Merge remote-tracking branch 'origin/github/pr/133'

2 years agozshrc: make ip touch interface lo only
Christian Hesse [Fri, 3 Dec 2021 12:19:33 +0000 (13:19 +0100)]
zshrc: make ip touch interface lo only

This reduces cpu cycles, but interface `lo` has to be available
for the check to succeed.

2 years agoMerge remote-tracking branch 'origin/github/pr/130'
Michael Prokop [Fri, 3 Dec 2021 09:21:11 +0000 (10:21 +0100)]
Merge remote-tracking branch 'origin/github/pr/130'

2 years agoMerge remote-tracking branch 'origin/github/pr/132'
Michael Prokop [Mon, 29 Nov 2021 10:33:17 +0000 (11:33 +0100)]
Merge remote-tracking branch 'origin/github/pr/132'

2 years agozshrc: do not unconditionally overwrite $COLORTERM
Michael Prokop [Mon, 29 Nov 2021 09:44:16 +0000 (10:44 +0100)]
zshrc: do not unconditionally overwrite $COLORTERM

Some terminal emulators set COLORTERM=truecolor, do not overwrite those.

Closes: #131

2 years agozshrc: add `NOETCHOSTS` parameter
Roman Volosatovs [Mon, 8 Nov 2021 10:53:59 +0000 (11:53 +0100)]
zshrc: add `NOETCHOSTS` parameter

`/etc/hosts` may be used as a denylist for undesired hosts on some systems.
In such usage scenarios the file may be large in size and parsing it may severely
impact shell startup time.

For example, on a system with `/etc/hosts` from https://github.com/StevenBlack/hosts:

```
% cat profile.zsh
#!/usr/bin/env zsh
zmodload zsh/zprof
source ./etc/zsh/zshrc
zprof
```

```
% ./profile.zsh | head -3
num  calls                time                       self            name
-----------------------------------------------------------------------------------
 1)    1        1181.93  1181.93   87.91%   1181.14  1181.14   87.85%  grmlcomp
```

```
% NOETCHOSTS=1 ./profile.zsh | head -3
num  calls                time                       self            name
-----------------------------------------------------------------------------------
 1)    2          79.77    39.88   47.37%     79.77    39.88   47.37%  compaudit
```

Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
2 years agoMerge remote-tracking branch 'origin/github/pr/127'
Michael Prokop [Mon, 8 Nov 2021 15:39:47 +0000 (16:39 +0100)]
Merge remote-tracking branch 'origin/github/pr/127'

2 years agozshrc: use ip from iproute2 with color support
Christian Hesse [Wed, 27 Oct 2021 16:31:06 +0000 (18:31 +0200)]
zshrc: use ip from iproute2 with color support

Closes #126

2 years agozshrc: support setting title in foot terminal emulator
Michael Prokop [Mon, 4 Oct 2021 16:44:52 +0000 (18:44 +0200)]
zshrc: support setting title in foot terminal emulator

foot is a fast, lightweight and minimalistic Wayland terminal emulator,
see https://codeberg.org/dnkl/foot

Thanks: Alexander Kobel for the patch

2 years agoMerge remote-tracking branch 'origin/github/pr/124'
Michael Prokop [Mon, 23 Aug 2021 08:42:13 +0000 (10:42 +0200)]
Merge remote-tracking branch 'origin/github/pr/124'

2 years agoremove dependency of hostname[ctl]
Bhoppi Chaw [Mon, 23 Aug 2021 03:09:15 +0000 (11:09 +0800)]
remove dependency of hostname[ctl]

2 years agoRelease new version 0.19.0 v0.19.0
Michael Prokop [Fri, 9 Jul 2021 07:13:26 +0000 (09:13 +0200)]
Release new version 0.19.0

2 years agozshrc: no longer set histignorealldups
Michael Prokop [Fri, 9 Jul 2021 05:48:32 +0000 (07:48 +0200)]
zshrc: no longer set histignorealldups

The histignorealldups option provides a feature, that if a new command
line being added to the history list duplicates an older one, the older
command is removed from the list.

Demonstration:

| root@grml ~ # echo foo
| foo
| root@grml ~ # echo bar
| bar
| root@grml ~ # history -E 0
|     1  9.7.2021 07:48  exec zsh
|     2  9.7.2021 07:48  echo foo
|     3  9.7.2021 07:48  echo bar
| root@grml ~ # echo foo
| foo
| root@grml ~ # history -E 0
|     1  9.7.2021 07:48  exec zsh
|     3  9.7.2021 07:48  echo bar
|     5  9.7.2021 07:48  echo foo

This is certainly useful for several people, like in personal setups.
But especially for system administration tasks it's quite essential,
that the history shows "the full truth", and it's hard to reconstruct
the order of commands that have been executed.

Whoever wants to get the old behavior back, can enable `setopt
histignorealldups` in their personal zshrc.  Provide the according
configuration snippet in /etc/skel/.zshrc instead, and update docs
accordingly.

Closes: grml/grml-etc-core#114

2 years agoMerge remote-tracking branch 'origin/github/pr/119'
Michael Prokop [Wed, 19 May 2021 05:21:29 +0000 (07:21 +0200)]
Merge remote-tracking branch 'origin/github/pr/119'

2 years agozshrc: improve sudo-command-line
a-wing [Tue, 18 May 2021 03:02:31 +0000 (11:02 +0800)]
zshrc: improve sudo-command-line

2 years agozshrc: change sudo-command-line switch 'sudo'
a-wing [Mon, 17 May 2021 14:27:51 +0000 (22:27 +0800)]
zshrc: change sudo-command-line switch 'sudo'

fix add 'sudo' plugin zsh-syntax-highlighting error

3 years agoRelease new version 0.18.0 v0.18.0
Michael Prokop [Fri, 22 Jan 2021 12:29:38 +0000 (13:29 +0100)]
Release new version 0.18.0

3 years agoMerge remote-tracking branch 'origin/github/pr/104'
Michael Prokop [Fri, 22 Jan 2021 11:42:23 +0000 (12:42 +0100)]
Merge remote-tracking branch 'origin/github/pr/104'

3 years agoMerge remote-tracking branch 'origin/github/pr/117'
Michael Prokop [Mon, 18 Jan 2021 16:45:48 +0000 (17:45 +0100)]
Merge remote-tracking branch 'origin/github/pr/117'

3 years agozshrc: add lrzip support for simple-extract()
lunik1 [Thu, 14 Jan 2021 17:54:43 +0000 (17:54 +0000)]
zshrc: add lrzip support for simple-extract()

3 years agoREADME.md: use https everywhere + adjust ordering
Michael Prokop [Fri, 4 Dec 2020 10:13:53 +0000 (11:13 +0100)]
README.md: use https everywhere + adjust ordering

Related to https://github.com/grml/grml-etc-core/pull/115

3 years agoMerge remote-tracking branch 'origin/github/pr/115'
Michael Prokop [Fri, 4 Dec 2020 10:02:30 +0000 (11:02 +0100)]
Merge remote-tracking branch 'origin/github/pr/115'

3 years agoREADME.md: Add tmux.conf to the "most important files" list
Darshaka Pathirana [Tue, 27 Oct 2020 10:34:05 +0000 (11:34 +0100)]
README.md: Add tmux.conf to the "most important files" list

3 years agoDon't print messages when a feature can't be loaded
Frank Terbeck [Sun, 27 Sep 2020 15:13:43 +0000 (17:13 +0200)]
Don't print messages when a feature can't be loaded

Instead record the status of the load and make it possible to query the results
later on. With this to replicate the old behaviour you could put:

  grml_status_features -

into your "~/.zshrc.local".

Fixes: #113

3 years agoRelease new version 0.17.4 v0.17.4
Michael Prokop [Fri, 10 Jul 2020 08:53:57 +0000 (10:53 +0200)]
Release new version 0.17.4

3 years agoMerge remote-tracking branch 'origin/github/pr/110'
Michael Prokop [Sat, 4 Jul 2020 08:26:54 +0000 (10:26 +0200)]
Merge remote-tracking branch 'origin/github/pr/110'

3 years agozshrc: set title in alacritty
Simon Bruder [Sat, 4 Jul 2020 07:14:19 +0000 (09:14 +0200)]
zshrc: set title in alacritty

3 years agoMerge remote-tracking branch 'origin/github/pr/109'
Michael Prokop [Sat, 27 Jun 2020 08:45:00 +0000 (10:45 +0200)]
Merge remote-tracking branch 'origin/github/pr/109'

3 years agozshrc: enable transient_rprompt to fix sad-smiley situation in rprompt
Michael Prokop [Fri, 26 Jun 2020 11:38:55 +0000 (13:38 +0200)]
zshrc: enable transient_rprompt to fix sad-smiley situation in rprompt

This feature got lost in commit 08ab5d9, but nobody really noticed
this until we got annoyed by the sad-smiley on the right sight of the
prompt (rprompt) and wanted to disable the smiley overall. :)

But once the transient_rprompt option is active, the annoying
c/p behavior with the sad-smiley no longer exists, while
the feature is still there.

FTR, the rprompt in the grml prompt can be disabled e.g. with:

  zstyle ':prompt:grml:right:setup' use-rprompt false

Thanks: Frank Terbeck
Closes: grml/grml-etc-core#107

3 years agoRelease new version 0.17.3 v0.17.3
Michael Prokop [Wed, 24 Jun 2020 10:33:44 +0000 (12:33 +0200)]
Release new version 0.17.3

3 years agoMerge remote-tracking branch 'origin/github/pr/106'
Michael Prokop [Wed, 24 Jun 2020 10:33:17 +0000 (12:33 +0200)]
Merge remote-tracking branch 'origin/github/pr/106'

3 years agozshrc: add function grml-remote-support
Darshaka Pathirana [Wed, 24 Jun 2020 10:05:05 +0000 (12:05 +0200)]
zshrc: add function grml-remote-support

Provide a simple way to connect to the running Grml system via tmate
by encoding the tmate ssh session in a QR code which can be scanned and
sent to the remote support side.

3 years agoRelease new version 0.17.2 v0.17.2
Michael Prokop [Wed, 3 Jun 2020 14:52:26 +0000 (16:52 +0200)]
Release new version 0.17.2

3 years agoMerge remote-tracking branch 'origin/github/pr/105'
Michael Prokop [Wed, 3 Jun 2020 14:19:44 +0000 (16:19 +0200)]
Merge remote-tracking branch 'origin/github/pr/105'

3 years agozshrc: rely only on `uname -n` for $HOSTNAME handling
Michael Prokop [Wed, 3 Jun 2020 14:00:13 +0000 (16:00 +0200)]
zshrc: rely only on `uname -n` for $HOSTNAME handling

There's no need to invoke `hostname` or `hostnamectl --static`
when `uname -n` is POSIX.

Thanks: Darshaka Pathirana and Chris Hofstaedtler
Closes: grml/grml-etc-core#100

3 years agozshrc: url-quote-magic depends on bracketed-paste-magic since zsh 5.1
Michael Prokop [Wed, 3 Jun 2020 06:42:38 +0000 (08:42 +0200)]
zshrc: url-quote-magic depends on bracketed-paste-magic since zsh 5.1

url-quote with zsh >=5.1 does no longer work as such, it depends
on bracketed-paste-magic to work as it used to do

See https://github.com/zsh-users/zsh/blob/68405f31a043bdd5bf338eb06688ed3e1f740937/README#L38-L45
and https://archive.zhimingwang.org/blog/2015-09-21-zsh-51-and-bracketed-paste.html#update
and https://github.com/sorin-ionescu/prezto/issues/978

Closes: grml/grml-etc-core#85

3 years agoMerge remote-tracking branch 'origin/github/pr/102'
Michael Prokop [Sat, 30 May 2020 07:53:53 +0000 (09:53 +0200)]
Merge remote-tracking branch 'origin/github/pr/102'

3 years agomodified: etc/zsh/zshrc, add zstd support for simple-extract().
ur4t [Sat, 30 May 2020 02:14:29 +0000 (10:14 +0800)]
modified: etc/zsh/zshrc, add zstd support for simple-extract().

3 years agoMerge remote-tracking branch 'origin/github/pr/101'
Michael Prokop [Fri, 29 May 2020 12:20:50 +0000 (14:20 +0200)]
Merge remote-tracking branch 'origin/github/pr/101'

3 years agovimrc: support vim-tiny and older versions of vim
Michael Prokop [Wed, 27 May 2020 11:41:13 +0000 (13:41 +0200)]
vimrc: support vim-tiny and older versions of vim

If vim-tiny is present (lacking +eval feature, see `vim --version`),
then invoking vim fails with:

| Error detected while processing /usr/share/vim/vimrc:
| line   30:
| E319: Sorry, the command is not available in this version: let g:skip_defaults_vim=1

The file /usr/share/vim/vimrc is a symlink to /etc/vim/vimrc:

| % ls -la /usr/share/vim/vimrc
| lrwxrwxrwx 1 root root 14 May 12 02:37 /usr/share/vim/vimrc -> /etc/vim/vimrc

So if the eval feature is missing, don't set skip_defaults_vim=1.

Furthermore, on older vim versions we're failing with:

| Error detected while processing /code/etc/vim/vimrc:
| line   61:
| E474: Invalid argument: display=truncate
| line  201:
| E474: Invalid argument: listchars=eol:$,precedes:«,extends:»,tab:»·,trail:·

The "set display=truncate" only works as of patch-7.4.2115 or newer,
see upstream vim.git commit b9a46fec3e79.

The listchars setting only works when running in utf-8 mode,
by default vim-tiny is running in latin1 though.

Closes: grml/grml-etc-core#99

3 years agoMerge remote-tracking branch 'origin/github/pr/100'
Michael Prokop [Thu, 28 May 2020 09:32:23 +0000 (11:32 +0200)]
Merge remote-tracking branch 'origin/github/pr/100'

3 years agozshenv, zshrc: add fallback to uname for HOSTNAME
Moviuro [Thu, 28 May 2020 09:25:20 +0000 (11:25 +0200)]
zshenv, zshrc: add fallback to uname for HOSTNAME

uname -n is POSIX, and should work when neither hostname(1) nor hostnamectl(1)
exist.
Enhances #97

3 years agoRelease new version 0.17.1 v0.17.1
Michael Prokop [Wed, 27 May 2020 09:21:34 +0000 (11:21 +0200)]
Release new version 0.17.1

3 years agoMerge remote-tracking branch 'origin/github/pr/95'
Michael Prokop [Wed, 27 May 2020 09:14:01 +0000 (11:14 +0200)]
Merge remote-tracking branch 'origin/github/pr/95'

3 years agoMerge remote-tracking branch 'origin/github/pr/97'
Michael Prokop [Wed, 27 May 2020 09:12:38 +0000 (11:12 +0200)]
Merge remote-tracking branch 'origin/github/pr/97'

3 years agoMerge remote-tracking branch 'origin/github/pr/98'
Michael Prokop [Wed, 27 May 2020 09:11:36 +0000 (11:11 +0200)]
Merge remote-tracking branch 'origin/github/pr/98'

3 years agotmux.conf: Fix /etc/tmux.conf:19: unknown key: \\ error message
Darshaka Pathirana [Tue, 26 May 2020 18:28:28 +0000 (20:28 +0200)]
tmux.conf: Fix /etc/tmux.conf:19: unknown key: \\ error message

The previous change (see: c2cbdb01) tried to fix the error
  "unknown key:  confirm-before".

Unfortunately that change only solved the problem for tmux v3.0+.
(Starting a new tmux session and reloading the configuration did not
bring up the error message in the older (<v3.0) tmux versions, so I
wrongly assumed that the change also worked for older versions.)

The changelog ("CHANGES FROM 2.9 to 3.0") states the following:

|  INCOMPATIBLE: tmux's configuration parsing has changed to use yacc(1). There
|  is one incompatible change: a \ on its own must be escaped or quoted as
|  either \\ or '\' (the latter works on older tmux versions).

|  Entirely the same parser is now used for parsing the configuration file
|  and for string commands. This means that constructs previously only
|  available in .tmux.conf, such as %if, can now be used in string commands
|  (for example, those given to if-shell - not commands invoked from the
|  shell, they are still parsed by the shell itself).

This change has been tested (I really hope so!) with the tmux versions
running Debian/jessie (docker), Debian/stretch (docker), Debian/buster
(host system) and Debian/bullseye (Grml daily ISO):

* Debian/jessie: v1.9
* Debian/stretch: v2.3
* Debian/buster: v2.8
* Debian/bullseye: v3.1

Closes (again): grml/grml-etc-core#93

3 years agozshsrc + zshenv: support hostnamectl iff hostname isn't present
Michael Prokop [Tue, 26 May 2020 09:04:40 +0000 (11:04 +0200)]
zshsrc + zshenv: support hostnamectl iff hostname isn't present

The hostname binary doesn't necessarily exist, while hostnamectl
might be available.

Closes: grml/grml-etc-core#96

3 years agoFix darwin battery info field selection
Garrett Holmstrom [Fri, 22 May 2020 06:17:43 +0000 (23:17 -0700)]
Fix darwin battery info field selection

The batterydarwin function looks for the info it wants using field
numbers that are off by one on the current version of Mac OS.  I'm not
sure which version this changed in or what exactly they added (I suspect
it is the battery ID), but this patch makes battery info start working
again.

3 years agoRelease new version 0.17.0 v0.17.0
Michael Prokop [Wed, 20 May 2020 15:25:09 +0000 (17:25 +0200)]
Release new version 0.17.0

3 years agoMerge remote-tracking branch 'origin/github/pr/94'
Michael Prokop [Wed, 20 May 2020 15:22:22 +0000 (17:22 +0200)]
Merge remote-tracking branch 'origin/github/pr/94'

3 years agotmux.conf: Fix unknown key: confirm-before error message
Darshaka Pathirana [Wed, 20 May 2020 14:51:47 +0000 (16:51 +0200)]
tmux.conf: Fix unknown key: confirm-before error message

Quoting the man page tmux(1) of v3.1b:

| Any other characters preceded by \ are replaced by themselves (that is,
| the \ is removed) and are not treated as having any special meaning - so
| for example \; will not mark a command sequence and \$ will not expand
| an environment variable.

and quoting the man page tmux(1) of v2.8:

| Each command should be separated by spaces and a semicolon; commands are
| executed sequentially from left to right and lines ending with a
| backslash continue on to the next line, except when escaped by another
| backslash.  A literal semicolon may be included by escaping it with a
| backslash (for example, when specifying a command sequence to bind-key).

This implies that a backslash should also be escaped by a backslash but
tmux still used to work with the unescaped backslash in older versions.

This change has been tested with the tmux versions running
Debian/jessie, Debian/stretch, Debian/buster and Debian/bullseye
(currently testing):

* Debian/jessie: v1.9
* Debian/stretch: v2.3
* Debian/buster: v2.8
* Debian/bullseye: v3.1

Closes: grml/grml-etc-core#93

3 years agoMerge remote-tracking branch 'origin/github/pr/92'
Michael Prokop [Wed, 20 May 2020 14:24:59 +0000 (16:24 +0200)]
Merge remote-tracking branch 'origin/github/pr/92'

3 years agovimrc: Major rework of the Grml configuration
Darshaka Pathirana [Wed, 20 May 2020 14:02:15 +0000 (16:02 +0200)]
vimrc: Major rework of the Grml configuration

A lot of vimrc configuration options are Grml defaults since the very start of
the project. It is time to clean up as much as possible.

The configuration file (now) clones most of the settings taken from the
defaults.vim file which usually is only loaded if no user vimrc file is found
(see: :help defaults.vim).

The custom Grml configuration was reviewed, fixed and reformatted. The
configuration file should now be more readable and better maintainable.

Include defaults.vim into our Grml configuration:

  We want to take over most of the configuration options defined in
  $VIMRUNTIME/defaults.vim (which is loaded instead the user vimrc file
  (only) if it does not exist / is not found).
  To prevent Vim from loading the defaults.vim again (in case the user
  vimrc file does not exists) we have to set `let g:skip_defaults_vim=1`.

  So we include everything of defaults.vim in our configuration and
  override only single options we do not want. (Currently only `set mouse=`).

  JFTR, in another step we could just source the defaults.vim file and
  override the settings we want to override.

  The background discussion can be found here: https://github.com/grml/grml-etc-core/commit/8cdc0df085211200682699b53e600fcccfe73989

Review and update Grml configuration options. Describe what they do and
why we set them:

'viminfo':

  * Vim default is: `'100,<50,s10,h`
  * `%` means: "When included, save and restore the buffer list. [...] Without
    a number all buffers are stored."
    (Not default, but used to be in our Grml configuration.)
  * `'100` means: "Maximum number of previously edited files for which the
    marks are remembered.
    (Default is `'100`, we should not decrease it to `'50` without reason.)
  * `<100` replaced `\"100`: "Old name of the '<' item, with the disadvantage
    that you need to put a backslash before the ", otherwise it will be recognized
    as the start of a comment!". Means: "Maximum number of lines saved for each
    register."
    (Default is `<50`.)
  * `:100` removed because it shortens the command-line history to 100
    (Default is taken from the option 'history' which defaults to 200 via `defaults.vim`.)
  * `n~/.viminfo` removed because the default name of the viminfo file is
    `"$HOME/.viminfo"` for Unix and OS/2 anyway.
  * `s10` is in Vim default: "Maximum size of an item in Kbyte.  If zero then
    registers are not saved.  Currently only applies to registers.
    (I would not remove the default without a reason.)
  * `h` is Vim default: "Disable the effect of 'hlsearch' when loading the
    viminfo file. When not included, it depends on whether ":nohlsearch" has been
    used since the last search command.
    (Not sure about this option, but I also tend to keep the Vim default.)
  * Source: https://github.com/grml/grml-etc-core/commit/8cdc0df085211200682699b53e600fcccfe73989#r38258350

'linebreak', 'ignorecase':

  * Long lines are not wrapped in the middle of a word.
  * Case is ignored in search patterns.
  * Both seem like good Grml options
  * Source: https://github.com/grml/grml-etc-core/commit/8cdc0df085211200682699b53e600fcccfe73989#r38257095

'comments':

  * Defines how comment lines look like
  * Removed the option because we want to keep the Vim default which includes
    everything the Grml configuration used to have (except for `n:` which made no sense)
  * https://github.com/grml/grml-etc-core/commit/8cdc0df085211200682699b53e600fcccfe73989#r38257448

'dictionary':

  * Used to lookup words for keyword completion with CTRL-X CTRL-K
  * The file '/usr/share/dict/word' does not exist (anymore) so the
    keyword completion was broken.

  | % dpkg -S /usr/share/dict/words
  | diversion by dictionaries-common from: /usr/share/dict/words
  | diversion by dictionaries-common to: /usr/share/dict/words.pre-dictionaries-common
  | wamerican: /usr/share/dict/words

'suffixes':

  * Files with the given suffixes get a lower priority when doing tab completion for file names
  * Vim default is: `.bak,~,.o,.h,.info,.swp,.obj`
  * `.h,.obj` were missing, readded them and changed the order
  * Discussion: https://github.com/grml/grml-etc-core/commit/8cdc0df085211200682699b53e600fcccfe73989#r38258537

'background':

  tl;dr: Removing 'set background=dark' is still a bit controversial
  because it used to "work" and assuming that the user has a dark
  background feels wrong. This setting should go to the personal
  `$HOME/.vimrc[.local]` file.

  Anyway, but it seems like that the Vim background detection
  _sometimes_ does not work so well. *sigh*

  (Vim in the Grml terminal seems to detect the dark background correctly.)

  Quoting the documentation:

  | Vim tries to set the default value according to the terminal used.
  | This will not always be correct.
  | [...]
  | When setting 'background' to the default value with:
  |         :set background&
  | Vim will guess the value.  In the GUI this should work correctly,
  | in other cases Vim might not be able to guess the right value.
  |
  | When the t_RB option is set, Vim will use it to request the background
  | color from the terminal.  If the returned RGB value is dark/light and
  | 'background' is not dark/light, 'background' will be set and the
  | screen is redrawn.  This may have side effects, make t_BG empty in
  | your .vimrc if you suspect this problem.  The response to t_RB can
  | be found in v:termrbgresp.
  | [...]
  | For MS-DOS, Windows and OS/2 the default is "dark".
  | For other systems "dark" is used when 'term' is "linux",
  | "screen.linux", "cygwin" or "putty", or $COLORFGBG suggests a dark
  | background.  Otherwise the default is "light".

  And this it what I observed
  (the current state of the background setting can be queried with ":set background?"):

  * Vim background detection in a **plain** terminal (gnome-terminal) in black-on-white and white-on-black **works**:

    % echo $TERM
    xterm-256color

  * Vim background detection in tmux in a terminal (gnome-terminal) in black-on-white does **not** seem to work:

    % echo $TERM
    screen-256color

  * Vim background detection in GNU/screen in a terminal (gnome-terminal) in black-on-white does **not** seem to work:

    % echo $TERM
    screen.xterm-256color

  Vim was started like this to test the configuration: `vim -c $THIS_VIMRC` (this skips most of the initializations).

  * Discussion: https://github.com/grml/grml-etc-core/commit/8cdc0df085211200682699b53e600fcccfe73989#r38258772

'BufReadPost':

  * When editing a file, always jump to the last known cursor position.
  * This setting was defined twice, decided to keep the default which taken over from defaults.vim
  * Discussion: https://github.com/grml/grml-etc-core/commit/8cdc0df085211200682699b53e600fcccfe73989#r38263223

'mouse':

  * We prefer to disable the mouse usage and use what we're used from older Vim versions.
  * Already defined in this file (overrides the default from defaults.vim)

Put autocommands around the has("autocmd")-block and avoid short name ('au').

And finally make the user aware that using the `$HOME/.vimrc.local` file
might not have the expected result.

Thanks: Michael Prokop (@mika) for the initial work

3 years agoRelease new version 0.16.2 v0.16.2
Michael Prokop [Tue, 12 May 2020 15:10:00 +0000 (17:10 +0200)]
Release new version 0.16.2

3 years agoExecute 'wrap-and-sort -a -t -s' on debian/
Michael Prokop [Tue, 12 May 2020 14:23:10 +0000 (16:23 +0200)]
Execute 'wrap-and-sort -a -t -s' on debian/

This is much better for (code) reviews

3 years agoBump Debian compat version to 12, using debhelper-compat approach
Michael Prokop [Tue, 12 May 2020 14:21:18 +0000 (16:21 +0200)]
Bump Debian compat version to 12, using debhelper-compat approach

Replace dh_clean with dh_prep accordingly.

3 years agoBump Standards-Version to 4.5.0
Michael Prokop [Tue, 12 May 2020 14:20:35 +0000 (16:20 +0200)]
Bump Standards-Version to 4.5.0

3 years agodoc: adjust txt2tags usage for versions >=3.3
Michael Prokop [Tue, 12 May 2020 14:19:33 +0000 (16:19 +0200)]
doc: adjust txt2tags usage for versions >=3.3

1) drop --css-sugar option from txt2tags as it is no longer supported

Quoting from https://sources.debian.org/src/txt2tags/3.4-2/CHANGELOG.md/,
respectively /usr/share/doc/txt2tags/changelog.gz as present in current
Debian/unstable:

| * Always use CSS sugar and drop `--css-sugar` option (Jendrik Seipp).

2) the xhtml target is also gone since v3.3

Quoting the changelog:

| # Version 3.3 (2019-11-04)
|
| * Update html target to HTML5 and drop xhtml target (Jendrik Seipp).

Also see https://github.com/txt2tags/txt2tags regarding v2.7 vs. v3.x

NOTE: the output of txt2tags v2.6-4.1 (as present in Debian/buster) is
not really useable now. We don't depend on txt2tags >=3.4-2 as present
in Debian/unstable though, as we don't use the HTML build output during
the package build.

4 years agoMerge remote-tracking branch 'origin/github/pr/87'
Michael Prokop [Fri, 15 Nov 2019 16:47:40 +0000 (17:47 +0100)]
Merge remote-tracking branch 'origin/github/pr/87'

4 years agozshrc: support PAGER='less -Mr' usage and fall back to vi if LESSOPEN is unset
Michael Prokop [Thu, 14 Nov 2019 15:31:21 +0000 (16:31 +0100)]
zshrc: support PAGER='less -Mr' usage and fall back to vi if LESSOPEN is unset

It's horribly annoying when PAGER is set to less, but lesspipe isn't configured
via LESSOPEN, then `dchange $package` fails with less like this:

% dchange zsh
"/usr/share/doc/zsh/changelog.Debian.gz" may be a binary file.  See it anyway?

vi(m) handles *.gz just fine, so let's try to use vi if PAGER is set to
less and LESSOPEN is unset.

While at it fix usage of ${PAGER} vs ${=PAGER} to also handle
a setting like PAGER='less -Mr' and PAGER=(less -Mr), otherwise
failing with `command not found: less -Mr`.

Thanks: András Korn for review and improvement suggestions

4 years agoMerge remote-tracking branch 'origin/github/pr/88'
Michael Prokop [Thu, 14 Nov 2019 16:30:09 +0000 (17:30 +0100)]
Merge remote-tracking branch 'origin/github/pr/88'

4 years agozsh: commit-to-history: keep escaped character
Doan Tran Cong Danh [Thu, 14 Nov 2019 16:05:16 +0000 (23:05 +0700)]
zsh: commit-to-history: keep escaped character

Prior to this change, when committing this line to history

    echo "hello\"world"

zsh will record this line in history instead:

    echo "hello"world"

because the \" is processed by print.

Correct it by print in raw mode.

Signed-off-by: Doan Tran Cong Danh <congdanhqx@gmail.com>
4 years agoRelease new version 0.16.1 v0.16.1
Michael Prokop [Tue, 22 Oct 2019 14:01:44 +0000 (16:01 +0200)]
Release new version 0.16.1

4 years agoMerge remote-tracking branch 'origin/github/pr/82'
Michael Prokop [Wed, 21 Aug 2019 13:54:31 +0000 (15:54 +0200)]
Merge remote-tracking branch 'origin/github/pr/82'

4 years agozshrc: fix urxvt multi-line issue
cantandwont [Mon, 15 Jul 2019 09:42:36 +0000 (19:42 +1000)]
zshrc: fix urxvt multi-line issue

Quoting from #74:

| When running multiline commands in urxvt, parts of the command are re-echoed.
|
| Example:
|
| me@system ~/foo % ls \
| \`> -l
|
| -ltotal 0
| -rw-r--r-- 1 me users 0 Feb 27 20:36 bar1
| -rw-r--r-- 1 me users 0 Feb 27 20:36 bar2
|
| me@system ~/foo %
|
| Note the '-l' be re-echoed in front of 'total'.

Quoting from zshmisc(1):

| preexec
|
|     Executed just after a command has been read and is about to be
|     executed.  If the history mechanism is active (regardless of
|     whether the line was discarded from the  history  buffer),
|     the string that the user typed is passed as the first
|     argument, otherwise it is an empty string.  The actual command
|     that will be executed (including expanded aliases) is passed
|     in two different forms: the second argument is a
|     single-line, size-limited version of the command (with things
|     like function bodies elided); the third argument contains the
|     full text that is being executed.

Closes: #74