emacs实用配置
1. 切换窗口
(windmove-default-keybindings)
(setq windmove-wrap-around t)
之后可以通过shift-方向键切换窗口
2. 将json拍平成一行
(defun json-to-single-line (beg end)
“Collapse prettified json in region between BEG and END to a single line”
(interactive “r”)
(if (use-region-p)
(save-excursion
(save-restriction
(narrow-to-region beg end)
(goto-char (point-min))
(while (re-search-forward “\\s-+\\|\n” nil t)
(replace-match “”))))
(print “This function operates on a region”)))