Felix Nehrke 9d13d42cbd Add shortcut ":Gc" to vim for simple fast commits
When working in vim I have developed some pattern which fell fast and
confident enough for me to being typed all the time.
E.g. I catch myself often doing typing the following: `:Gw<CR>:G<CR>cc`
These keystrokes safe the current file directly to the staging area of
git (:Gw), then opening the fugitive-panel (:G) and finally letting me
write a commit-message form there (cc).
The keypart here is that I _have_ to open the fugitive-panel to perform
a commit, since I don't use any abbreviation for "commit" on git itself
the only other way is typing `:Gw<CR>:G commit` which is cumbersome.

This change allows me to type just another short version (namely:
`:Gw<CR>:Gc`) which saves 2 keystrokes and a whole panel-rendering.
Though this change is experimental right now since I don't know if I
really get used to it.
2026-01-14 01:21:00 +01:00
2022-02-28 11:46:49 +01:00
2025-11-28 12:08:04 +01:00
2025-11-28 12:08:04 +01:00

Dotfiles

I use stow to sync my dotfiles between the OS and this repository.

Requirements

Install git and stow if not already present on the system.

Install via apt on Debian/Ubuntu
sudo apt install git stow
Install via brew on macos
brew install git stow

Setup and usage

My dev-machine setup will install and setup these dotfiles automatically. So, the only thing Ive to care about is the stow . --adopt command and to commit changes to the VSC.

Checkout this repository into ~/dotfiles and apply run stow to sync the dotfiles.

The directory should be located directly in the HOME directory. Otherwise stow needs an additional flat -t $HOME every time, which is a bit annoying!
git clone git@gitea.nehrke.info:nemoinho/dotfiles.git ~/dotfiles (1)
cd $_
stow --adopt . (2)
[ -n "$(git status --short)" ] && git restore . (3)
1 Clone this repository
2 Create symlinks for all files managed by this repository, so that the file in the $HOME points to the file in this repository
3 In case of differences between existing files and the ones from this repository keep the version of the repository

Removing files

If a file is going to be removed make sure to remove the linked file as well. Otherwise we end up with a bunch of dangling files in $HOME!

To automatically delete these dangling links we can use a git-hook as the following. That will remove the links pre-commit.

Setup git-hook to automatically remove links to deleted files
cat <<EOF > .git/hooks/pre-commit
#!/usr/bin/env bash
set -e
git status --short | grep -E '^D|^R' | sed 's/...//;s/ -> .*//' | while read f
do
  test -L "\$HOME/\$f" && rm "\$HOME/\$f"
done
EOF
chmod +x .git/hooks/pre-commit
Description
No description provided
Readme 1.6 MiB
Languages
Lua 82.9%
Shell 10.6%
Vim Snippet 5.9%
Python 0.6%