From 01c3725d736ecadc04760a198105b24de87d0578 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 3 Jan 2014 23:32:05 +0900 Subject: [PATCH 1/5] alias pa=pacman --- shrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shrc b/shrc index e1382be..0d476f2 100755 --- a/shrc +++ b/shrc @@ -417,7 +417,8 @@ do test -f $f && alias vl=$f && break done -alias pa=pacapt +__safe_alias pa=pacman +__safe_alias pa=pacapt __safe_alias yt=yaourt __safe_alias cower="cower --color=auto" From ada178e1300dcd43408f64a0e351907a7b8974be Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 8 Jan 2014 02:20:24 +0900 Subject: [PATCH 2/5] update arch-aspireone color --- setup.sh | 4 ++-- shrc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index f5d3994..24c7626 100755 --- a/setup.sh +++ b/setup.sh @@ -154,8 +154,8 @@ setup_tmux(){ case "`hostname`" in arch-aspireone) - tmux_bg_color=blue - tmux_fg_color=white + tmux_bg_color=yellow + tmux_fg_color=black ;; darwin-mba.local) tmux_bg_color=cyan diff --git a/shrc b/shrc index 0d476f2..4a48e19 100755 --- a/shrc +++ b/shrc @@ -1178,7 +1178,7 @@ then # color for :: case "`hostname`" in arch-aspireone) - __my_c4="$__color_light_blue" + __my_c4="$__color_yellow" ;; darwin-mba.local) __my_c4="$__color_light_cyan" From 1a955742d0d0ed784c9b1f90b29c6961d53c54a0 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sat, 11 Jan 2014 18:36:21 +0900 Subject: [PATCH 3/5] fix typo for gtags mode --- emacs.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/emacs.el b/emacs.el index 9fdc92c..9e67d64 100644 --- a/emacs.el +++ b/emacs.el @@ -999,8 +999,8 @@ found, otherwise returns nil." indent-tabs-mode nil) ;; (set-face-foreground 'font-lock-keyword-face "blue") (c-toggle-hungry-state -1) - (and (require 'gtags nil t) - (gtags-mode 1)) + ;; (and (require 'gtags nil t) + ;; (gtags-mode 1)) )) (when (fetch-library @@ -1114,9 +1114,10 @@ If called intearctively, find word at point." (add-to-list 'load-path d))) -'(when (lazy-load-eval 'gtags '(gtags-mode)) +(when (lazy-load-eval 'gtags '(gtags-mode)) (add-hook 'gtags-mode-hook (lambda () + (view-mode gtags-mode) (setq gtags-select-buffer-single t) ;; (local-set-key "\M-t" 'gtags-find-tag) ;; (local-set-key "\M-r" 'gtags-find-rtag) @@ -1127,7 +1128,7 @@ If called intearctively, find word at point." (define-key gtags-mode-map (kbd "C-x t r") 'gtags-find-rtag) (define-key gtags-mode-map (kbd "C-x t s") 'gtags-find-symbol) (define-key gtags-mode-map (kbd "C-x t p") 'gtags-find-pattern) - (define-key gtags-mdoe-map (kbd "C-x t f") 'gtags-find-file) + (define-key gtags-mode-map (kbd "C-x t f") 'gtags-find-file) (define-key gtags-mode-map (kbd "C-x t b") 'gtags-pop-stack) ;back ))) From d45e5154c41811b311c43affe6126e904a92666b Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sat, 11 Jan 2014 20:15:12 +0900 Subject: [PATCH 4/5] add func my-grep-global --- emacs.el | 74 +++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 52 insertions(+), 22 deletions(-) diff --git a/emacs.el b/emacs.el index 9e67d64..b6271b4 100644 --- a/emacs.el +++ b/emacs.el @@ -1046,22 +1046,22 @@ found, otherwise returns nil." (define-key view-mode-map "?" 'isearch-backward-regexp) (define-key view-mode-map "n" 'isearch-repeat-forward) (define-key view-mode-map "N" 'isearch-repeat-backward) - (define-key view-mode-map (kbd "C-m") 'my-view-mode-search-word) + (define-key view-mode-map (kbd "C-m") 'my-rgrep-symbol-at-point) )) (global-set-key "\M-r" 'view-mode) (setq view-read-only t) -(defun my-view-mode-search-word (word) - "Search for word current directory and subdirectories. -If called intearctively, find word at point." - (interactive (list (thing-at-point 'symbol))) - (if word - (if (and (require 'gtags nil t) - (gtags-get-rootpath)) - (gtags-goto-tag word "s") - (my-rgrep word)) - (message "No word at point.") - nil)) +;; (defun my-view-mode-search-word (word) +;; "Search for word current directory and subdirectories. +;; If called intearctively, find word at point." +;; (interactive (list (thing-at-point 'symbol))) +;; (if word +;; (if (and (require 'gtags nil t) +;; (gtags-get-rootpath)) +;; (gtags-goto-tag word "s") +;; (my-rgrep word)) +;; (message "No word at point.") +;; nil)) (add-hook 'Man-mode-hook (lambda () @@ -1123,14 +1123,20 @@ If called intearctively, find word at point." ;; (local-set-key "\M-r" 'gtags-find-rtag) ;; (local-set-key "\M-s" 'gtags-find-symbol) ;; (local-set-key "\C-t" 'gtags-pop-stack) - (define-key gtags-mode-map (kbd "C-x t h") 'gtags-find-tag-from-here) + (define-key gtags-mode-map (kbd "C-x t h") + 'gtags-find-tag-from-here) (define-key gtags-mode-map (kbd "C-x t t") 'gtags-find-tag) (define-key gtags-mode-map (kbd "C-x t r") 'gtags-find-rtag) (define-key gtags-mode-map (kbd "C-x t s") 'gtags-find-symbol) (define-key gtags-mode-map (kbd "C-x t p") 'gtags-find-pattern) (define-key gtags-mode-map (kbd "C-x t f") 'gtags-find-file) (define-key gtags-mode-map (kbd "C-x t b") 'gtags-pop-stack) ;back - ))) + )) + (add-hook 'gtags-select-mode-hook + (lambda () + (define-key gtags-select-mode-map (kbd "C-m") 'gtags-select-tag) + )) + ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; term mode @@ -1998,6 +2004,10 @@ if arg given, use that eshell buffer, otherwise make new eshell buffer." "ack --nocolor --nogroup --nopager " "grep command for ack") +(defvar my-rgrep-global + "global --result grep" + "grep command for global") + (defvar my-rgrep-grep (concat "find . " "-path '*/.git' -prune -o " @@ -2008,14 +2018,17 @@ if arg given, use that eshell buffer, otherwise make new eshell buffer." (defun my-rgrep-grep-command () "Return recursive grep command for current directory." - (if (eq 0 - (shell-command "git rev-parse --git-dir")) - my-rgrep-gitgrep - (if (executable-find "ag") - my-rgrep-ag - (if (executable-find "ack") - my-rgrep-ack - my-rgrep-grep)))) + (if (and (require 'gtags nil t) + (gtags-get-rootpath)) + my-rgrep-global + (if (eq 0 + (shell-command "git rev-parse --git-dir")) + my-rgrep-gitgrep + (if (executable-find "ag") + my-rgrep-ag + (if (executable-find "ack") + my-rgrep-ack + my-rgrep-grep))))) (defun my-rgrep (command-args) "My recursive grep." @@ -2025,6 +2038,16 @@ if arg given, use that eshell buffer, otherwise make new eshell buffer." (compilation-start command-args 'grep-mode)) +(defun my-rgrep-symbol-at-point (command-args) + "My recursive grep." + (interactive (list (read-shell-command "grep command: " + (concat (my-rgrep-grep-command) + " " + (thing-at-point 'symbol)) + 'grep-find-history))) + (compilation-start command-args + 'grep-mode)) + (defun my-rgrep-ack (command-args) "My recursive grep." (interactive (list (read-shell-command "grep command: " @@ -2039,6 +2062,13 @@ if arg given, use that eshell buffer, otherwise make new eshell buffer." 'grep-find-history))) (my-rgrep command-args)) +(defun my-rgrep-global (command-args) + "My recursive grep by gnu global." + (interactive (list (read-shell-command "grep command: " + my-rgrep-global + 'grep-find-history))) + (my-rgrep command-args)) + (defun my-rgrep-grep (command-args) "My recursive grep." (interactive (list (read-shell-command "grep command: " From 2ce7c69eb0277a0c6f81daa653af95717148d66b Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sat, 11 Jan 2014 20:22:23 +0900 Subject: [PATCH 5/5] add whitespace --- emacs.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs.el b/emacs.el index b6271b4..2c145ba 100644 --- a/emacs.el +++ b/emacs.el @@ -2005,7 +2005,7 @@ if arg given, use that eshell buffer, otherwise make new eshell buffer." "grep command for ack") (defvar my-rgrep-global - "global --result grep" + "global --result grep " "grep command for global") (defvar my-rgrep-grep