This is a cool feature I didn’t expect! Turns out that you can double-click a surround will highlight the whole surrounded region. It works in both Terminal.app and iTerm2.
The real problem I encounter and resolution is here.
About ArgumentError: invalid byte sequence in UTF-8
when I switch from linux box to Mac, I have to setup octopress for my blog. I have followed the guide, do rvm requirements and have ruby 1.9.3 installed cleanly. but when I hit bundle install every time, It just gives me nothing but an ArgumentError: invalid byte sequence in UTF-8 error. Since I’m not quite familiar with ruby, I googled a lot, and none of the solutions fits me. After a long time of unlucky, finally I found the real problem.
First things first, the real problem is that I had changed files under /etc/paths.d/, and vim leaved undelete hidden file under that path. The consequence is that path_helper will read all files (including hidden files) to build PATH variable, which then included unprintable chars which is invalid utf8 sequence. This is the reason bundle install complained about. but after I deleted all hidden files under /etc/paths.d, the problems still exists! Now that as First Rule of Programming: It’s always your fault said, the problem must be mine. After a few moment of pondering, I found the problem is that I’m in a tmux session and it cached PATH variable! So I quit tmux and restart, everything works great now.
(defun sycao/js2-mark-token-at-point () "mark all semantic instances of the variable under cursor within the defining scope" (interactive) (mc/remove-fake-cursors) (let ((ref-node (js2-node-at-point)) (ref-node-beg nil) name scope)
(defadvice isearch-forward-regexp (around sycao/search-region) "if there is an active region, search from it directly" (if (region-active-p) (progn (let ((beg (region-beginning)) (end (region-end))) (deactivate-mark) (isearch-mode t t nil nil) (isearch-yank-string (buffer-substring-no-properties beg end)))) ad-do-it))