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.164
first_command_lag_ms=113.705
command_lag_ms=2.420
input_lag_ms=4.630
exit_time_ms=106.416
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
apt install python3.XX-venv # (e.g. 10)
apt install xclip #zsh-system-clipboard
Don't upgrade system to use other python version than that available in apt. Can cause other commands (e.g. apt-get) to break.
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/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://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
analyze image size, vulnerabilities and more: https://github.com/wagoodman
- https://github.com/StableCoder/docker-build-core
- https://github.com/think-cell/docker
- https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
https://learnvimscriptthehardway.stevelosh.com/
https://github.com/mattmc3/neovim-cheatsheet
-
https://github.com/mischavandenburg/dotfiles/blob/main/vim/.vimrc
-
https://github.com/habamax/.vim/blob/master/vimrc (vim maintainer)
-
https://github.com/skywind3000/vim/blob/master/init/unix.vim
-
https://github.com/fannheyward/init.vim/blob/master/coc-settings.json
-
https://github.com/fannheyward/init.vim/blob/master/init.vim
-
http://vimcasts.org/episodes/search-multiple-files-with-vimgrep/
Important infos about editing .vimrc: https://vi.stackexchange.com/a/7723/30978
apt install luaX.X libluaX.X-dev luajit
./configure --enable-luainterp=yes
- 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
https://github.com/HappyCerberus/daily-bite-cpp (especially Modern-only C++ Course) Playlist: Modern C++ Series - Mike Shah https://akrzemi1.wordpress.com/ https://www.meetingcpp.com/blog/blogroll/
playground HU print chunks 0001'0203'...'0e0f
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/philips-software/amp-devcontainer/tree/main/.devcontainer/cpp
- 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 clang-format, clangd, clang-tidy.
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
:packadd termdebug
:Termdebug
- 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://www.dannyadam.com/blog/2019/05/debugging-in-vim/
- https://gabriellesc.github.io/teaching/resources/GDB-cheat-sheet.pdf
- 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
- 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
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' })