From dc9200e7c9d809ae0c668222a261155f4038680e Mon Sep 17 00:00:00 2001 From: TheK4n Date: Sun, 14 May 2023 20:12:01 +0300 Subject: [PATCH] feat(zsh_history), add(etc/skel) --- etc/skel/.bash_profile | 5 +++ etc/skel/.bashrc | 84 +++++++++++++++++++++++++++++++++++++++ etc/skel/.vimrc | 55 +++++++++++++++++++++++++ home/user/.subzsh/history | 2 +- 4 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 etc/skel/.bash_profile create mode 100644 etc/skel/.bashrc create mode 100644 etc/skel/.vimrc diff --git a/etc/skel/.bash_profile b/etc/skel/.bash_profile new file mode 100644 index 0000000..5545f00 --- /dev/null +++ b/etc/skel/.bash_profile @@ -0,0 +1,5 @@ +# +# ~/.bash_profile +# + +[[ -f ~/.bashrc ]] && . ~/.bashrc diff --git a/etc/skel/.bashrc b/etc/skel/.bashrc new file mode 100644 index 0000000..8351072 --- /dev/null +++ b/etc/skel/.bashrc @@ -0,0 +1,84 @@ + +if [ -x "$(which dircolors)" ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + + alias dir='dir --color=auto' + alias vdir='vdir --color=auto' + alias grep='grep --color=auto' + alias egrep='egrep --color=auto' + alias fgrep='fgrep --color=auto' + + alias ls='ls --color=auto' +fi + +# these aliases use the "ls" alias, which was defined earlier +alias l.='ls -AF --ignore="*"' +alias ll='ls -lhF' +alias la='ls -AF' + +alias lt='du -sh * | sort -h' + +alias rm='rm -r' +alias mkdir='mkdir -pv' + +alias cd..='cd ..' +alias ..='cd ..' +alias ...='cd ../..' +alias .3='cd ../../..' + +alias path='echo -e ${PATH//:/\\n}' + +# shorts +alias c='clear' +alias q='exit' +alias h='history | less' +alias j='jobs -l' +alias hg='history|grep' + +# utils +alias sha='shasum -a 256' +alias getpass="openssl rand -base64 12" +alias diff='colordiff' +alias mount='mount | column -t' +alias upgrade_all='sudo apt update && sudo apt upgrade' +alias tar-it='tar -czf "../${PWD##*/}.tar.gz" .' + + +# time +alias now='date +"%T"' +alias nowdate='date +"%d-%m-%Y"' + +# vim +alias vi=vim +alias svi="sudo -E vim" +alias vis='vim "+set si"' +alias edit=vim + +# net +alias ports='netstat -tulanp' +alias wget='wget -c' +alias ping='ping -c 5' +alias myip='curl ipinfo.io/ip' + +# starts web server +alias www='python3 -m http.server 8000' + +# hard +alias reboot='sudo /sbin/reboot' +alias poweroff='sudo /sbin/poweroff' +alias halt='sudo /sbin/halt' +alias shutdown='sudo /sbin/shutdown' + +alias meminfo='free -mlth' +alias psmem='ps auxf | sort -nr -k 4 | less -R' +alias wake="echo $'\a'" # command; wake & + +alias music='mplayer -shuffle ~/Music/*' + + +# initializes first ./*/*/activate +alias ve='python3 -m virtualenv venv && . venv/bin/activate' +alias vd='deactivate' + + +PS1="\n┌──(\u@\H)-[\w]\n└─\$ " diff --git a/etc/skel/.vimrc b/etc/skel/.vimrc new file mode 100644 index 0000000..32465fb --- /dev/null +++ b/etc/skel/.vimrc @@ -0,0 +1,55 @@ +set number "номер строки +set ruler +set laststatus=2 +set encoding=utf-8 "Ставит кодировку UTF-8 +set nocompatible "Отключает обратную совместимость с Vi +syntax on "Включает подсветку синтаксиса + +set expandtab +set smarttab +set tabstop=4 +set softtabstop=4 +set shiftwidth=4 +set autoindent +set smartindent +set nowrap + +set noerrorbells +set novisualbell +set showcmd +set showtabline=2 + +set ignorecase +set smartcase +set hlsearch +set incsearch + +set mousehide +set mouse=a + +set colorcolumn=120 +set scrolloff=7 + +set virtualedit=onemore " allow for cursor beyond last character + +" f4 toggle hlsearch +nnoremap :set invhlsearch + +" navigation on russian +nmap о j +nmap л k +nmap р h +nmap д l +nmap ш i +nmap ф a +nmap в d + + +set ffs=unix,dos,mac +set encoding=utf8 + +" tabs +nnoremap :tabprevious +nnoremap :tabnext +nnoremap :tabprevious +nnoremap :tabnext diff --git a/home/user/.subzsh/history b/home/user/.subzsh/history index 2477f74..b42cf71 100644 --- a/home/user/.subzsh/history +++ b/home/user/.subzsh/history @@ -11,7 +11,7 @@ setopt hist_ignore_space # ignore commands that start with space setopt hist_verify # show command with history expansion to user before running it #setopt share_history # share command history data -HISTORY_IGNORE="(exit|q|c)" +HISTORY_IGNORE="(exit|q|c|..|l[l,s,a,.])" # configure `time` format TIMEFMT=$'\nreal\t%E\nuser\t%U\nsys\t%S\ncpu\t%P'