1
0
mirror of https://git.decapod.one/brethil/dotfiles synced 2024-11-24 12:31:31 +01:00
dotfiles/README.md

142 lines
6.0 KiB
Markdown
Raw Normal View History

2020-12-05 15:38:52 +01:00
# brethil's dotfiles
A set of zsh dotfiles based on antibody and oh-my-zsh
## Description
├── README.md
├──────── Main files ────────
│ ├── aliases.sh
2020-12-06 02:29:30 +01:00
│ │     └── aliases definitions (sources `~/.dotfiles_aliases`)
2020-12-05 15:38:52 +01:00
│ ├── colors.sh
2020-12-06 02:29:30 +01:00
│ │     └── ANSI color escapes
2020-12-05 15:38:52 +01:00
│ ├── functions.sh
2020-12-06 02:29:30 +01:00
│ │     └── contains function definitions (sources `~/.dotfiles_functions`)
│ ├── ansible
│ │     └── ansible playboooks/config
2020-12-06 02:29:30 +01:00
│ └── brethil_dotfile.sh:
      └── This file should be sourced by your `.zshrc`
2020-12-05 15:38:52 +01:00
├──────── antibody plugins ────────
│ ├── antibody_plugins_arch.txt
│ └── antibody_plugins.txt
├──────── oh-my-zsh themes ────────
│ ├── brethil.zsh-theme
│ └── brethil-minimal.zsh-theme
├──────── Misc rc files────────
│ ├── gitconfig
2020-12-06 02:29:30 +01:00
│ │     └── git configuration
2020-12-05 15:38:52 +01:00
│ ├── ackrc
2020-12-06 02:29:30 +01:00
│ │     └── `ack`'s rc: a grep-like text finder
2020-12-05 15:38:52 +01:00
│ ├── ipython
2020-12-06 02:29:30 +01:00
│ │     ├── profile_default
│ │     ├── ipython_config.py
│ │     ├── startup
│ │     ├── 11-autoreload.py
│ │     └── README
│ ├── vim
│ │    ├── vimrc
│ │    │ └── main vim rc
│ │    ├── plugs.vim
│ │    │ └── plugins to be installed with vim-plug
│ │    ├── plugins_config.vim
│ │    │ └── plugins configuration
│ │    ├── shortcuts.vim
│ │    │ └── vim shortcuts definitions
│ │    ├── functions.vim
│ │    │ └── miscellaneous vim function
│ │    └── twilight256.vim
│ │      └── an old colorscheme
2020-12-05 15:38:52 +01:00
│ └── pdbrc.py
2020-12-06 02:29:30 +01:00
     └── pdb++'s rc (a drop-in replacement for pdb)
2020-12-05 15:38:52 +01:00
├──────── Other ─────────────
├── check_for_update.sh
2020-12-06 02:29:30 +01:00
     └── selfupdate script
2020-12-05 15:38:52 +01:00
└── useful_commands
## Installation
With ansible:
```bash
[ bash dev/add_community.general.sh ] # if community.general is not installed
ansible-playbook -v -i <hosts file> [-e fix_annoyances=true] ansible/playbooks/setup.yml
```
[use this with a docker container](dev/README.md)
Use `-e fix_annoyances=true` to fix some small annoyances (only run once)
Manually (this only installs the zsh configuration):
```bash
2020-12-05 15:38:52 +01:00
git clone https://git.decapod.one/brethil/dotfiles ~/.dotfiles
echo 'DOTFILES=~/.dotfiles' >> ~/.zshrc
echo 'source $DOTFILES/brethil_dotfile.sh'
```
2017-06-12 16:22:05 +02:00
2020-12-05 15:38:52 +01:00
A self-update mechanism is included. It asks for confirmation to pull the latest changes
from the git repo every two weeks. This also updates the git-sourced repositories installed
by the install script. The self-update routine can be called manually by calling
2017-06-12 16:22:05 +02:00
2020-12-05 15:38:52 +01:00
dotfiles_selfupdate
2017-06-12 16:22:05 +02:00
2020-12-05 15:38:52 +01:00
If you do not want to run the installer script, you can just add source `brethil_dotfile.sh`
in your `.zshrc`. This requires antibody installed.
2017-06-12 16:22:05 +02:00
2020-12-05 15:38:52 +01:00
### Available Functions
0. `cheat`: show cheat sheet for commands using cheat.sh (`cheat <commandname>`)
1. Quickly edit/reload profile (`esource`/`resource`)
2. `dockertags` list all tags for a given docker image
3. `color` to print colored text (see 3. in the Misc section):
color $Red "This will be printed in red"
color $Yellow "This will be printed in red"
4. `mecp` to copy files back to the machine from wich you are ssh-ing.
For this to work an ssh tunnel with `Remoteforward` is needed:
ssh -R 22:localhost:2222 YOURHOSTNAMEHERE
or specify this in `~/.ssh/config` for a persistent configuration:
Host YOURHOSTNAMEHERE
Remoteforward 2222 localhost:22
This can be enabled in `~/.ssh/config` globally for all hosts by uncommenting the relevant `Host * Remoteforward`.
You might have to manually edit the username in the `mecp` definition in `functions.sh` if this is
different between the two machines. `mecp` copies by default on the local machine on `~/Desktop/`
5. Many more. Use `list_functions` to list defined functions and a small description
### Files/Folders
2020-02-14 16:37:44 +01:00
1. `~/bin`, `~/git`, `~/projects` folders
2017-06-12 16:22:05 +02:00
2. ssh config (`~/.ssh/config`):
2020-12-05 15:38:52 +01:00
- Create ssh keys if not defined already
- Keep connections alive by increasing timeout time
- Include multiplexer to allow quick multiple connections to the same host
- (Optional: Compression, this should allow more responsive shells with slow connections,
but will slow things down when copying large files. My suggestion is to have compression enabled
on a by-host basis in `~/.ssh/config`)
3. `brethil.zsh-theme`, `brethil-minimal.zsh-themes`, themes for oh-my-zsh,
symlinked in `$ZSH/custom/themes` (`$ZSH=~/.oh-my-zsh`)
4. `~/.dotfiles_functions`, `~/.dotfiles_aliases` are sourced by this dotfiles, allowing for custom functions/aliases
2017-06-12 16:22:05 +02:00
5. useful_commands contains a list of useful commands (the first rule of the tautology club...)
2020-12-05 15:38:52 +01:00
### Misc
1. Colored output (via `grc`) for several commands.
2. Easy names for ANSI color escapes (Black, Red, Green, Yellow, Blue, Cyan, Purple, White, CLEAR), for example:
2017-06-12 16:22:05 +02:00
2020-12-05 15:38:52 +01:00
echo -e "${Green}This text will be green${CLEAR}"
2020-02-14 16:37:45 +01:00
2020-12-05 15:38:52 +01:00
will result in green text. Use `$CLEAR` to clear previous escape sequences add B before the variable (check `colors.sh`)
name to use **bold** and U to underline (examples: `$BRed`, `$UBlack` for bold red and underlined black)
2020-02-14 16:37:45 +01:00
2020-12-05 15:38:52 +01:00
3. Autoupdate script running every two weeks, autoupdate function: `dotfiles_selfupdate` (or `git pull` from `$DOTFILES`folder)
4. Automatic fix of the`SSH_AUTH_SOCK`environment variable:`~/.ssh/rc` is installed run on every ssh login,
and updates a symlink pointing (`~/.ssh/ssh_auth_sock`). `SSH_AUTH_SOCK`points to this (set in`brethil_dotfile.sh`).
The idea is that if the user is logging in using `ssh -A`, and using tmux, it will be possible to use
the remote socket over different sessions by always using the symlink.