From a6061b61fa52b5c810c4214cc0682f4b21f1592c Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Wed, 6 Nov 2024 08:25:12 +0800 Subject: Update --- alias | 7 +++++ misc/vconsole.conf | 2 +- profile | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ profile.sh | 81 ------------------------------------------------------ 4 files changed, 89 insertions(+), 82 deletions(-) create mode 100755 profile delete mode 100755 profile.sh diff --git a/alias b/alias index 05e979f..2415d91 100644 --- a/alias +++ b/alias @@ -564,3 +564,10 @@ vvv() { echo "restarting vim..."; done } + +ip.neigh() { + INTERFACES=$(ifconfig | sed -nE 's/^([^ :]+).*$/\1/p') + test -z "$1" && echo $INTERFACES && return 0 + + ifconfig | sed -nE "/^${1}/,/^$/ s/^ +inet ([0-9.]+) .*$/\1/p" +} diff --git a/misc/vconsole.conf b/misc/vconsole.conf index cc8f224..8a1e7e7 100644 --- a/misc/vconsole.conf +++ b/misc/vconsole.conf @@ -1,2 +1,2 @@ -KEYMAP=/home/pham/helper/misc/keymap +KEYMAP=/usr/share/kbd/keymaps/i386/qwerty/us.map FONT=ter-218b diff --git a/profile b/profile new file mode 100755 index 0000000..e689376 --- /dev/null +++ b/profile @@ -0,0 +1,81 @@ +# trap 'exit.sh' EXIT + +export SETTING_DIR=${SETTING_DIR:=$HOME/helper} +export BIN_DIR=~/bin +export PATH=$BIN_DIR:$PATH +export TERM=xterm-256color +export XDG_CONFIG_HOME=~/.config +export XDG_STATE_HOME=~/.local/share/ +export MAIL=$HOME/Maildir +if which nvim &>/dev/null; then + export EDITOR=nvim +else + export EDITOR=vim +fi +export VISUAL=$EDITOR +export TIG_EDITOR=$EDITOR +export GIT_EDITOR=$EDITOR + +# Get current shell +shell=$(/dev/null; then + export FZF_COMPLETION_OPTS='--bind=ctrl-c:print-query' + export FZF_CTRL_T_OPTS='--no-multi --bind=ctrl-c:print-query' + export FZF_CTRL_R_OPTS='--bind=ctrl-c:print-query' + fzf_preview() { fzf --preview 'cat {}'; } + source ~/.fzf.${shell} +fi + +# Set zsh or bash +if [[ $- =~ i ]]; then + if [[ $shell == zsh ]]; then + setopt extended_glob + fpath=($SETTING_DIR/zsh $fpath) + alias history='history -i' + autoload compinit; compinit + + #autoload -U deer + #zle -N deer + #bindkey '\ek' deer + bindkey -s '\ek' 'fzf_preview ' + bindkey -s '' 'fg || vl ' + elif [[ $shell == bash ]]; then + shopt -s extglob + HISTTIMEFORMAT='%Y-%m-%d %T ' + + bind -m emacs-standard -x '"\ek": fzf_preview' + fi +fi + +# Apply nvm +[ -e $HOME/.config/nvm/nvm.sh ] && source "$HOME/.config/nvm/nvm.sh" + +# Working DIR +# [[ `pwd` == $HOME ]] && test -d ~/Downloads && cd ~/Downloads +cd ~/git/dumbymap 2>/dev/null || cd ~/Downloads +source ~/.profile 2>/dev/null + +true diff --git a/profile.sh b/profile.sh deleted file mode 100755 index e689376..0000000 --- a/profile.sh +++ /dev/null @@ -1,81 +0,0 @@ -# trap 'exit.sh' EXIT - -export SETTING_DIR=${SETTING_DIR:=$HOME/helper} -export BIN_DIR=~/bin -export PATH=$BIN_DIR:$PATH -export TERM=xterm-256color -export XDG_CONFIG_HOME=~/.config -export XDG_STATE_HOME=~/.local/share/ -export MAIL=$HOME/Maildir -if which nvim &>/dev/null; then - export EDITOR=nvim -else - export EDITOR=vim -fi -export VISUAL=$EDITOR -export TIG_EDITOR=$EDITOR -export GIT_EDITOR=$EDITOR - -# Get current shell -shell=$(/dev/null; then - export FZF_COMPLETION_OPTS='--bind=ctrl-c:print-query' - export FZF_CTRL_T_OPTS='--no-multi --bind=ctrl-c:print-query' - export FZF_CTRL_R_OPTS='--bind=ctrl-c:print-query' - fzf_preview() { fzf --preview 'cat {}'; } - source ~/.fzf.${shell} -fi - -# Set zsh or bash -if [[ $- =~ i ]]; then - if [[ $shell == zsh ]]; then - setopt extended_glob - fpath=($SETTING_DIR/zsh $fpath) - alias history='history -i' - autoload compinit; compinit - - #autoload -U deer - #zle -N deer - #bindkey '\ek' deer - bindkey -s '\ek' 'fzf_preview ' - bindkey -s '' 'fg || vl ' - elif [[ $shell == bash ]]; then - shopt -s extglob - HISTTIMEFORMAT='%Y-%m-%d %T ' - - bind -m emacs-standard -x '"\ek": fzf_preview' - fi -fi - -# Apply nvm -[ -e $HOME/.config/nvm/nvm.sh ] && source "$HOME/.config/nvm/nvm.sh" - -# Working DIR -# [[ `pwd` == $HOME ]] && test -d ~/Downloads && cd ~/Downloads -cd ~/git/dumbymap 2>/dev/null || cd ~/Downloads -source ~/.profile 2>/dev/null - -true -- cgit v1.2.3-70-g09d2