points/.README.md

171 lines
3.9 KiB
Markdown
Raw Normal View History

2023-03-23 09:49:43 +01:00
# Bare Git Repository
- https://www.atlassian.com/git/tutorials/dotfiles
- StreakyCobra
## Starting from scratch
```
git init --bare $HOME/.dotfiles
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME'
dotfiles config --local status.showUntrackedFiles no
```
## Install onto a new system
The `checkout` command is expected to fail with a message.
This is because your $HOME folder might already have some stock configuration
files which would be overwritten by Git.
The “BKDIR” part is a rough shortcut to move all the offending files
automatically to a backup folder:
2023-03-23 09:49:43 +01:00
```
git clone --bare <git-repo-url> $HOME/.dotfiles
2023-03-23 09:49:43 +01:00
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME'
dotfiles config --local status.showUntrackedFiles no
BKDIR=".dotfiles-backup/";
dotfiles checkout 2>&1 | egrep "\s+" | awk {'print $1'} |
xargs -I{} sh -c "mkdir -p \$(dirname ${BKDIR}{}); mv -iv {} ${BKDIR}{}";
2023-03-23 09:49:43 +01:00
dotfiles checkout
2023-03-23 09:49:43 +01:00
```
## Install into `/etc/skel`
```
sudo mkdir -p /etc/skel/.dotfiles
sudo chown $(whoami) /etc/skel
git clone --bare $(dotfiles remote -v | head -1 | cut -f2 | cut -f1 -d' ') /etc/skel/.dotfiles
alias skelfiles='/usr/bin/git --git-dir=/etc/skel/.dotfiles --work-tree=/etc/skel'
skelfiles config --local status.showUntrackedFiles no
skelfiles checkout
```
2023-05-05 10:51:56 +02:00
## Useful Commands
- List all tracked files (from CWD):
`dotfiles ls-tree --name-only -rz main | xargs -0 $(whence lsd) -lU`
2023-03-23 09:49:43 +01:00
## Other Tools
```
lazygit --git-dir=$HOME/.dotfiles --work-tree=$HOME
```
2023-06-13 17:28:13 +02:00
# Install remotes as subtree
- https://www.atlassian.com/git/tutorials/git-subtree
- Create an alias for remote repository
- `dotfiles remote add <remote-name> <URL>`
- Import remote as a single commit (squashed)
- `dotfiles subtree add --prefix <target-folder> <remote-name> <branch> --squash
- Note 1: Must be called from $HOME
- Note 2: Do not start <target-folder> with $HOME or ~
2023-04-27 10:49:07 +02:00
# Install recent versions of applications
2023-05-26 10:37:02 +02:00
## Generic Tips
### Github Patches
From [stackoverflow](https://stackoverflow.com/questions/28484186/apply-github-commit-pull-request-as-a-patch).
```
wget https://github.com/jesseduffield/lazygit/pull/2604.patch
git apply --stat --apply 2604.patch
```
## Fonts
- [How to install and manage fonts on Linux](https://linuxconfig.org/how-to-install-and-manage-fonts-on-linux)
- `mv folder ~/.fonts`
- `fc-cache -fv ~/.fonts`
- [JetBrains Mono](https://www.jetbrains.com/lp/mono/)
- Install the files **without “NL”** (i.e No Ligatures) in their names
- [Nerd Fonts](https://www.nerdfonts.com/)
- [Download](https://github.com/ryanoasis/nerd-fonts/tags)
- NerdFontsSymbolsOnly.tar.xz
- [Cheat Sheet](https://www.nerdfonts.com/cheat-sheet)
- https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/bin/scripts/test-fonts.sh
2023-04-27 10:49:07 +02:00
## kitty
- https://sw.kovidgoyal.net/kitty/binary/
```
2023-05-04 17:33:19 +02:00
sudo apt-get install kitty-terminfo
2023-04-27 10:49:07 +02:00
sh ~/.config/kitty/installer.sh
2023-10-04 16:14:42 +02:00
sudo sh ~/.config/kitty/installer.sh launch=n dest=/opt
2023-04-27 10:49:07 +02:00
```
**Note**:
Kitty prepends its _bin_ folder to the path.
So it is more coherent/simpler to copy this behaviour into Zsh.
2023-05-04 17:33:19 +02:00
## lazygit
````
sudo apt install git-delta
````
2023-10-04 16:14:42 +02:00
### Binary Releases
```
LOCATION=$(curl -s https://api.github.com/repos/jesseduffield/lazygit/releases/latest \
| grep "browser_download_url.*Linux_x86_64" \
| awk '{ print $2 }' \
| sed 's/,$//' \
| sed 's/"//g')
echo $LOCATION
wget $LOCATION
tar xf *.tar.gz(om[1])
```
2023-05-26 10:37:02 +02:00
### Go
2023-05-04 17:33:19 +02:00
```
go install github.com/jesseduffield/lazygit@latest
```
2023-05-26 10:37:02 +02:00
### Manual
```
mkdir -p $HOME/dev_3rd/golang
cd $HOME/dev_3rd/golang
2023-05-26 10:37:02 +02:00
git clone https://github.com/jesseduffield/lazygit.git
cd lazygit
go install
```
2023-06-15 13:54:45 +02:00
## neovim
````
sudo apt install libfuse2 xsel
2023-10-09 14:33:29 +02:00
mkdir -p /opt/neovim/bin
cd /opt/neovim/bin
mkdir -p $HOME/.local/bin
2023-06-15 13:54:45 +02:00
cd $HOME/.local/bin
2023-06-15 13:54:45 +02:00
curl -LO https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage
chmod u+x nvim.appimage
ln -sf nvim.appimage nvim
ln -sf nvim.appimage vi
2023-06-15 13:54:45 +02:00
cd $HOME
nvim --version
vi --version
2023-06-15 13:54:45 +02:00
````