My Linux dotfiles.
â–¶ zsh-bench
==> benchmarking login shell of user meinzer1899...
creates_tty=0
has_compsys=0
has_syntax_highlighting=0
has_autosuggestions=0
has_git_prompt=0
first_prompt_lag_ms=26.536
first_command_lag_ms=115.626
command_lag_ms=2.363
input_lag_ms=4.038
exit_time_ms=101.818
Although showing 0
for has_syntax_highlighting
, has_git_prompt
, has_autosuggestions
, has_compsys
,
these are enabled.
- Install git
- Setup WSL
mkdir -p $HOME/.config
(otherwise,.config
is a symlink to$HOME/dotfiles/.config
).- Install zsh and zi
- Install stow, run
stow .
- Install tmux
- difference python pip install <> vs python -m pip install <> https://stackoverflow.com/questions/25749621/whats-the-difference-between-pip-install-and-python-m-pip-install
- https://thelinuxcode.com/python-requirements-txt-file/
apt install python3.XX-venv # (e.g. 10)
Don't upgrade system to use other python version than that available in apt. Can cause other commands (e.g. apt-get) to break.
apt install xclip
https://askubuntu.com/questions/33774/how-do-i-remap-the-caps-lock-and-ctrl-keys#comment1154797_521734 sudo vi /etc/default/keyboard and change XKBOPTIONS="ctrl:nocaps" setxkbmap -option ctrl:nocaps
https://superuser.com/questions/949385/map-capslock-to-control-in-windows-10
Update GuestAdditions after updating VirtualBox via https://help.ubuntu.com/community/VirtualBox/GuestAdditions.
sudo apt-get install virtualbox-guest-additions-iso
- Install nerd font
- on Linux via curl https://github.com/ryanoasis/nerd-fonts?tab=readme-ov-file#option-1-release-archive-download.
- on Windows via downloading zip archive and using Settings -> fonts (move font files into dotted square)
- Install alacritty for Windows.
- Move alacritty.wsl.toml to
%APPDATA%\alacritty
. - map capslock to ctrl: https://superuser.com/questions/949385/map-capslock-to-control-in-windows-10.
- Alternatively, use MS PowerToys to map Ctrl-M as Enter as well. Cannot map Ctrl-J to down (Ctrl-K up, Ctrl-C Esc) because that conflicts with either Linux or Windows shortcuts. In MS PowerToys dashboard, deactivate all other modules that are not needed.
- notifications: https://github.com/Windos/BurntToast, call with
notify-send() { powershell.exe -command New-BurntToastNotification "-Text '${@}'"; }
. Further reading https://stuartleeks.com/posts/wsl-github-cli-windows-notifications-part-1/ and microsoft/WSL#2466.
https://github.com/zsh-users/zsh/blob/master/INSTALL
$ZPFX
: https://wiki.zshell.dev/docs/guides/customization#ZPFX
Install zsh to $HOME/.zi/polaris, where no sudo is needed.
mkdir -p $HOME/.zi/polaris
./configure --prefix=$HOME/.zi/polaris
zi loader is included in dotfiles (.config/zi); if not, see https://wiki.zshell.dev/docs/getting_started/installation => loader.
- https://registerspill.thorstenball.com/p/how-fast-is-your-shell
- https://github.com/unixorn/awesome-zsh-plugins
- https://github.com/bew/dotfiles/tree/main/zsh
- https://github.com/HaleTom/dotfiles/blob/main/zsh/.config/zsh/.zshrc
- https://github.com/mattmc3/zdotdir
- https://github.com/doronbehar/dotfiles/blob/master/.zshrc
- https://github.com/ctrueden/dotfiles/blob/main/zshrc
- https://github.com/itchyny/dotfiles/blob/main/.zshrc
- https://github.com/timtyrrell/dotfiles-chezmoi/blob/master/dot_zshrc
- https://github.com/Freed-Wu/Freed-Wu/blob/main/.zshrc
- https://github.com/kutsan/dotfiles/blob/master/.config/zsh/config/settings.zsh
- https://git.sr.ht/~seirdy/dotfiles/tree/master/.config/shell_common/zsh/zinit.zsh
- https://github.com/callistachang/dots/blob/main/dot_zshrc
- https://github.com/casey/dotfiles/blob/master/etc/zshrc
- https://github.com/agkozak/
- https://github.com/seagle0128/dotfiles/blob/master/.zshrc
https://mywiki.wooledge.org/BashPitfalls
https://mywiki.wooledge.org/BashPitfalls#set_-euo_pipefail recommends against set -e
because of the various pitfalls especially in conditional evaluation and option pipefail
and recommends own error handling instead.
http://redsymbol.net/articles/unofficial-bash-strict-mode/
and http://redsymbol.net/articles/unofficial-bash-strict-mode/#short-circuiting
set -euo pipefail; shopt -s failglob # safe mode
To release resources, use bash exit traps. http://redsymbol.net/articles/bash-exit-traps/
- https://mywiki.wooledge.org/BashFAQ
- https://mywiki.wooledge.org/BashGuide
- https://mywiki.wooledge.org/BashPitfalls
- https://www.gnu.org/software/bash//manual/html_node/The-Shopt-Builtin.html
- https://quickref.me/bash
- https://devhints.io/bash
- https://github.com/gitleaks/gitleaks Protect and discover secrets using Gitleaks 🔑
- https://github.com/stevearc/dotfiles/blob/master/.githelpers
- https://github.com/mathiasbynens/dotfiles/blob/main/.gitconfig
For Ubuntu, this PPA provides the latest stable upstream Git version: https://git-scm.com/download/linux.
Add .gitconfig.local for user private global entries https://git-scm.com/docs/user-manual.html#telling-git-your-name
Add ssh key so that you can push to dotfiles repository with correct user.
In dotfiles repository, change local email to noreply email from Github (preferences, email) https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-email-preferences/setting-your-commit-email-address#setting-your-email-address-for-a-single-repository
ssh keys: ~/.ssh/config specify, which key belongs to which host (https://stackoverflow.com/a/69764024)
🦎 Githooks: per-repo and shared Git hooks with version control and auto update.
interactive git
with the help of fzf
Protect and discover secrets using Gitleaks 🔑
Command-line Git information tool
https://github.com/alacritty/alacritty/blob/master/INSTALL.md
cargo build --release
Windows: download executable
https://github.com/tmux/tmux/wiki/Installing#from-version-control
sh autogen.sh
./configure
make -j$(nproc) && sudo make install
tmux new -s tmux
.tmux.conf:
- https://github.com/sunaku/home/blob/master/.tmux.conf.erb
- https://github.com/doronbehar/.tmux/tree/master
- https://gist.github.com/adibhanna/979461c5f7d906daf24925fbd9b255eb
- https://github.com/mrnugget/dotfiles/blob/master/tmux.conf
Search rust book via cli:
https://github.com/0xhiro/thebook
To auto-accept entry on Enter when searching with CTRL-R, use junegunn/fzf#477 (comment)
Vim Integration: https://github.com/junegunn/fzf/blob/master/README-VIM.md
https://stackoverflow.com/questions/45023363/what-is-docker-io-in-relation-to-docker-ce-and-docker-ee-now-called-mirantis-k https://docs.docker.com/engine/install/ubuntu
docker run --detach -v $(pwd):$(pwd) -w $(pwd) --name <name> image:tag sleep infinity # may does not work, if ENTRYPOINT is set in Dockerfile
docker start <name> # if container with that name already exists
docker exec <name> command # execute command, e.g. via vim-dispatch
docker exec -it <name> /bin/bash # attach interactively
docker stop name # to stop
-
https://github.com/wagoodman analyze image size, vulnerabilities and more
-
https://github.com/kkvh/vim-docker-tools Toolkit for managing docker containers, networks and images in vim.
-
https://github.com/lmapii/cproject Example for a C environment with CMake, Docker, Unity, and GitHub Actions.
-
https://github.com/philips-software/amp-devcontainer/tree/main/.devcontainer/cpp
-
https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
-
https://www.youtube.com/playlist?list=PLrU0uga7kmr0dsc3wWS4TS9mRX0Ue7kn Vim Universe Playlist
-
https://swedishembedded.com/developers/vim-in-minutes Awesome Vim: Modern Guide To A Fully Featured Vim IDE
-
http://vimcasts.org/episodes/search-multiple-files-with-vimgrep/
Important infos about editing .vimrc: https://vi.stackexchange.com/a/7723/30978
- https://github.com/sunaku/.vim/tree/master
- https://github.com/mrnugget/vimconfig/tree/master
- https://github.com/itchyny/dotfiles/blob/main/.vimrc
- https://github.com/mischavandenburg/dotfiles/blob/main/vim/.vimrc
- https://github.com/doronbehar/.config_nvim/tree/master
- https://github.com/habamax/.vim/blob/master/vimrc (vim maintainer)
- https://github.com/mrnugget/vimconfig/blob/master/vimrc
- https://github.com/skywind3000/vim/blob/master/init/unix.vim
- https://github.com/trapd00r/configs/blob/master/vim/vimrc
- https://github.com/suy/configs/blob/master/vimrc
- https://github.com/rhysd/dogfiles/blob/master/vimrc
- https://github.com/fannheyward/init.vim/blob/master/coc-settings.json
- https://github.com/fannheyward/init.vim/blob/master/init.vim
apt install luaX.X libluaX.X-dev luajit
./configure --enable-luainterp=yes
- https://github.com/stepchowfun/toast Containerize your development and continuous integration environments. 🥂
- https://www.docker.com/blog/how-to-setup-your-local-node-js-development-environment-using-docker/
- https://stackoverflow.com/questions/51809181/how-to-run-tmux-inside-a-docker-container
- https://wiki.zshell.dev/ecosystem/packages/usage#statically-linked-hermetic-relocatable-zsh
Login to dev container via ssh; install zsh and copy dotfiles https://github.com/dpetersen/dev-container-base
- https://gitlab.com/smoores/open-devcontainer
- https://stackoverflow.com/questions/72397020/containerizing-vim-with-plugins
- https://github.com/nemanjan00/dev-environment
- https://github.com/esensar/nvim-dev-container
https://github.com/caramelomartins/awesome-linters
https://github.com/iamcco/diagnostic-languageserver/wiki/Linters
All of them are configured via coc-diagnostic. Activate them by mapping the
linter to the desired filetype in coc-settings.json
.
https://github.com/iamcco/coc-diagnostic/blob/master/src/config.ts
volta install bash-language-server
VimL linter https://github.com/Vimjas/vint
https://github.com/hadolint/hadolint
compiler warnings
-
https://github.com/stephenberry/glaze Extremely fast, in memory, JSON and interface library for modern C++
-
https://github.com/HappyCerberus/daily-bite-cpp (especially Modern-only C++ Course) Playlist: Modern C++ Series - Mike Shah
playground HU print chunks 0001'0203'...'0e0f
Reduce execution times of unit tests:
- run CTest in parallel
ctest -j$(nproc)
- use
gtest_add_tests
from https://cmake.org/cmake/help/latest/module/GoogleTest.html - this executes a list of all test cases instead of test executables, which is much faster
Use install-cmake.sh from foonathan to install to /usr/local. May remove "old" cmake versions, check via which -a cmake
.
https://blog.feabhas.com/category/build-systems/ with https://github.com/feabhas/cmake-presets-blog
- https://github.com/madduci/moderncpp-project-template A Modern C++ cross-platform Project Template with CMake, conan (optional), cppcheck (optional) and clang-format (optional)
- https://github.com/filipdutescu/modern-cpp-template A template for modern C++ projects using CMake, Clang-Format, CI, unit testing and more, with support for downstream inclusion.
- https://github.com/TheLartians/Format.cmake Stylize your code! Automatic clang-format and cmake-format targets for CMake.
- https://github.com/intel/cicd-repo-infrastructure
- https://github.com/StableCoder/cmake-scripts
- https://github.com/cpp-best-practices/cmake_template
cmake4vim cmake-language-server
Determine the minimal required CMake version of a project: cmake_min_version
https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
message(STATUS "Address sanitizer enabled")
add_compile_options(-fsanitize=address,undefined)
add_compile_options(-fno-sanitize=signed-integer-overflow)
add_compile_options(-fno-sanitize-recover=all)
add_compile_options(-fno-omit-frame-pointer)
add_link_options(-fsanitize=address,undefined -fuse-ld=gold)
Installation description:
https://apt.llvm.org/ -> Automatic installation script
installs all llvm packages (also clangd, clang-tidy, include-cleaner etc) at /bin
.
Also adds apt.llvm.org to apt package list to automatically get updates.
Need to update alternatives for llvm tools, e.g. clang-format, clangd, clang-tidy, lld.
sudo update-alternatives --install /bin/clang-format clang-format /bin/clang-format-17 20
Cache for clang-tidy static analysis results: https://github.com/matus-chochlik/ctcache/tree/main
https://stackoverflow.com/questions/51582604/how-to-use-cpplint-code-style-checking-with-cmake
https://github.com/lmapii/run-clang-tidy
https://llvm.org/docs/GettingStarted.html#getting-the-source-code-and-building-llvm
- update .vimrc with comments from https://github.com/nvim-zh/minimal_vim/blob/master/init.vim
- Read series https://jdhao.github.io/2019/03/28/nifty_nvim_techniques_s1/#how-do-we-select-the-current-line-but-not-including-the-newline-character
https://sourceware.org/gdb/current/onlinedocs/gdb.html/index.html
:packadd termdebug
:Termdebug " help Termdebug, :Arguments <args, eg. --gtest_filter=<unquoted regex>
- https://jotavare.github.io/gdb_cheatsheet/
- https://github.com/sharkdp/dbg-macro A dbg(…) macro for C++
- Replace .gdbinit with https://github.com/pwndbg/pwndbg Exploit Development and Reverse Engineering with GDB Made Easy
- https://developers.redhat.com/articles/2021/10/05/printf-style-debugging-using-gdb-part-1#
- https://developers.redhat.com/articles/2021/10/13/printf-style-debugging-using-gdb-part-2#
- https://github.com/mg979/tasks.vim rewrite of asynctasks
- https://github.com/skywind3000/asynctasks.vim
- https://github.com/albertomontesg/lightline-asyncrun
- https://github.com/deathmaz/fzf-lua-asynctasks (neovim)
- https://github.com/voldikss/vim-floaterm#asynctasksvim--asyncrunvim
- https://github.com/skywind3000/vim-terminal-help#integration
- https://github.com/voldikss/coc-extensions/tree/main/packages/coc-tasks
- https://github.com/EthanJWright/vs-tasks.nvim
- https://github.com/yous/dotfiles
- https://github.com/sunaku/home
- https://sunaku.github.io/about.html
- https://github.com/ibhagwan/dots
- https://github.com/hamvocke/dotfiles
- I use stow.
- Manage dotfiles and any git directories interactively with fzf https://github.com/kazhala/dotbare
- https://dotfiles.github.io/
- https://github.com/rhysd/dotfiles
CC="clang" CXX="clang++" LDFLAGS="{LDFLAGS} -fuse-ld=mold" cmake ...
The Laziest Neovim (NeovimConf 2023) | Speed Up Neovim Neovim for Newbs. FREE COURSE The Only Video You Need to Get Started with Neovim The perfect Neovim setup for C++ C++ Coding with Neovim - Prateek Raman - CppCon 2022 Neovim for C++: https://www.youtube.com/watch?v=lsFoZIg-oDs
https://github.com/kristijanhusak/neovim-config
Use FZF instead of telescope
-
https://www.youtube.com/watch?v=stqUbv-5u2s TJ De Vries Effective Neovim: Instant IDE
-
https://codevion.github.io/#!vim/cpp2.md: (Neo)vim for C++ Part 2: CMake, GTest, File Explorer, etc
:mktridactylrc => saves settings to rc (location see below)
https://hackingcpp.com/dev/command_line_tools.html
https://github.com/tummychow/git-absorb
https://github.com/jarun/ddgr with https://github.com/tats/w3m/blob/master/doc/README
Whiteboards with https://tldraw.dev/. https://github.com/casey/just https://github.com/NoahTheDuke/vim-just (Plug 'NoahTheDuke/vim-just', { 'for': 'just' })
- https://zealdocs.org/
- https://cukic.co/2022/04/02/fuzzy-search-documentation/
- https://gitlab.com/ivan-cukic/zeal-lynx-cli
- https://www.ssp.sh/blog/obsidian-note-taking-workflow/
- https://www.ssp.sh/brain/
- https://www.ssp.sh/blog/pkm-workflow-for-a-deeper-life/