This commit is contained in:
TheK4n 2021-11-14 22:47:49 +03:00
parent 51171ba2bb
commit 2da989e266
7 changed files with 49 additions and 20 deletions

View File

@ -1,4 +1,6 @@
export EDITOR=vim
export EDITOR="/usr/bin/env vim"
export HISTSIZE=10000
export HISTFILESIZE=10000

View File

@ -91,3 +91,14 @@ extract () {
mcd () {
mkdir -p "$1" && cd "$1" || return
}
# Syntax-highlight JSON strings or files
# Usage: `json '{"foo":42}'` or `echo '{"foo":42}' | json`
json() {
if [ -t 0 ]; then # argument
python -m json.tool <<< "$*" | pygmentize -l javascript
else # pipe
python -m json.tool | pygmentize -l javascript
fi
}

View File

@ -84,7 +84,7 @@ __prompt_command() {
TERMINAL_NAME=${0%%/*}
TERMINAL_NAME="\[\e]2;${TERMINAL_NAME^^}\a\]"
if [ $EXIT != 0 ]; then
if [ "$EXIT" != 0 ]; then
PS1="$TERMINAL_NAME\n$prompt_color┌─${VENV_}─($close_color$info_color\u$prompt_symbol\H$close_color$prompt_color)-[$close_color\w$prompt_color]$close_color $red_color${BRANCH_}$close_color\n\[$(tput sc; rightprompt $EXIT; tput rc)\]$prompt_color└─$close_color$info_color$end_symbol$close_color "
else
PS1="$TERMINAL_NAME\n$prompt_color┌─${VENV_}─($close_color$info_color\u$prompt_symbol\H$close_color$prompt_color)-[$close_color\w$prompt_color]$close_color $red_color${BRANCH_}$close_color\n$prompt_color└─$close_color$info_color$end_symbol$close_color "

View File

@ -1,4 +1,4 @@
<h1 align="center">dotfiles</h1>
<h1 align="center">Kan`s dotfiles</h1>
<p align="center">
<a href="https://github.com/TheK4n">
@ -13,7 +13,7 @@
## Content
* [Project description](#chapter-0)
* [Installation](#chapter-1)
* [Tips](#chapter-2)
* [Docs](#chapter-2)
<a id="chapter-0"></a>
@ -35,25 +35,15 @@ dotfiles/setup.sh
. ~/.bashrc
```
<a id="chapter-2"></a>
## Tips
## Docs
* [Tips](doc/tips.md)
* [Cron](doc/cron.md)
* [GPG](doc/gpg.md)
* [SSH](doc/ssh.md)
* [Vim](doc/vim.md)
```$RANDOM``` - Return random 0-32767\
```\command``` - Without using alias
### Autostart
* create ```/etc/systemd/system/<service>.service```
```bash
sudo vim /etc/systemd/system/<service>.service # create custom service
sudo systemctl daemon-reload
sudo systemctl start <service>.service # start custom service
sudo systemctl status <service>.service # check status
sudo systemctl enable <service>.service # autostart custom service
```

18
doc/tips.md Normal file
View File

@ -0,0 +1,18 @@
## Tips
```$RANDOM``` - Return random 0-32767\
```\command``` - Without using alias
### Autostart
* create ```/etc/systemd/system/service.service```
```bash
sudo vim /etc/systemd/system/service.service # create custom service
sudo systemctl daemon-reload
sudo systemctl start service.service # start custom service
sudo systemctl status service.service # check status
sudo systemctl enable service.service # autostart custom service
```

8
git_setup.sh Normal file
View File

@ -0,0 +1,8 @@
echo "Type in your first and last name (no accent or special characters - e.g. 'ç'): "
read -r full_name
echo "Type in your email address (the one used for your GitHub account): "
read -r email
git config --global user.email "$email"
git config --global user.name "$full_name"

0
setup.sh Normal file → Executable file
View File