From 6962b31552fbf1a2516b0777cc4a52d99a76f6f2 Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Wed, 5 May 2021 20:32:05 +0200 Subject: update --- .bash-powerline.sh | 12 ++++++------ .bashrc | 55 +++++++++++++++++++++++++++++++----------------------- .profile | 4 +++- .tmux.conf | 3 --- .vimrc | 4 +++- .zshrc | 3 +++ bin/update_hosts | 1 - 7 files changed, 47 insertions(+), 35 deletions(-) delete mode 100644 .tmux.conf diff --git a/.bash-powerline.sh b/.bash-powerline.sh index 626157a..f87eadb 100644 --- a/.bash-powerline.sh +++ b/.bash-powerline.sh @@ -9,8 +9,8 @@ __powerline() { readonly COLOR_CWD='\[\033[0;34m\]' # blue readonly COLOR_GIT='\[\033[0;36m\]' # cyan #readonly COLOR_SUCCESS='\[\033[0;32m\]' # green - readonly COLOR_SUCCESS='\[\033[0;1;34m\]' # blue, bold - readonly COLOR_FAILURE='\[\033[0;1;31m\]' # red, bold + readonly COLOR_SUCCESS='\[\033[0;34m\]' # blue + readonly COLOR_FAILURE='\[\033[0;31m\]' # red #readonly SYMBOL_GIT_BRANCH='⑂' readonly SYMBOL_GIT_BRANCH='→' @@ -26,7 +26,7 @@ __powerline() { host=$(hostname) fi - [ "$PS_SYMBOL" ] || PS_SYMBOL=';' + [ "$PS_SYMBOL" ] || PS_SYMBOL='$' __git_info() { [[ $POWERLINE_GIT = 0 ]] && return # disabled @@ -67,9 +67,9 @@ __powerline() { # Check the exit code of the previous command and display different # colors in the prompt accordingly. if [ $? -eq 0 ]; then - local symbol="$COLOR_SUCCESS$PS_SYMBOL $RESET" + local symbol="$COLOR_SUCCESS $PS_SYMBOL $RESET" else - local symbol="$COLOR_FAILURE$PS_SYMBOL $RESET" + local symbol="$COLOR_FAILURE $PS_SYMBOL $RESET" fi local cwd="$COLOR_CWD\w$RESET" @@ -86,7 +86,7 @@ __powerline() { local git="$COLOR_GIT$(__git_info)$RESET" fi - [ "$SSH_TTY" ] && PS1=": $host:$cwd$git$symbol" || PS1=": $cwd$git$symbol" + [ "$SSH_TTY" ] && PS1="$host:$cwd$git$symbol" || PS1="$cwd$git$symbol" } PROMPT_DIRTRIM=1 diff --git a/.bashrc b/.bashrc index 95f2377..fca1532 100644 --- a/.bashrc +++ b/.bashrc @@ -40,41 +40,41 @@ alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date export TERMINAL=xt -alias cl='cf xft:Mono:size=12' -alias cp='cp --reflink' -alias ls='ls --color=auto -v' -alias ll='ls -AlFhv' +#alias cl='cf xft:Mono:size=12' +#alias cp='cp --reflink' +#alias ls='ls --color=auto -v' +alias ls='ls -GF' +alias ll='ls -AlGFhv' alias vi='vim' alias view='vim -R' #alias op='xdg-open' alias git='hub' #alias go='go1.14.1' -alias go11='go1.11.13' -alias go12='go1.12.10' -alias go13='go1.13.8' -alias go14='go1.14.2' +#alias go11='go1.11.13' +#alias go12='go1.12.10' +#alias go13='go1.13.8' +#alias go14='go1.14.2' alias gob='go build' alias goh='p go help' alias god='p go doc' alias gtr='go test -v -run' alias gtb='go test -v -cpuprofile cpu.out -memprofile mem.out -benchmem -bench' -#alias vi='vim' alias rvi='sudo vim' alias rxt='sudo xt' alias rxvi='sudo xvi' alias ww='vi ~/Wiki/HomePage' alias dotfiles='git --git-dir=$HOME/dotfiles --work-tree=$HOME' -alias uc='systemctl --user' -alias wpa='sudo wpa_gui -i wlan0' +#alias uc='systemctl --user' +#alias wpa='sudo wpa_gui -i wlan0' -alias ifre='echo "ip link set wlo1 down; ip link set wlo1 up"|sudo sh' +#alias ifre='echo "ip link set wlo1 down; ip link set wlo1 up"|sudo sh' # Some admin command -alias dmesg='sudo dmesg' -alias mount='sudo mount' -alias umount='sudo umount' -alias cryptsetup='sudo cryptsetup' +#alias dmesg='sudo dmesg' +#alias mount='sudo mount' +#alias umount='sudo umount' +#alias cryptsetup='sudo cryptsetup' alias by='go build ./cmd/yaegi' alias cy='cd ~/go/src/github.com/traefik/yaegi' @@ -85,6 +85,9 @@ alias wai='~/go/src/github.co/traefik/whoami/whoami' # yaegi debug export YAEGI_DOT_CMD='dotty -' +export YAEGI_UNSAFE=1 +export YAEGI_UNRESTRICTED=1 +export YAEGI_SYSCALL=1 mosht() { mosh "$@" -- tmux new -A; } export -f mosht @@ -107,6 +110,12 @@ export -f ws wsd() (cd ~/Wiki && git add . && git diff --cached) export -f wsd +man() { + local width='' + [ $(tput cols) -gt 88 ] && width='MANWIDTH=88' + env $width man "$@" +} + meteo() { local request="wttr.in/${1-Toulouse}?F&T" [ "$(tput cols)" -lt 125 ] && request+='&n' @@ -117,19 +126,19 @@ meteo() { # fzf # Accomodate different base prefix on termux -[ -d "$HOME/../usr" ] && base=.. -[ -f "$base/usr/share/fzf/completion.bash" ] && . "$base/usr/share/fzf/completion.bash" -[ -f "$base/usr/share/fzf/key-bindings.bash" ] && . "$base/usr/share/fzf/key-bindings.bash" -unset base +#[ -d "$HOME/../usr" ] && base=.. +#[ -f "$base/usr/share/fzf/completion.bash" ] && . "$base/usr/share/fzf/completion.bash" +#[ -f "$base/usr/share/fzf/key-bindings.bash" ] && . "$base/usr/share/fzf/key-bindings.bash" +#unset base # Arch: display package to install for missing commands -[ -f '/usr/share/doc/pkgfile/command-not-found.bash' ] && . /usr/share/doc/pkgfile/command-not-found.bash +#[ -f '/usr/share/doc/pkgfile/command-not-found.bash' ] && . /usr/share/doc/pkgfile/command-not-found.bash # Display git status in prompt . ~/.bash-powerline.sh # export PS1='; ' # load Nix config files (aka auto-completion etc.) -export XDG_DATA_DIRS="$HOME/.nix-profile/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" +#export XDG_DATA_DIRS="$HOME/.nix-profile/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" -[ -f ~/.fzf.bash ] && source ~/.fzf.bash +#[ -f ~/.fzf.bash ] && source ~/.fzf.bash diff --git a/.profile b/.profile index acb8299..78b4393 100644 --- a/.profile +++ b/.profile @@ -1,6 +1,6 @@ # ~/.profile -PATH=~/bin:$PATH:~/go/bin +PATH=~/bin:/opt/homebrew/bin:$PATH:~/go/bin [ "${SHELL##*/}" = bash ] && . ~/.bashrc @@ -8,3 +8,5 @@ PATH=~/bin:$PATH:~/go/bin #case $HOSTNAME in #([sS]wift|yoda) [ "$(tty)" != /dev/tty1 ] || exec startx ;; #esac + +. "/opt/homebrew/etc/profile.d/bash_completion.sh" diff --git a/.tmux.conf b/.tmux.conf deleted file mode 100644 index 8d624a0..0000000 --- a/.tmux.conf +++ /dev/null @@ -1,3 +0,0 @@ -set-option -g prefix ² -unbind-key C-b -bind-key ² send-prefix diff --git a/.vimrc b/.vimrc index 9f5b410..6b26f67 100644 --- a/.vimrc +++ b/.vimrc @@ -25,7 +25,9 @@ autocmd filetype vimki nnoremap - YpVr- let g:go_def_mode = "gopls" let g:go_info_mode = "gopls" let g:go_list_type = "quickfix" -let g:go_fmt_command = "goimports" +" let g:go_fmt_command = "goimports" +let g:go_fmt_command = "gopls" +let g:go_gopls_gofumpt = 1 let g:go_metalinter_command = "golangci-lint" autocmd FileType go syntax on autocmd FileType go nmap b (go-build) diff --git a/.zshrc b/.zshrc index 599574e..fc3b9f9 100644 --- a/.zshrc +++ b/.zshrc @@ -1,5 +1,8 @@ # Environment export YAEGI_DOT_CMD='dotty -' +export YAEGI_UNSAFE=1 +export YAEGI_UNRESTRICTED=1 +export YAEGI_SYSCALL=1 # gnuplot display in terminal export GNUTERM='sixelgd enhanced truecolor font "arial,9"' diff --git a/bin/update_hosts b/bin/update_hosts index 4427cd2..75c41d1 100755 --- a/bin/update_hosts +++ b/bin/update_hosts @@ -3,7 +3,6 @@ # Update /etc/hosts with a well curated blacklist of malware, ads, porn, etc. # Custom hosts are preserved. - [ "$USER" = root ] || exec sudo "$0" "$@" echo "Check from https://github.com/StevenBlack/hosts" -- cgit v1.2.3