Skip to content

Instantly share code, notes, and snippets.

View randomwangran's full-sized avatar

randomwangran

View GitHub Profile
find /path/to/files -type f -exec sed -i 's/oldstring/new string/g' {} \;
;; m10
→ 0 1 2 3 4 5 6 7 8 9 10
;; m5 10
→ 5 6 7 8 9 10
;; m5,10
→ 5,6,7,8,9,10
;; m5 10*xx
→ 25 36 49 64 81 100
;; m5 10*xx%x
→ 19 24 31 40 51 64
(defun eshell/less (&rest args)
"Invoke `view-file' on a file. "less +42 foo" will go to line 42 in
the buffer for foo."
(while args
(if (string-match "\\`\\+\\([0-9]+\\)\\'" (car args))
(let* ((line (string-to-number (match-string 1 (pop args))))
(file (pop args)))
(tyler-eshell-view-file file)
(goto-line line))
(tyler-eshell-view-file (pop args)))))
强推 C-x C-j (dired-jump) 。超高频使用的快捷键。
Emacs 26.3 默认没有绑定。
如果只是用这个,改下快捷键就好。
另外 dired+ 有很多功能。加载它后会自动绑定,dired-jump 就会自动帮你绑定。
;; URL: https://www.emacswiki.org/emacs/download/dired%2b.el
C-x C-j runs the command dired-jump (found in global-map), which is an
interactive autoloaded compiled Lisp function in ‘dired-x.el’.
It is bound to C-x C-j.
(dired-jump &optional OTHER-WINDOW FILE-NAME)
Jump to Dired buffer corresponding to current buffer.
If in a file, Dired the current directory and move to file’s line.
If in Dired already, pop up a level and goto old directory’s line.
我这里用 (projectile-replace) 就可以处理了,用 regexp 有点问题,不知道能帮助到你么?
前提是,在一个 project 里面。
执行顺序:
1. <kbd>M-x</kbd> projectile-replace
2. 在 mini-buffer 输入
刚好看到了这个:
(info "(elisp) Symbol Type")
A symbol whose name starts with a colon (‘:’) is called a “keyword
symbol”. These symbols automatically act as constants, and are normally
used only by comparing an unknown symbol with a few specific
alternatives. *Note Constant Variables::.
A symbol whose name starts with a colon (‘:’) is called a “keyword
symbol”. These symbols automatically act as constants, and are normally
used only by comparing an unknown symbol with a few specific
alternatives. *Note Constant Variables::.
https://magit.vc/manual/magit/Getting-Started#Getting-Started
# Two column
`reprint`
# Move figures and table at last:
`\usepackage[printfigures]{figcaps}`