Commit Graph

35 Commits

Author SHA1 Message Date
ffaef0fd54 *: More XDG environment variables and configs
More configurations of programs that do not follow the XDG Base
directory Standard correctly.
2022-07-12 21:00:11 +02:00
0146956dd4 git:core.pager:,less: Use long flag variants 2022-07-12 20:59:59 +02:00
d5350276dc less: Add --quit-if-one-screen
Before v530 `less` would need the -X flag as well for -F to be useful.
With v530 it does not enter alternate mode if the content fits in one
screen.
2022-07-12 20:59:59 +02:00
1bd7c959e0 zprofile: Fix typo by dropping trailing character 2022-06-23 23:58:30 +02:00
15f4bac670 zprofile: Exit after tmux instead of exec-ing
Instead of exec-ing the tmux process, run it normally and exit
afterwards. Otherwise the zlogout is not read as mentioned a couple of
lines above and in `zsh(1)`:

> However, if the shell terminates due to exec'ing another process, the
> logout files are not read.
2022-06-23 23:56:34 +02:00
3b29820957 zprofile: Use exec when attaching to tmux
When connected over ssh and attaching to/creating a tmux session, the
shell should `exec` the tmux command so that detaching from the session
automatically also closes the ssh connection.

If something should happen and the `tmux` command bricks the remote
shell this can fixed by logging in with:

    ssh [destination] zsh -dfi
2022-06-23 23:55:53 +02:00
0ba0c04c56 zsh: Use $+commands[] instead of command -v 2022-03-31 00:46:46 +02:00
5df9e4d6ee zsh,vim: Add WIP Zettelkasten tooling
Add `zk`, an autoloadable function that creates a new zettel after a
template in the right directory.
Add `zettel` vim ftplugin.
2022-03-28 23:48:51 +02:00
2b02ee50b4 zsh:zprofile: Use $XDG_CONFIG_HOME for tmux config 2022-02-17 15:54:02 +01:00
771232217e zsh:zprofile: Always export $LESS* variables 2022-02-03 18:31:10 +01:00
98e9c8abed less: Display ANSI colors by default 2022-02-03 18:31:00 +01:00
fe16087da4 less: Enable mouse-support 2022-02-03 18:30:59 +01:00
00de841771 zsh:zprofile: Do not set $MANPAGER to nvim
Do not set `MANPAGER` to `nvim` as `nvim-man` is used already and in the
case that it does not open `nvim` I want to use `less` as **pager**.
This makes it possible to use `man -- <page>` as 'hack' to view the page
in `less` for example if a real pager is desired because of the loading
time (e.g. `zshall`).
2022-02-03 18:30:57 +01:00
8c7c37d65b zsh:zprofile: Attach to tmux only when it exists 2021-09-08 13:39:10 +02:00
03835c5d8d zsh:zprofile: Attach to tmux when connected by ssh 2021-07-27 15:33:44 +02:00
0480b98812 meta:install: Create GNUPGHOME if nonexistent
This is more of a one-time step to be done when installing, than every
time on login.
2021-07-07 11:56:57 +02:00
098fb385fd zsh:zprofile: Shorten two statements 2021-06-15 14:43:45 +02:00
57f89d34dc zsh:z{profile,logout}: Kill only 'own' ssh-agent
Kill the ssh-agent only if it was created in this session.

Like that the login shell can inherit SSH_AGENT_PID without it killing
the agent at the end. For this to work properly it is important that
LAUNCHED_SSH_AGENT is not exported, otherwise nested login shells will
mess with each other.
2021-06-15 13:19:29 +02:00
b368b20dee zsh:zprofile: Only start one ssh-agent per session
Also check if ssh-agent is available before launching.
2021-06-15 13:05:36 +02:00
b0db2b22a1 zsh:zprofile: Create GNUPGHOME if nonexistent
`gpg` complains otherwise and falls back to `$HOME/.gnupg`.
2021-06-15 13:04:37 +02:00
1b17c35f4b zsh: Add zlogout to kill ssh-agent
On system where my dotfiles are only partially installed (e.g. only
the shell) for the environment variables defined in the zprofile to take
affect, every terminal instance needs to execute zsh a login-shell.
This lead to numerous instances of the ssh-agent that were not killed
when exiting the shell. As I still need the correct env-vars like
SSH_AGENT_PID in every shell I cannot just pgrep and execute the agent
respectively.

This adds a zlogout that kills the agent spawned in the current shell.
It also stops `exec`ing `startx` as then the zlogout is not read.
2021-04-12 21:01:31 +02:00
fd2c3f611b fzf: Ignore node_modules also without rg 2021-04-12 21:01:30 +02:00
7d085eedd0 zsh,X11: Move ssh-agent from xinitrc to zprofile
As I also want the ssh-agent to run without X.
2021-04-04 10:52:51 +02:00
ed55fc14dc zsh:zprofile: Add /Library/Apple/usr/bin to PATH
When under macos add /Library/Apple/usr/bin to the PATH.
2021-03-10 13:50:05 +01:00
c09033ed21 zsh:zprofile: Add /usr/local/bin to PATH 2021-03-10 13:43:11 +01:00
e71150fa5e repo: Add locale configuration 2021-02-17 03:03:25 +01:00
a440e8b61e zsh: Use dictionary for command existence check
Use the `commands` dictionary from zsh instead of always calling
`command`.

Regex used:
s/command -v \([^ ]*\) &>\/dev\/null/(( $+commands[\1] ))/g
2020-12-28 02:58:46 +01:00
5cf0f7fdf2 zsh: More XDG! 2020-12-19 02:57:45 +01:00
druckdev
4f182e9108 fzf: Use rg instead of find when installed
Use rg as it respects possible gitignores.
2020-11-15 01:20:42 +01:00
druckdev
bf46c5f687 zsh: Divide zshrc into zshrc.d
Move every file from plugins into zshrc.d as well as all bigger blobs in
the zshrc into their own files there.
Some stuff is still in there that I am not all too sure where it
belongs. TODO: Move.

Because all external plugins are now sourced over a symlink I had to
create a fork of fzf-tab for now that supports that.
See: https://github.com/Aloxaf/fzf-tab/pull/153
2020-11-10 02:58:22 +01:00
druckdev
51643beddf fzf: Add DEFAULT_COMMAND and vim :Files mapping
Add FZF_DEFAULT_COMMAND that displays hidden files as well, but ignores
.git directories.
Add :Files mapping in vim. Because it is bound to <leader>f, the leader
key mapping had to be moved to the top of the file.
2020-11-08 03:19:40 +01:00
druckdev
211ef6e047 vscode: Use tabs per default, XDG & gitignore
Use tabs instead of spaces per default. (VSCodium will still respect the
indentation used in the file)
Stop vscode from writing files in HOME.
Since only the settings.json is versioned in this repo but the full
folder is symlinked: Ignore all other files that will be written.
(TODO: Only symlink file)
2020-11-05 14:45:46 +01:00
druckdev
1491c998a3 zsh:profile: More XDG Base Dir env-vars + wgetrc
Use an environment variable and a wgetrc instead of an alias for wget to
enforce the XDG Base Directory Specification so that script calls
respect it too.
2020-11-05 12:37:19 +01:00
druckdev
ec147dfc43 zsh: Move stuff around
Move all environment variables that do not relate directly to zsh but
(in most cases) enforce the XDG Base Directory specification to
zprofile.
This way they are just exported once on login and not every time the
shell starts again.

Move the lines in zshenv that are not directly responsible for moving
the zsh files into $XDG_CONFIG_HOME to their own zshenv there.
2020-11-03 13:59:54 +01:00
druckdev
7b63a148eb zsh: Add zprofile to auto start X on login 2020-10-31 22:34:11 +01:00