initial commit

This commit is contained in:
Tri Vo Khac committed 2022-10-06 22:00:37 +07:00
commit a2d4f0ff29
20 files changed
+2721

No files matched your search

+1
View File
@@ -0,0 +1 @@
**/.DS_Store
+23
View File
@@ -0,0 +1,23 @@
# My personal dotfiles
## Requirement
- **GNU** `stow`
## Installation
1. clone repo to your `$HOME` dir
```
cd
git clone git@github.com:vokhactri/.dotfiles.git
```
2. go to repo directory that you've cloned
```
cd .dotfiles
```
2. use `stow` to symlink all configs to `$HOME/.config` dir:
- to symlink for config dirs
```
stow */
```
- to symlink only one config dir, for example `zsh`
```
stow zsh
```
+2
View File
@@ -0,0 +1,2 @@
[init]
defaultBranch = main
Binary file not shown.
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,86 @@
#!/bin/sh
export ZDOTDIR=$HOME/.config/zsh
# HISTFILE=~/.zsh_history
setopt appendhistory
# some useful options (man zshoptions)
setopt autocd extendedglob nomatch menucomplete
setopt interactive_comments
stty stop undef # Disable ctrl-s to freeze terminal.
zle_highlight=('paste:none')
# beeping is annoying
unsetopt BEEP
# completions
autoload -Uz compinit
zstyle ':completion:*' menu select
# zstyle ':completion::complete:lsof:*' menu yes select
zmodload zsh/complist
# compinit
_comp_options+=(globdots) # Include hidden files.
autoload -U up-line-or-beginning-search
autoload -U down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
# Colors
autoload -Uz colors && colors
# Useful Functions
source "$ZDOTDIR/zsh-functions"
# Normal files to source
zsh_add_file "zsh-exports"
zsh_add_file "zsh-vim-mode"
zsh_add_file "zsh-aliases"
zsh_add_file "zsh-prompt"
# Plugins
zsh_add_plugin "zsh-users/zsh-autosuggestions"
zsh_add_plugin "zsh-users/zsh-completions"
zsh_add_plugin "zdharma-continuum/fast-syntax-highlighting"
zsh_add_plugin "hlissner/zsh-autopair"
# zsh_add_completion "esc/conda-zsh-completion" false
# For more plugins: https://github.com/unixorn/awesome-zsh-plugins
# More completions https://github.com/zsh-users/zsh-completions
# Key-bindings
bindkey -s '^o' 'ranger^M'
bindkey -s '^f' 'zi^M'
bindkey -s '^s' 'ncdu^M'
# bindkey -s '^n' 'nvim $(fzf)^M'
# bindkey -s '^v' 'nvim\n'
bindkey -s '^z' 'zi^M'
bindkey '^[[P' delete-char
bindkey "^p" up-line-or-beginning-search # Up
bindkey "^n" down-line-or-beginning-search # Down
bindkey "^k" up-line-or-beginning-search # Up
bindkey "^j" down-line-or-beginning-search # Down
bindkey -r "^u"
bindkey -r "^d"
# FZF
# TODO update for mac
[ -f /usr/share/fzf/completion.zsh ] && source /usr/share/fzf/completion.zsh
[ -f /usr/share/fzf/key-bindings.zsh ] && source /usr/share/fzf/key-bindings.zsh
[ -f /usr/share/doc/fzf/examples/completion.zsh ] && source /usr/share/doc/fzf/examples/completion.zsh
[ -f /usr/share/doc/fzf/examples/key-bindings.zsh ] && source /usr/share/doc/fzf/examples/key-bindings.zsh
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
[ -f $ZDOTDIR/completion/_fnm ] && fpath+="$ZDOTDIR/completion/"
# export FZF_DEFAULT_COMMAND='rg --hidden -l ""'
compinit
# Edit line in vim with ctrl-e:
autoload edit-command-line; zle -N edit-command-line
# bindkey '^e' edit-command-line
# Environment variables set everywhere
export EDITOR="nvim"
export TERMINAL="alacritty"
export BROWSER="brave"
# For QT Themes
export QT_QPA_PLATFORMTHEME=qt5ct
+4
View File
@@ -0,0 +1,4 @@
{
"Alt-/": "lua:comment.comment",
"CtrlUnderscore": "lua:comment.comment"
}
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
{}
+74
View File
@@ -0,0 +1,74 @@
add_newline = false
# Replace the "❯" symbol in the prompt with "➜"
[character] # The name of the module we are configuring is "character"
success_symbol = "[➜](bold green)" # The "success_symbol" segment is being set to "➜" with the color "bold green"
[aws]
symbol = " "
[buf]
symbol = " "
[c]
symbol = " "
[conda]
symbol = " "
[dart]
symbol = " "
[directory]
read_only = " "
[docker_context]
symbol = " "
[elixir]
symbol = " "
[elm]
symbol = " "
[git_branch]
symbol = " "
[golang]
symbol = " "
[haskell]
symbol = " "
[hg_branch]
symbol = " "
[java]
symbol = " "
[julia]
symbol = " "
[memory_usage]
symbol = " "
[nim]
symbol = " "
[nix_shell]
symbol = " "
[nodejs]
symbol = " "
[package]
symbol = " "
[python]
symbol = " "
[spack]
symbol = "🅢 "
[rust]
symbol = " "
+102
View File
@@ -0,0 +1,102 @@
# Don't ask for confirmations
#assume_yes = true
# Disable specific steps - same options as the command line flag
disable = ["system", "emacs", "gem", "node", "pip3", "micro"]
# Ignore failures for these steps
#ignore_failures = ["powershell"]
# Run specific steps - same options as the command line flag
#only = ["system", "emacs"]
# Do not ask to retry failed steps (default: false)
#no_retry = true
# Run inside tmux
#run_in_tmux = true
# List of remote machines with Topgrade installed on them
#remote_topgrades = ["toothless", "pi", "parnas"]
# Arguments to pass SSH when upgrading remote systems
#ssh_arguments = "-o ConnectTimeout=2"
# Path to Topgrade executable on remote machines
#remote_topgrade_path = ".cargo/bin/topgrade"
# Arguments to pass tmux when pulling Repositories
#tmux_arguments = "-S /var/tmux.sock"
# Do not set the terminal title
#set_title = false
# Display the time in step titles
# display_time = true
# Cleanup temporary or old files
#cleanup = true
[git]
#max_concurrency = 5
# Additional git repositories to pull
#repos = [
# "~/src/*/",
# "~/.config/something"
#]
# Don't pull the predefined git repos
#pull_predefined = false
# Arguments to pass Git when pulling Repositories
#arguments = "--rebase --autostash"
[composer]
#self_update = true
# Commands to run before anything
[pre_commands]
#"Emacs Snapshot" = "rm -rf ~/.emacs.d/elpa.bak && cp -rl ~/.emacs.d/elpa ~/.emacs.d/elpa.bak"
# Custom commands
[commands]
#"Python Environment" = "~/dev/.env/bin/pip install -i https://pypi.python.org/simple -U --upgrade-strategy eager jupyter"
[brew]
#greedy_cask = true
[linux]
# Arch Package Manager to use. Allowed values: autodetect, trizen, paru, yay, pikaur, pacman.
#arch_package_manager = "pacman"
# Arguments to pass yay (or paru) when updating packages
#yay_arguments = "--nodevel"
#show_arch_news = true
#trizen_arguments = "--devel"
#pikaur_arguments = ""
#enable_tlmgr = true
#emerge_sync_flags = "-q"
#emerge_update_flags = "-uDNa --with-bdeps=y world"
#redhat_distro_sync = false
#rpm_ostree = false
[windows]
# Manually select Windows updates
#accept_all_updates = false
#open_remotes_in_new_terminal = true
# Causes Topgrade to rename itself during the run to allow package managers
# to upgrade it. Use this only if you installed Topgrade by using a package
# manager such as Scoop to Cargo
#self_rename = true
[npm]
# Use sudo if the NPM directory isn't owned by the current user
#use_sudo = true
[firmware]
# Offer to update firmware; if false just check for and display available updates
#upgrade = true
[flatpak]
# Use sudo for updating the system-wide installation
#use_sudo = true
+2
View File
@@ -0,0 +1,2 @@
.zcompdump
plugins/
+2
View File
@@ -0,0 +1,2 @@
# Set PATH, MANPATH, etc., for Homebrew.
eval "$(/opt/homebrew/bin/brew shellenv)"
+16
View File
@@ -0,0 +1,16 @@
ls -a
rm .DS_Store
micro $ZDOTDIR/.zshrc
micro $ZDOTDIR/.zshrc
ls -a
ls -a
.config
ls
zsh-update-plugins
echo $ZDOTDIR
find "$ZDOTDIR/plugins" -type d -exec test -e '{}/.git' ';'
find "$ZDOTDIR/plugins" -type d -exec test -e '{}/.git' ';' -print0
find "$ZDOTDIR/plugins" -type d -exec test -e '{}/.git' ';' -print0 | xargs -I {} -0 git -C {} pull -q
find "$ZDOTDIR/plugins" -type d -exec test -e '{}/.git' ';' -print0 | xargs -I {} -0
find "$ZDOTDIR/plugins" -type d -exec test -e '{}/.git' ';' -print0 | xargs -I {} -0 git -C {} status -q
find "$ZDOTDIR/plugins" -type d -exec test -e '{}/.git' ';' -print0 | xargs -I {} -0 git -C {} status
+82
View File
@@ -0,0 +1,82 @@
#!/bin/sh
export ZDOTDIR=$HOME/.config/zsh
# HISTFILE=~/.zsh_history
setopt appendhistory
# some useful options (man zshoptions)
setopt autocd extendedglob nomatch menucomplete
setopt interactive_comments
stty stop undef # Disable ctrl-s to freeze terminal.
zle_highlight=('paste:none')
# beeping is annoying
unsetopt BEEP
# completions
autoload -Uz compinit
zstyle ':completion:*' menu select
# zstyle ':completion::complete:lsof:*' menu yes select
zmodload zsh/complist
# compinit
_comp_options+=(globdots) # Include hidden files.
autoload -U up-line-or-beginning-search
autoload -U down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
# Colors
autoload -Uz colors && colors
# Useful Functions
source "$ZDOTDIR/zsh-functions"
# Normal files to source
zsh_add_file "zsh-exports"
zsh_add_file "zsh-aliases"
zsh_add_file "zsh-prompt"
# Plugins
zsh_add_plugin "zsh-users/zsh-autosuggestions"
zsh_add_plugin "zsh-users/zsh-completions"
zsh_add_plugin "zdharma-continuum/fast-syntax-highlighting"
zsh_add_plugin "hlissner/zsh-autopair"
# zsh_add_completion "esc/conda-zsh-completion" false
# For more plugins: https://github.com/unixorn/awesome-zsh-plugins
# More completions https://github.com/zsh-users/zsh-completions
# Key-bindings
# bindkey -s '^o' 'ranger^M'
# bindkey -s '^f' 'zi^M'
# bindkey -s '^s' 'ncdu^M'
# bindkey -s '^n' 'nvim $(fzf)^M'
# bindkey -s '^v' 'nvim\n'
# bindkey -s '^z' 'zi^M'
# bindkey '^[[P' delete-char
# bindkey "^p" up-line-or-beginning-search # Up
# bindkey "^n" down-line-or-beginning-search # Down
# bindkey "^k" up-line-or-beginning-search # Up
# bindkey "^j" down-line-or-beginning-search # Down
# bindkey -r "^u"
# bindkey -r "^d"
# FZF
# TODO update for mac
# [ -f /usr/share/fzf/completion.zsh ] && source /usr/share/fzf/completion.zsh
# [ -f /usr/share/fzf/key-bindings.zsh ] && source /usr/share/fzf/key-bindings.zsh
# [ -f /usr/share/doc/fzf/examples/completion.zsh ] && source /usr/share/doc/fzf/examples/completion.zsh
# [ -f /usr/share/doc/fzf/examples/key-bindings.zsh ] && source /usr/share/doc/fzf/examples/key-bindings.zsh
# [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# [ -f $ZDOTDIR/completion/_fnm ] && fpath+="$ZDOTDIR/completion/"
# export FZF_DEFAULT_COMMAND='rg --hidden -l ""'
compinit
# Edit line in vim with ctrl-e:
autoload edit-command-line; zle -N edit-command-line
# bindkey '^e' edit-command-line
# Environment variables set everywhere
export EDITOR="micro"
export TERMINAL="kitty"
export BROWSER="floorp"
+5
View File
@@ -0,0 +1,5 @@
#!/bin/sh
alias zsh-update-plugins="find "$ZDOTDIR/plugins" -type d -exec test -e '{}/.git' ';' -print0 | xargs -I {} -0 git -C {} pull -q"
alias ls="lsd"
alias cat="bat"
+33
View File
@@ -0,0 +1,33 @@
#!/bin/sh
# HISTFILE="$XDG_DATA_HOME"/zsh/history
HISTSIZE=1000000
SAVEHIST=1000000
export PATH="$HOME/.local/bin":$PATH
export MANPAGER='nvim +Man!'
export MANWIDTH=999
# export PATH=$HOME/.cargo/bin:$PATH
# export PATH=$HOME/.local/share/go/bin:$PATH
# export GOPATH=$HOME/.local/share/go
# export PATH=$HOME/.fnm:$PATH
# export PATH="$HOME/.local/share/neovim/bin":$PATH
#export PATH="$PATH:./node_modules/.bin"
# eval "$(fnm env)"
eval "$(zoxide init zsh)"
# eval "`pip completion --zsh`"
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
# __conda_setup="$("$HOME/.miniconda/bin/conda" 'shell.zsh' 'hook' 2> /dev/null)"
# if [ $? -eq 0 ]; then
# eval "$__conda_setup"
# else
# if [ -f "$HOME/.miniconda/etc/profile.d/conda.sh" ]; then
# . "$HOME/.miniconda/etc/profile.d/conda.sh"
# else
# export PATH="$HOME/.miniconda/bin:$PATH"
# fi
# fi
# unset __conda_setup
# <<< conda initialize <<<
+37
View File
@@ -0,0 +1,37 @@
# Function to source files if they exist
function zsh_add_file() {
[ -f "$ZDOTDIR/$1" ] && source "$ZDOTDIR/$1"
}
function zsh_add_plugin() {
PLUGIN_NAME=$(echo $1 | cut -d "/" -f 2)
if [ -d "$ZDOTDIR/plugins/$PLUGIN_NAME" ]; then
# For plugins
zsh_add_file "plugins/$PLUGIN_NAME/$PLUGIN_NAME.plugin.zsh" || \
zsh_add_file "plugins/$PLUGIN_NAME/$PLUGIN_NAME.zsh"
else
git clone "https://github.com/$1.git" "$ZDOTDIR/plugins/$PLUGIN_NAME"
fi
}
function zsh_add_completion() {
PLUGIN_NAME=$(echo $1 | cut -d "/" -f 2)
if [ -d "$ZDOTDIR/plugins/$PLUGIN_NAME" ]; then
# For completions
completion_file_path=$(ls $ZDOTDIR/plugins/$PLUGIN_NAME/_*)
fpath+="$(dirname "${completion_file_path}")"
zsh_add_file "plugins/$PLUGIN_NAME/$PLUGIN_NAME.plugin.zsh"
else
git clone "https://github.com/$1.git" "$ZDOTDIR/plugins/$PLUGIN_NAME"
fpath+=$(ls $ZDOTDIR/plugins/$PLUGIN_NAME/_*)
[ -f $ZDOTDIR/.zccompdump ] && $ZDOTDIR/.zccompdump
fi
completion_file="$(basename "${completion_file_path}")"
if [ "$2" = true ] && compinit "${completion_file:1}"
}
function mach_java_mode() {
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
}
+9
View File
@@ -0,0 +1,9 @@
#!/bin/sh
STARSHIP_HOME=$HOME/.config/starship
[ ! -d "$STARSHIP_HOME" ] && mkdir -p "$STARSHIP_HOME"
[ ! -f "$STARSHIP_HOME/starship.toml" ] && touch "$STARSHIP_HOME/starship.toml"
export STARSHIP_CONFIG=$STARSHIP_HOME/starship.toml
eval "$(starship init zsh)"
+2
View File
@@ -0,0 +1,2 @@
export ZDOTDIR=~/.config/zsh
[[ -f $ZDOTDIR/.zshenv ]] && . $ZDOTDIR/.zshenv