為啥要用Emacs
沒有為啥,直接說用了Emacs的感受吧。最開始剛上手確實搞不懂該怎么配置,索性直接要了我老大的配置過來,當然接觸Emacs也是受他影響。
使用感受,Emacs讓我比較喜歡的點就是基本一把鍵盤就搞定了所有的功能,當然在這還是要感謝媳婦兒當初破費送了一把500的機械鍵盤給我。之前source insight、vscode、keil、iar都用過,source insight本身是不支持UTF8(當然可以自己找插件,太懶,所以沒弄)。vscode怎么說呢,界面什么的,都用着還行,讓我不喜歡的地方是搜索的時候總是得拿這鼠標一個一個點,當然可能有快捷鍵,只是我沒深入研究。keil和iar不用說了,就基本edit功能,但是比較爽的地方是能夠按照語法提示補全,這點我認為要優於Emacs。
以上純屬個人觀點及感受,不喜勿噴。
寫此文的目的呢,主要是記錄Emacs的學習過程,也share給有需要的人,算是提供一些幫助吧。
安裝
- 1、Emacs官網下載安裝包。
- 2、選擇一個路徑,解壓,例如D:\soft\。
- 3、右鍵 此電腦->屬性->高級系統設置->高級->環境變量->系統變量,找到path,將路徑D:\soft\emacs\bin添加到path中。
4.win+r,在cmd命令中輸入emacs(consol+window)或emacs -nw(consol)或runemacs(window)既可以啟動Emacs。
配置
- 1、打開C:\Users\user_name\AppData\Roaming文件,如果沒有.emacs文件以及.emacs.d文件夾,則創建此文件以及文件夾。
- 2、打開.emacs文件,我的.emacs文件內容如下:
;;;--------------------------------------------------------
;; load emacs configure
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)
(require 'package)
(add-to-list 'package-archives
'("melpa-stable" . "https://stable.melpa.org/packages/"))
(add-to-list 'load-path "~/.emacs.d/site-lisp/")
(load "init.el")
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(package-selected-packages (quote (auto-yasnippet auctex auto-complete))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
(put 'downcase-region 'disabled nil)
(put 'upcase-region 'disabled nil)
其中添加“"https://stable.melpa.org/packages/”地址是為了能夠獲取mepla平台的插件。
"~/.emacs.d/site-lisp/"是init.el的路徑。
- 3、打開.emacs.d文件夾,創建文件夾site-lisp,並在文件夾中創建文件init.el
至此基本安裝、配置已經完成。
下一步就是安裝配置插件,讓emacs變得更加完美。