diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index ff22e71..208c769 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -2,6 +2,7 @@ return { 'nvim-telescope/telescope.nvim', branch = '0.1.x', dependencies = { + 'navarasu/onedark.nvim', 'nvim-lua/plenary.nvim', { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }, }, diff --git a/.config/tmux/plugins.conf b/.config/tmux/plugins.conf index 679836b..802a667 100644 --- a/.config/tmux/plugins.conf +++ b/.config/tmux/plugins.conf @@ -1,5 +1,6 @@ set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-battery' +set -g @plugin 'nhdaly/tmux-better-mouse-mode' # Battery icons set -g @batt_icon_charge_tier8 ' ' @@ -11,6 +12,9 @@ set -g @batt_icon_charge_tier3 ' ' set -g @batt_icon_charge_tier2 ' ' set -g @batt_icon_charge_tier1 '! !' +# better-mouse-mode +set -g @emulate-scroll-for-no-mouse-alternate-buffer "on" + set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.local/share/tmux-plugins' # Run tmux-plugin-manager diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index be16849..7376b97 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -75,7 +75,6 @@ alias .......="cd ../../../../../../" alias rz="exec zsh" alias venv="source src_venv" alias ex="source src_example" -alias cdb="compiledb " alias info="pinfo " alias bat="batcat " alias img="nsxiv " @@ -92,19 +91,22 @@ t() { taskell "${1:-${HOME}/.taskell.md}"; } vims() { vim "$(whereis "$1" | rev | cut -d ' ' -f 1 | rev)"; }; compdef _command vims bc() { unbuffer "$@" | bat; }; compdef _command bc +# compdef +compdef -a '_git; _git-commit' gdc # todo +compdef '_files -g "*.md"' md # git aliases -alias gitignore="cp ${HOME}/.local/share/gitignore-template ./.gitignore" +gl() { git log "$@" | bat }; compdef '_git; _git-log' gl alias gs="git status" alias gc="git commit" alias gca="git commit --amend --no-edit" alias gp="git push" -alias gl="git log" alias ga="git add" alias gck="git checkout" alias gb="git branch" alias gd="git diff" alias gr="git restore" +alias gr="git reset" alias gcl="git clone" alias gds="gd --staged" @@ -113,12 +115,8 @@ alias dc="docker compose" alias docker!="DOCKER_HOST=ssh://docker /usr/bin/docker" alias dc!="docker! compose" -# tmux aliases -tn() { - tmux new-session -s "${1-"$(basename "$(pwd)")"}" -} - - +# tmux stuff +tn() { tmux new-session -s "${1-"$(basename "$(pwd)")"}" } alias ta="tmux a -t" # disable xon controll chars diff --git a/.gitconfig b/.gitconfig index c0715fd..243474d 100644 --- a/.gitconfig +++ b/.gitconfig @@ -1,3 +1,5 @@ +[core] + pager = delta [user] email = me@wzray.ru name = Arthur Khachaturov @@ -5,3 +7,12 @@ defaultBranch = main [commit] gpgsign = true +[interactive] + diffFilter = delta --color-only +[delta] + navigate = true + syntax-theme = OneHalfDark +[merge] + conflictstyle = diff3 +[diff] + colorMoved = default diff --git a/.local/bin/scripts/gdt b/.local/bin/scripts/gdc similarity index 94% rename from .local/bin/scripts/gdt rename to .local/bin/scripts/gdc index b310452..ecb9acb 100755 --- a/.local/bin/scripts/gdt +++ b/.local/bin/scripts/gdc @@ -44,10 +44,10 @@ case "$1" in esac if [ "$#" -lt "1" ]; then - die "Missing commit message!" + die "Missing date!" fi export GIT_AUTHOR_DATE="${date}" export GIT_COMMITTER_DATE="${date}" -git commit -m "$@" +git commit "$@" diff --git a/.local/bin/scripts/md b/.local/bin/scripts/md index 7fb230d..c01dfe8 100755 --- a/.local/bin/scripts/md +++ b/.local/bin/scripts/md @@ -1,6 +1,7 @@ #!/bin/bash : "${1:?Missing filename!}" +[ ! -f "$1" ] && { echo "Wrong filename!" >&2; exit 1; } FILENAME="$(mktemp)" @@ -11,16 +12,18 @@ cleanup() { trap 'cleanup' INT HUP TRAP shift_header() { - read -r line < "$1" - - if [[ "$line" = "# "* ]]; then - echo "---" - echo "title: ${line#"# "}" - echo "---" - tail -n +2 "$1" - else - cat "$1" - fi + local counter=1 + while read -r line; do + (( counter+=1 )) + if [[ "$line" = "# "* ]]; then + echo "---" + echo "title: ${line#"# "}" + echo "---" + tail -n +"$counter" < "$1" + return + fi + done < "$1" + cat "$1" } main() {