Browse Source

Merge branch 'master' of github.com:10sr/dotfiles

pull/1/head
10sr 10 years ago
parent
commit
8111d17b1c
4 changed files with 83 additions and 21 deletions
  1. +4
    -5
      README.txt
  2. +57
    -2
      bashrc
  3. +20
    -12
      emacs.el
  4. +2
    -2
      setup.sh

+ 4
- 5
README.txt View File

@@ -10,16 +10,16 @@ __Do not go out of ways how the default environments work__.




There are many cases when I must work on foreign environments, and it is always There are many cases when I must work on foreign environments, and it is always
VERY irritating when things will not work as I expect, yet setting up my own
environment will be troublesome. So I avoid changing behaviors of tools,
except for emacs.
VERY irritating when things do not work as I expected, yet setting up my own
environment is troublesome. So I avoid changing behaviors of tools, except
for emacs.


Emacs is the editor I usually use for coding. I decided to change the behavior Emacs is the editor I usually use for coding. I decided to change the behavior
of emacs as I want without thinking about other environments. When I cannot use of emacs as I want without thinking about other environments. When I cannot use
my emacs.el I'll use vi or vim instead. my emacs.el I'll use vi or vim instead.


Other tools like bash and vim basically work in the same ways even when using my Other tools like bash and vim basically work in the same ways even when using my
rc files. The main changes are related to showing informations, typically the
rc files. The main changes are related to showing informations, typically in the
bash prompt. bash prompt.




@@ -41,4 +41,3 @@ Sourcing flow
|--~/.dotfiles/xprofile |--~/.dotfiles/xprofile
| |
`--~/.dotfiles/xprograms `--~/.dotfiles/xprograms


+ 57
- 2
bashrc View File

@@ -338,12 +338,66 @@ then
|| complete -o default -o nospace -F _git g || complete -o default -o nospace -F _git g
fi fi
git svn --help >/dev/null 2>&1 && alias gsvn="git svn" git svn --help >/dev/null 2>&1 && alias gsvn="git svn"
null type gitmemo && alias m=gitmemo


null type gitmemo && alias m=gitmemo null type gitmemo && alias m=gitmemo


alias setup.py="sudo python3 setup.py install --record files.txt" alias setup.py="sudo python3 setup.py install --record files.txt"


datestr(){
# datestr yyyyMMdd-hhmmss
if test -z "$1" || test "$1" == "-h"
then
echo "datestr: usage: datestr <yyyyMMddhhmmss>"
return 1
fi

dfmt= # actual format for date command
while test -n "$1"
do
fmt="$1"
while test -n "$fmt"
do
case "$fmt" in
yyyy*) # year
dfmt="${dfmt}%Y"
fmt="`echo "$fmt" | cut -c 5-`"
;;
yy*) # last two digits of year
dfmt="${dfmt}%y"
fmt="`echo "$fmt" | cut -c 3-`"
;;
MM*) # month (01..12)
dfmt="${dfmt}%m"
fmt="`echo "$fmt" | cut -c 3-`"
;;
dd*) # day of month (01..12)
dfmt="${dfmt}%d"
fmt="`echo "$fmt" | cut -c 3-`"
;;
HH* | hh*) # hour (00..23)
dfmt="${dfmt}%H"
fmt="`echo "$fmt" | cut -c 3-`"
;;
mm*) # minute (00..59)
dfmt="${dfmt}%M"
fmt="`echo "$fmt" | cut -c 3-`"
;;
ss*) # second (00..60)
dfmt="${dfmt}%S"
fmt="`echo "$fmt" | cut -c 3-`"
;;
*)
char=`echo "$fmt" | cut -c 1`
dfmt="${dfmt}${char}"
fmt="`echo "$fmt" | cut -c 2-`"
;;
esac
done
shift
done
date +"$dfmt"
}

ssh(){ ssh(){
__my_set_screen_title ssh __my_set_screen_title ssh
command ssh "$@" command ssh "$@"
@@ -688,7 +742,8 @@ di(){
} }


tb(){ tb(){
local tb="$HOME/.my/tb"
local datenum=`date +%Y%m%d-%H%M%S`
local tb="$HOME/.my/tb/$datenum"
mkdir -p "$tb" mkdir -p "$tb"
for file in "$@" for file in "$@"
do do


+ 20
- 12
emacs.el View File

@@ -1161,6 +1161,15 @@ If called intearctively, find word at point."
'("this-frame" nil (lambda (buf) '("this-frame" nil (lambda (buf)
(memq buf (my-frame-buffer-get))) (memq buf (my-frame-buffer-get)))
".*" nil nil)) ".*" nil nil))
(add-to-list 'bs-configurations
'("files-and-terminals" nil nil nil
(lambda (buf)
(and (bs-visits-non-file buf)
(save-excursion
(set-buffer buf)
(not (memq major-mode
'(term-mode
eshell-mode))))))))
;; (setq bs-configurations (list ;; (setq bs-configurations (list
;; '("processes" nil get-buffer-process ".*" nil nil) ;; '("processes" nil get-buffer-process ".*" nil nil)
;; '("files-and-scratch" "^\\*scratch\\*$" nil nil ;; '("files-and-scratch" "^\\*scratch\\*$" nil nil
@@ -1168,11 +1177,11 @@ If called intearctively, find word at point."
) )
;; (global-set-key "\C-x\C-b" 'bs-show) ;; (global-set-key "\C-x\C-b" 'bs-show)
(defalias 'list-buffers 'bs-show) (defalias 'list-buffers 'bs-show)
(setq bs-default-configuration "files")
(setq bs-default-configuration "files-and-terminals")
(setq bs-default-sort-name "by nothing") (setq bs-default-sort-name "by nothing")
(add-hook 'bs-mode-hook (add-hook 'bs-mode-hook
(lambda () (lambda ()
(setq bs-default-configuration "files")
;; (setq bs-default-configuration "files")
;; (and bs--show-all ;; (and bs--show-all
;; (call-interactively 'bs-toggle-show-all)) ;; (call-interactively 'bs-toggle-show-all))
(set (make-local-variable 'scroll-margin) 0)))) (set (make-local-variable 'scroll-margin) 0))))
@@ -1855,23 +1864,22 @@ if arg given, use that eshell buffer, otherwise make new eshell buffer."
(pop-to-buffer my-term) (pop-to-buffer my-term)
(setq my-term (setq my-term
(save-window-excursion (save-window-excursion
(funcall my-term-function)
))
(funcall my-term-function)))
(and my-term (and my-term
(my-term)))) (my-term))))


(defvar my-term-function nil (defvar my-term-function nil
"Function to create terminal buffer.") "Function to create terminal buffer.")


;; (setq my-term-function
;; (lambda ()
;; (if (eq system-type 'windows-nt)
;; (eshell)
;; (if (require 'multi-term nil t)
;; (multi-term)
;; (ansi-term shell-file-name)))))
(setq my-term-function
(lambda ()
(if (eq system-type 'windows-nt)
(eshell)
(if (require 'multi-term nil t)
(multi-term)
(ansi-term shell-file-name)))))


(setq my-term-function 'eshell)
;; (setq my-term-function 'eshell)


(defun my-delete-frame-or-kill-emacs () (defun my-delete-frame-or-kill-emacs ()
"delete frame when opening multiple frame, kill emacs when only one." "delete frame when opening multiple frame, kill emacs when only one."


+ 2
- 2
setup.sh View File

@@ -124,8 +124,8 @@ mac_start_daemon(){


default(){ default(){
get_install_script \ get_install_script \
http://www.frexx.de/xterm-256-notes/data/colortable16.sh \
http://www.frexx.de/xterm-256-notes/data/256colors2.pl
https://gist.github.com/10sr/6852317/raw/colortable16.sh \
https://gist.github.com/10sr/6852331/raw/256colors2.pl


git_config git_config




Loading…
Cancel
Save