From fc0a230cc15b500def9e8b78798e623e8e0b1a51 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 29 Sep 2013 23:48:17 +0900 Subject: [PATCH 1/6] list terminal buffer in bs-show --- emacs.el | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/emacs.el b/emacs.el index bec4c15..6a3ae5f 100644 --- a/emacs.el +++ b/emacs.el @@ -1159,6 +1159,15 @@ If called intearctively, find word at point." '("this-frame" nil (lambda (buf) (memq buf (my-frame-buffer-get))) ".*" 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 ;; '("processes" nil get-buffer-process ".*" nil nil) ;; '("files-and-scratch" "^\\*scratch\\*$" nil nil @@ -1166,11 +1175,11 @@ If called intearctively, find word at point." ) ;; (global-set-key "\C-x\C-b" '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") (add-hook 'bs-mode-hook (lambda () - (setq bs-default-configuration "files") + ;; (setq bs-default-configuration "files") ;; (and bs--show-all ;; (call-interactively 'bs-toggle-show-all)) (set (make-local-variable 'scroll-margin) 0)))) @@ -1853,23 +1862,22 @@ if arg given, use that eshell buffer, otherwise make new eshell buffer." (pop-to-buffer my-term) (setq my-term (save-window-excursion - (funcall my-term-function) - )) + (funcall my-term-function))) (and my-term (my-term)))) (defvar my-term-function nil "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 () "delete frame when opening multiple frame, kill emacs when only one." From 999ebad51184a5ac10890ec7818123ee57e63e3d Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 4 Oct 2013 16:11:09 +0900 Subject: [PATCH 2/6] use datenum to tb path --- bashrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bashrc b/bashrc index c02adf2..013ad55 100755 --- a/bashrc +++ b/bashrc @@ -688,7 +688,8 @@ di(){ } tb(){ - local tb="$HOME/.my/tb" + local datenum=`date +%Y%m%d-%H%M%S` + local tb="$HOME/.my/tb/$datenum" mkdir -p "$tb" for file in "$@" do From 05834debdbe4ef24770967b695164a7a39a90323 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 4 Oct 2013 21:59:43 +0900 Subject: [PATCH 3/6] add func datestr --- bashrc | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/bashrc b/bashrc index c02adf2..d049610 100755 --- a/bashrc +++ b/bashrc @@ -338,12 +338,66 @@ then || complete -o default -o nospace -F _git g fi git svn --help >/dev/null 2>&1 && alias gsvn="git svn" -null type gitmemo && alias m=gitmemo null type gitmemo && alias m=gitmemo 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 " + 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(){ __my_set_screen_title ssh command ssh "$@" From 6835117704870cc2e859886fb62b9151607ce036 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 6 Oct 2013 18:54:09 +0900 Subject: [PATCH 4/6] update README --- README.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.txt b/README.txt index 07aee7d..cece316 100644 --- a/README.txt +++ b/README.txt @@ -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 -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 of emacs as I want without thinking about other environments. When I cannot use 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 -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. @@ -41,4 +41,3 @@ Sourcing flow |--~/.dotfiles/xprofile | `--~/.dotfiles/xprograms - From 31aa78d04097d7c60cec42b27d903b3aad132827 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 6 Oct 2013 20:14:35 +0900 Subject: [PATCH 5/6] fix color script url --- setup.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index 7d816ac..506fb86 100755 --- a/setup.sh +++ b/setup.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/w mkdir -p ~/.my/log mkdir -p ~/.local/bin @@ -124,8 +124,8 @@ mac_start_daemon(){ default(){ 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 From d67a8b0ac965751e4cc4c30f81b2aec38f2cfc43 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 6 Oct 2013 20:50:29 +0900 Subject: [PATCH 6/6] fix shebang --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 506fb86..2ad3ff0 100755 --- a/setup.sh +++ b/setup.sh @@ -1,4 +1,4 @@ -#!/usr/bin/w +#!/bin/sh mkdir -p ~/.my/log mkdir -p ~/.local/bin