From bbc0066a3f585290013b5e24a0d79c7f32ae8296 Mon Sep 17 00:00:00 2001 From: afify Date: Tue, 3 Nov 2020 02:45:49 +0300 Subject: [PATCH] radare2rc, dwmcolors, vimrc --- .config/git/config | 2 +- .config/ksh/kshrc | 1 + .config/radare2rc | 7 +++++++ .profile | 1 + .scripts/check_ffmpeg.sh | 2 +- .scripts/check_mic.sh | 4 ++-- .scripts/check_ssh.sh | 2 +- .scripts/dwmcolors.txt | 7 +++++++ .scripts/gpu.sh | 2 +- .scripts/xbps_base.txt | 2 ++ .vim/vimrc | 23 ++++++++++++++++++----- 11 files changed, 42 insertions(+), 11 deletions(-) create mode 100644 .config/radare2rc create mode 100644 .scripts/dwmcolors.txt diff --git a/.config/git/config b/.config/git/config index 03795b3..28e8454 100644 --- a/.config/git/config +++ b/.config/git/config @@ -88,7 +88,7 @@ # Diff d = difftool HEAD create-diff = !sh ~/.scripts/create_diff_git.sh - apply-diff = !result=$(ls *.{diff,patch} | dmenu -p 'select diff file' -l 10) && git apply $result + apply-diff = !git apply $(find . -type f -name "*.diff" -o -name "*.patch" | dmenu -p 'select diff file' -l 10) # df = difftool main..otherbr -- filename # Commit diff --git a/.config/ksh/kshrc b/.config/ksh/kshrc index 59ac63b..5559f3a 100644 --- a/.config/ksh/kshrc +++ b/.config/ksh/kshrc @@ -22,6 +22,7 @@ alias val="valgrind --trace-children=yes --track-fds=yes --track-origins=yes --l [ "$(uname)" = "OpenBSD" ] && alias sys2="less /usr/src/sys/kern/syscalls.master" alias ob="objdump -D -M intel" alias rr="r2 -d -c vv" +alias reg="cat .scripts/reg.txt" # downloads alias wgetf="wget --tries=100 --continue --content-disposition --trust-server-names -i" diff --git a/.config/radare2rc b/.config/radare2rc new file mode 100644 index 0000000..b1e1f65 --- /dev/null +++ b/.config/radare2rc @@ -0,0 +1,7 @@ +e asm.describe = true +e cfg.sandbox = false +e cmd.stack = true +e scr.utf8 = true +e scr.utf8.curvy = true +eco xvilka +# eco ogray diff --git a/.profile b/.profile index bb8fbdf..e764a46 100644 --- a/.profile +++ b/.profile @@ -6,6 +6,7 @@ export GPG_TTY=$(tty) export LANG=en_US.UTF-8 export LC_ALL=en_US.UTF-8 export ENV=~/.config/ksh/kshrc +export R2_RCFILE=~/.config/radare2rc export HISTSIZE=10000 export HISTCONTROL=ignoredups export HISTFILE=~/.cache/.sh_history diff --git a/.scripts/check_ffmpeg.sh b/.scripts/check_ffmpeg.sh index 0d694d1..0c62956 100644 --- a/.scripts/check_ffmpeg.sh +++ b/.scripts/check_ffmpeg.sh @@ -2,5 +2,5 @@ is_recording=$(pgrep -f "ffmpeg -f" | wc -l) if [ "$is_recording" -gt 0 ]; then - echo " 辶 " + echo " 辶 " fi diff --git a/.scripts/check_mic.sh b/.scripts/check_mic.sh index 334221a..8bc86f1 100644 --- a/.scripts/check_mic.sh +++ b/.scripts/check_mic.sh @@ -2,6 +2,6 @@ case $(uname) in Linux) unmuted_count=$(pactl list sources| grep -c 'Mute: no') - [ "$unmuted_count" -gt 0 ] && echo " $unmuted_count 壘 ";; - OpenBSD) [ "$(sysctl -n kern.audio.record)" -gt 0 ] && echo " 壘 ";; + [ "$unmuted_count" -gt 0 ] && echo " $unmuted_count 壘 ";; + OpenBSD) [ "$(sysctl -n kern.audio.record)" -gt 0 ] && echo " 壘 ";; esac diff --git a/.scripts/check_ssh.sh b/.scripts/check_ssh.sh index 8b3f817..551b8b2 100644 --- a/.scripts/check_ssh.sh +++ b/.scripts/check_ssh.sh @@ -5,4 +5,4 @@ cout=$(pgrep -f "^ssh " | wc -l | tr -d ' ') [ "$cin" -gt 0 ] && in="$cin 﫻 " [ "$cout" -gt 0 ] && out="$cout  " [ "$(pgrep sshd | wc -l)" -gt 0 ] && sshd="[sshd]" -printf " %s%s%s" "$in" "$out" "$sshd" +printf " %s%s%s" "$in" "$out" "$sshd" diff --git a/.scripts/dwmcolors.txt b/.scripts/dwmcolors.txt new file mode 100644 index 0000000..e797382 --- /dev/null +++ b/.scripts/dwmcolors.txt @@ -0,0 +1,7 @@ +SchemeNorm 001  +SchemeSel 002  +SchemeRed 003  +SchemeGreen 004  +SchemeCyan 005  +SchemeYellow 006  +SchemeOrange 007  diff --git a/.scripts/gpu.sh b/.scripts/gpu.sh index 5ad827a..40cccb7 100644 --- a/.scripts/gpu.sh +++ b/.scripts/gpu.sh @@ -16,5 +16,5 @@ cur_gpu=$(echo "$query" | awk '{print $4}') if [ "$cur_mem" -gt "$max_mem" ] || [ "$cur_temp" -gt "$max_temp" ] || [ "$cur_gpu" -gt "$max_gpu" ]; then - echo " GPU [$cur_mem MB] [$cur_temp C] [$cur_gpu %]" + echo "GPU [$cur_mem MB] [$cur_temp C] [$cur_gpu %]" fi diff --git a/.scripts/xbps_base.txt b/.scripts/xbps_base.txt index 304d186..dcc2a74 100644 --- a/.scripts/xbps_base.txt +++ b/.scripts/xbps_base.txt @@ -3,6 +3,7 @@ abook acpi aircrack-ng aisleriot +bc bluez clang clang-analyzer @@ -23,6 +24,7 @@ fonts-droid-ttf fuse-sshfs gcr-devel gdb +geckodriver giflib-devel git github-cli diff --git a/.vim/vimrc b/.vim/vimrc index e89d81e..6404f67 100644 --- a/.vim/vimrc +++ b/.vim/vimrc @@ -46,6 +46,7 @@ autocmd FilterWritePre * if &diff | set foldcolumn=0 | endif " set noautoindent " set linebreak +set smartindent filetype plugin indent on "============================================================================== @@ -142,7 +143,7 @@ nnoremap n :lnext " Custom functions " nnoremap c :call Clean_file() -nnoremap c :ClangFormat +nnoremap c :call ClangFormat_func() nnoremap r :set rightleft nnoremap R :set norightleft @@ -159,6 +160,10 @@ nnoremap ' i"A"l nnoremap [ i[lea]l nnoremap ] i{lea}l +" hex +nnoremap h :%!xxd +nnoremap H :%!xxd -r + "============================================================================== " Status Line "============================================================================== @@ -211,6 +216,8 @@ endfunction "============================================================================== let g:syntastic_python_checkers = ["pylint"] let g:syntastic_sh_checkers = ["shellcheck"] +let g:syntastic_nasm_checkers = ["nasm"] +let g:syntastic_nasm_nasm_args = "-f elf64 -w+all" let g:syntastic_c_checkers = ["splint"] let g:syntastic_c_splint_args = "-checks +posixlib +matchanyintegral +enumint -nullpass -nullret ./util.c -DVERSION=\\\"VERSION\\\"" @@ -249,7 +256,6 @@ let g:gitgutter_map_keys = 0 " set nofen set foldnestmax=1 set foldmethod=syntax -set foldtext=trim(getline(v:foldstart),&commentstring) set fillchars="" "============================================================================== @@ -282,6 +288,15 @@ inoremap pumvisible() ? "\" : "\" inoremap "============================================================================== +" ClangFormat function +"============================================================================== +function! ClangFormat_func() + :!cp /mnt/data/dev/openbsd_clang-format/.clang-format . + :ClangFormat +endfunction +" :!rm -f .clang-format + +"============================================================================== " Remove characters function "============================================================================== function! Clean_file() @@ -315,9 +330,7 @@ let g:upperfilename = toupper(filename) autocmd BufNewFile *.sh normal!ggi#!/bin/sh autocmd BufNewFile *.py normal!ggi#!/usr/bin/env python3 -autocmd BufNewFile *.s exe "normal!ggiBITS 64 global _start section" - \".text _start: exit: mov rax, 60 ; " - \"exit( mov rdi, 0 ; EXIT_SUCCESS syscall ; );" +autocmd BufNewFile *.s exe "normal!ggiBITS 64 section .rodata section .data section .bss section .text global _start _start:" | normal!o autocmd BufNewFile *.h exe "normal!ggi/* See LICENSE file for copyright and " \"license details. */ #ifndef ".g:upperfilename."_H #define " \.g:upperfilename."_H \#endif /* ".g:upperfilename."_H */" | normal!kk -- 2.11.4.GIT