dotfiles add

This commit is contained in:
Maksim Totmin
2022-05-08 17:02:59 +07:00
parent 49a51849e0
commit 3bfa324d00
26 changed files with 1241 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
#!/bin/zsh
# ALIASES
alias df='df -l -H'
alias ls='ls_extended'
alias sn='sncli -c ~/.config/sncli/snclirc'
alias neofetch='neofetch --config ~/.config/neofetch/matbook.conf'
alias sirot='pacman -Qdt && sudo pacman -Rs $(pacman -Qtdq)'
alias swayconf='vim ~/.config/sway/config'
+42
View File
@@ -0,0 +1,42 @@
#!/bin/zsh
# АРХИВЫ
unpack() {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.tar.xz) tar xf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*) echo "$fg_bold[red]Ошибка:$reset_color Невозможно распаковать '$1'..." ;;
esac
else
echo "$fg_bold[red]Ошибка:$reset_color '$1' - неподдерживаемый тип файла"
fi
}
pack() {
if [ $1 ] ; then
case $1 in
tbz) tar cjvf $2.tar.bz2 $2 ;;
tgz) tar czvf $2.tar.gz $2 ;;
tar) tar cpvf $2.tar $2 ;;
bz2) bzip $2 ;;
gz) gzip -c -9 -n $2 > $2.gz ;;
zip) zip -r $2.zip $2 ;;
7z) 7z a $2.7z $2 ;;
*) echo "$fg_bold[red]Ошибка:$reset_color '$1' не может быть упакован через pack()" ;;
esac
else
echo "$fg_bold[red]Ошибка:$reset_color '$1' - неподдерживаемый тип файла"
fi
}
+11
View File
@@ -0,0 +1,11 @@
#!/bin/zsh
#BINDS
bindkey '^[[24~' clear-screen
bindkey "^[OH" beginning-of-line
bindkey "^[OF" end-of-line
bindkey '^[[1;5D' backward-word
bindkey '^[[1;5C' forward-word
bindkey '^R' history-incremental-search-backward
+9
View File
@@ -0,0 +1,9 @@
#!/bin/zsh
#git
autoload -Uz vcs_info
precmd_vcs_info() { vcs_info }
precmd_functions+=( precmd_vcs_info )
setopt prompt_subst
zstyle ':vcs_info:git:*' formats '[ %b]'
+19
View File
@@ -0,0 +1,19 @@
#!/bin/zsh
#HISTORY
##Где хранить историю
HISTFILE=~/.config/zsh-history
##Число команд, сохраняемых в HISTFILE
SAVEHIST=5000
##Чucлo кoмaнд, coxpaняeмыx в сеансе
HISTSIZE=5000
##Игнорировать повторяющиеся команды
setopt HIST_IGNORE_ALL_DUPS
##Игнopupoвать лишние пpoбeлы
setopt HIST_IGNORE_SPACE
##Удалять из файл истории пустые строки
setopt HIST_REDUCE_BLANKS
##время выполнения команд
setopt extended_history
##История становится общей между всеми сессиями
setopt share_history
+11
View File
@@ -0,0 +1,11 @@
#!/bin/zsh
autoload -Uz compinit
compinit
# Completion for kitty
kitty + complete setup zsh | source /dev/stdin
# Kitty aliases
alias icat='kitty +kitten icat'
alias clear='icat --clear && clear'
+36
View File
@@ -0,0 +1,36 @@
#!/bin/zsh
autoload -U colors && colors
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/mat/.local/bin:/usr/bin/core_perl"
export EDITOR="vim"
export MUTT_EDITOR="vim"
export VISUAL="vim"
export VIMINIT="source ~/.config/vim/vimrc"
export SSH_KEY_PATH="~/.ssh/"
export TERM="xterm-kitty"
export TERMINAL="kitty"
export MOZ_ENABLE_WAYLAND=1
#НАВИГАЦИЯ
##авто cd
setopt autocd
setopt extended_glob
##автодополнение TAB
autoload -Uz compinit && compinit
_comp_options+=(globdots)
# Установка-снятие опций шелла
setopt notify globdots correct pushdtohome cdablevars autolist
setopt correctall autocd recexact longlistjobs
setopt autoresume histignoredups pushdsilent noclobber
setopt autopushd pushdminus extendedglob rcquotes mailwarning
unsetopt bgnice autoparamslash
unsetopt nomatch
autoload -Uz bracketed-paste-magic
zle -N bracketed-paste bracketed-paste-magic
autoload -Uz url-quote-magic
zle -N self-insert url-quote-magic
unsetopt nomatch
+5
View File
@@ -0,0 +1,5 @@
#!/bin/zsh
# PROMPTS
PROMPT=%{$fg_bold[blue]%}'[%n][%~]» '%{$reset_color%}
RPROMPT=%{$fg_bold[green]%}\$vcs_info_msg_0_%{$reset_color%}%{$fg_bold[red]%}'[%T]'%{$reset_color%}
+11
View File
@@ -0,0 +1,11 @@
#!/bin/zsh
for conf in ~/.config/zsh/*.zsh; do
source $conf
done
#start sway
if [ "$(tty)" = "/dev/tty1" ]; then
exec sway
fi