From 77211295f427045e90d942acd0ec0284f2d4fcb2 Mon Sep 17 00:00:00 2001 From: Hassan Afify Date: Tue, 30 Jul 2019 00:05:17 +0300 Subject: [PATCH] Update bashrc gitconfig, remove ssh_key - vimrc --- .bashrc | 9 +++--- .gitconfig | 64 +++++++++++++++++++++++++++++++++++++++++++ .scripts/bluetooth_connect.sh | 12 ++++---- .scripts/gpg_decrypt.sh | 11 ++++---- .scripts/ssh_key.sh | 16 ----------- .vimrc | 11 ++++++-- 6 files changed, 89 insertions(+), 34 deletions(-) delete mode 100644 .scripts/ssh_key.sh diff --git a/.bashrc b/.bashrc index 501ed88..51a2d91 100644 --- a/.bashrc +++ b/.bashrc @@ -29,10 +29,11 @@ alias xc='xclip -sel clip <' alias pacman_clean="sudo pacman -Rns $(pacman -Qtdq)" alias gic="sh /home/hassan/.scripts/git_init_c.sh" -alias gs="git status" -alias gp="git push origin" -alias gd="git difftool HEAD" -alias gr="git rm -r" +# alias gs="git status" +# alias gc="git commit -S" +# alias gp="git push origin" +# alias gd="git difftool HEAD" +# alias gr="git rm -r" alias github="eval \"$(ssh-agent -s)\"; ssh-add /home/hassan/.ssh/github" alias ya="youtube-dl -i --add-metadata -f bestaudio" diff --git a/.gitconfig b/.gitconfig index f15c589..59601a4 100644 --- a/.gitconfig +++ b/.gitconfig @@ -2,16 +2,80 @@ name = Hassan Afify email = hassanafify@protonmail.com signingkey = 0F6CD1196B2A5658 + [core] editor = vim + excludesfile = ~/.gitignore + [color] ui = true + diff = auto + status = auto + branch = auto + interactive = auto + +[merge] + tool = vimdiff + +[mergetool] + prompt = false + keepBackup = false + [diff] tool = vimdiff + + noprefix = true + algorithm = patience + renames = copies + [difftool] prompt = false + [commit] gpgsign = true template = ~/.gitmessage + [push] default = current + +[github] + user = HassanAfify + +[log] + date = local + extendedRegexp = true + +[gpg] + program = gpg + +[alias] + s = status --short --branch + c = commit -S + d = difftool HEAD + i = init + fch = fsck --full + ch = checkout + + tags = tag -l + tags = tag -n1 -l + +# Log + l = log --all --graph --decorate + lg = log --graph --all --pretty=format:'%Cred%h%Creset \ + -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset'\ + --abbrev-commit --date=relative + sl = shortlog + + m = merge + f = fetch + pl = pull + p = push origin + + br = branch + be = branch --edit-description + brm = branch --merged + + r = rm -r + unadd = reset HEAD + unstage = reset HEAD + uncommit = reset --soft HEAD^ diff --git a/.scripts/bluetooth_connect.sh b/.scripts/bluetooth_connect.sh index bb9ea76..33ff060 100755 --- a/.scripts/bluetooth_connect.sh +++ b/.scripts/bluetooth_connect.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -#=============================================================================== +#============================================================================== # Name : bluetooth_connect # GitHub : HassanAfify # Copyright : MIT @@ -9,7 +9,7 @@ # Normal mode and force mode. # 2 devices mac address (keyboard and headset). # Send notification. -#=============================================================================== +#============================================================================== # use dmenu to choose devices device=$(echo -e "JBL Headset\nAnne Pro" | dmenu) @@ -35,10 +35,10 @@ if [ "$1" == "force" ]; then notify-send "Force Connection" bluetoothctl power off bluetoothctl power on - dmenu -P -p "Enter Password: " |\ - sudo -S rfkill unblock bluetooth;\ - systemctl restart bluetooth;\ - systemctl enable bluetooth;\ +# dmenu -P -p "Enter Password: " |\ +# sudo -S rfkill unblock bluetooth;\ + systemctl restart bluetooth + systemctl enable bluetooth systemctl start bluetooth # bluetoothctl remove $device # timeout 7s bluetoothctl scan on diff --git a/.scripts/gpg_decrypt.sh b/.scripts/gpg_decrypt.sh index 701d1f2..fa096f4 100644 --- a/.scripts/gpg_decrypt.sh +++ b/.scripts/gpg_decrypt.sh @@ -9,12 +9,13 @@ #============================================================================== -$encrypted_file='myfile.txt.gpg' -$output_file='myfile.txt' -$signed_file='myfile.txt.sha256sum.sig' +encrypted_file='firefox_startup.txt.gpg' +output_file='firefox_startup.txt' +signed_file='firefox_startup.txt.sha256sum.sig' # Vertify -gpg --verify $signed_file +gpg --verify $signed_file +# gpg --verify < $signed_file # Decrypt -gpg --output $output_file --decrypt $encrypted_file +# gpg --output $output_file --decrypt $encrypted_file diff --git a/.scripts/ssh_key.sh b/.scripts/ssh_key.sh deleted file mode 100644 index 41d1411..0000000 --- a/.scripts/ssh_key.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -email="hassan3afify@gmail.com" -git_site="github" - -cd ~/.ssh/ - -ssh-keygen -t rsa -b 4096 -C $email -eval "$(ssh-agent -s)" -ssh-add ~/.ssh/$git_site -xclip -sel clip < ~/.ssh/$git_site.pub - -# echo "# $git_site.com -# Host $git_site.com -# Preferredauthentications publickey -# IdentityFile ~/.ssh/$git_site" >> ~/.ssh/config diff --git a/.vimrc b/.vimrc index 5d85b67..9541e6b 100644 --- a/.vimrc +++ b/.vimrc @@ -79,8 +79,8 @@ set cursorline set colorcolumn=80 autocmd FileType gitcommit set colorcolumn=50,72 hi ColorColumn ctermbg=235 -highlight OverLength ctermbg=red ctermfg=white -match OverLength /\%80v.\+/ +" highlight OverLength ctermbg=red ctermfg=white +" match OverLength /\%80v.\+/ " Comments tab todo hi Comment ctermfg=59 @@ -176,6 +176,10 @@ nmap yss" " to the end of line nmap ; v$hS" +" Case wrap lines move up down +" nnoremap j gj +" nnoremap k gk + "============================================================================== " Lightline "============================================================================== @@ -214,7 +218,8 @@ let g:tmpl_search_paths = ['/home/hassan/.vim/templates'] "============================================================================== " Folding "============================================================================== -"setlocal foldmethod=syntax +set foldmethod=indent "fold based on identation +set nofen "open all folds initially "============================================================================== " File type highlight -- 2.11.4.GIT