From 08ad3d0bac12395e12de43d63199339a405d2ba2 Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Wed, 3 Jan 2024 22:16:14 +0800 Subject: [PATCH] u --- find-and-run-recursively.sh | 2 +- nixhome/.bashrc | 30 +++++++-------------- nixhome/.emacs | 53 +++++++++++++++++++------------------ 3 files changed, 37 insertions(+), 48 deletions(-) diff --git a/find-and-run-recursively.sh b/find-and-run-recursively.sh index 1741867..d0fadfb 100644 --- a/find-and-run-recursively.sh +++ b/find-and-run-recursively.sh @@ -6,7 +6,7 @@ echo "To find in which path? Enter [start path] or [leave blank] for the current read -p ">>> " FIND_FOLDER if [ ! "$FIND_FOLDER" ] then - FIND_FOLDER="." + FIND_FOLDER=`pwd` fi read -p "mindepth >>> " MINDEPTH diff --git a/nixhome/.bashrc b/nixhome/.bashrc index 5562356..73b2587 100644 --- a/nixhome/.bashrc +++ b/nixhome/.bashrc @@ -17,7 +17,7 @@ then fi # Define primary prompt (default is '$'): -export PS1='<\u@\h::\w::\t> ' # \w shows absolute path, \W shows current folder. +export PS1='<\u@\h::\w> ' # \w shows absolute path, \W shows current folder. # Always use ssh to connect to CVS repositories: export CVS_RSH=ssh @@ -33,32 +33,20 @@ export CVS_RSH=ssh # Define aliases: -# Think twice before deletion. Though troublesome but strongly recommended! -alias rm='rm -i' - -# Request X tunneling for SSH: -alias ssh='ssh -C -X' - -# Do not verify Host Key change: -alias sshtrust='ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' - -# Always use compression for CVS: -alias cvs='cvs -z9' - +alias rm='rm -i' # Think twice before deletion. Though troublesome but strongly recommended! +alias ssh='ssh -C -X' # Request X tunneling for SSH: +alias sshtrust='ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' # Do not verify Host Key change: +alias cvs='cvs -z9' # Always use compression for CVS: alias ps='ps -elf' - alias emacst='emacs -nw' - alias myip='ifconfig | grep netmask' - alias rclone='rclone -P' - -# Set aliases alias grep='grep --color=auto' alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto' alias su='su -' alias npmc='npm --registry https://registry.npm.taobao.org' +alias npmr='npm --silent run' if [ "$(uname)" = "Darwin" ] then alias l='ls -lG' @@ -88,7 +76,7 @@ umask 022 # rwxr-xr-x # PROMPT_COMMAND is expanded only when used. case "$TERM" in xterm*|rxvt*) - PROMPT_COMMAND='echo -ne "\033]0;[${USER}@${HOSTNAME}::${PWD}]B\007"' + PROMPT_COMMAND='echo -ne "\033]0;<${USER}@${HOSTNAME}::${PWD}>B\007"' ;; dumb*) ;; @@ -124,7 +112,7 @@ if [ -n "$force_color_prompt" ]; then fi if [ "$color_prompt" = yes ]; then - PS1='<${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]::\[\033[01;34m\]\w\[\033[00m\]::\t> ' + PS1='<${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u\[\033[00m\]@\[\033[01;95m\]\h\[\033[00m\]::\[\033[01;34m\]\w\[\033[00m\]> ' else PS1='<${debian_chroot:+($debian_chroot)}\u@\h::\w::\t> ' fi @@ -133,7 +121,7 @@ unset color_prompt force_color_prompt # If this is an xterm set the title to user@host:dir case "$TERM" in xterm*|rxvt*) - PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" + PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h::\w\a\]$PS1" ;; *) ;; diff --git a/nixhome/.emacs b/nixhome/.emacs index 38ec2f0..e328fb2 100644 --- a/nixhome/.emacs +++ b/nixhome/.emacs @@ -247,12 +247,15 @@ (global-set-key (kbd "C-s") 'save-buffer) ; windows style (global-set-key [C-f1] 'save-as-file) ; ps-print-to-file (global-set-key [f25] 'save-as-file) -;; F2 buffer -(global-set-key [f2] 'rotate-buffer) - (global-set-key [S-f2] 'list-buffers) ; switch-to-buffer - (global-set-key [f14] 'list-buffers) - (global-set-key [C-f2] 'kill-this-buffer) ; kill-buffer prompts before killing. - (global-set-key [f26] 'kill-this-buffer) +;; F2 undo&redo +(global-set-key [f2] 'undo) +(global-set-key (kbd "C-z") 'undo) ; windows style. [C-z] doesn't work, maybe because it's default to suspend-frame + (global-set-key [S-f2] 'redo) + (global-set-key [f14] 'redo) + (global-set-key (kbd "C-y") 'redo) ; windows style. [C-y] doesn't work. + (global-set-key (kbd "C-S-z") 'redo) ; mac style. [C-S-z] doesn't work. +; (global-set-key [C-f2] ') +; (global-set-key [f26] ') ;; F3 search (global-set-key [f3] 'isearch-forward) (global-set-key (kbd "C-f") 'isearch-forward) ; windows style @@ -276,32 +279,30 @@ (global-set-key [f17] 'yank-top) ; (global-set-key [C-f5] ') ; (global-set-key [f29] ') -;; F6 go -(global-set-key [f6] 'goto-line) - (global-set-key [S-f6] 'match-paren) - (global-set-key [f18] 'match-paren) - (global-set-key [C-f6] 'other-window) - (global-set-key [f30] 'other-window) +;; F6 shell +(global-set-key [f6] 'eshell) + (global-set-key [S-f6] 'new-eshell) + (global-set-key [f18] 'new-eshell) + (global-set-key [C-f6] 'browse-web) + (global-set-key [f30] 'browse-web) ;; F7 internationalization (global-set-key [f7] 'toggle-input-method) (global-set-key [S-f7] 'what-cursor-position) ; switch-truncation-continuation (global-set-key [f19] 'what-cursor-position) (global-set-key [C-f7] 'describe-char) (global-set-key [f31] 'describe-char) -;; F8 undo&redo -(global-set-key [f8] 'undo) ; default: C-_ , C-x u; or entering M-x undo -(global-set-key (kbd "C-z") 'undo) ; windows style. [C-z] doesn't work, maybe because it's default to suspend-frame - (global-set-key [S-f8] 'redo) - (global-set-key [f20] 'redo) - (global-set-key (kbd "C-y") 'redo) ; windows style. [C-y] doesn't work. - (global-set-key (kbd "C-S-z") 'redo) ; mac style. [C-S-z] doesn't work. -; (global-set-key [f32] ') -;; F9 shell -(global-set-key [f9] 'eshell) - (global-set-key [S-f9] 'new-eshell) - (global-set-key [f21] 'new-eshell) - (global-set-key [C-f9] 'browse-web) - (global-set-key [f33] 'browse-web) +;; F8 buffer +(global-set-key [f8] 'rotate-buffer) ; default: C-_ , C-x u; or entering M-x undo + (global-set-key [S-f8] 'list-buffers) ; switch-to-buffer + (global-set-key [f20] 'list-buffers) + (global-set-key [C-f8] 'kill-this-buffer) ; kill-buffer prompts before killing. + (global-set-key [f32] 'kill-this-buffer) +;; F9 quick go +(global-set-key [f9] 'goto-line) + (global-set-key [S-f9] 'match-paren) + (global-set-key [f21] 'match-paren) + (global-set-key [C-f9] 'beginning-of-line) + (global-set-key [f33] 'beginning-of-line) ;; F10 ;(global-set-key [f10] ') ; (global-set-key [S-f10] ')