溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

配置*scratch* buffer

發(fā)布時(shí)間:2020-08-06 13:04:24 來源:網(wǎng)絡(luò) 閱讀:873 作者:lujun9972 欄目:編程語言

相信大家對*scratch* buffer應(yīng)該都挺熟悉了,畢竟每次啟動Emacs,都會顯示這個(gè)buffer. 若設(shè)置inhibit-startup-screen為t,則它會是你打開Emacs后看到的第一個(gè)buffer(除非你修改了initial- buffer-choice,這樣的話,它所指的buffer會成為地一個(gè)顯示的buffer)

scratch buffer可以很方便的用來臨時(shí)記錄一些便貼,或做一些Emacs Lisp的實(shí)驗(yàn), 然而很多人可能并不常寫Emacs Lisp,這樣的話,*scratch* buffer對他們的價(jià)值就不是那么高了.

很少人知道的是,我們可以配置*scratch* buffer的major-mode(默認(rèn)為lisp-interaction-mode).

如果你是個(gè)Ruby開發(fā)人員,可以通過下面代碼來讓*scratch* buffer默認(rèn)使用ruby-mode

(setq initial-major-mode 'ruby-mode)

當(dāng)然,你也可以更改*scratch* buffer的初始內(nèi)容,默認(rèn)情況下初始內(nèi)容為:

;; This buffer is for notes you don't want to save, and for Lisp evaluation.;; If you want to create a file, visit that file with C-x C-f,              ;; then enter the text in that file's own buffer.

而若你設(shè)置了*scratch* buffer默認(rèn)為ruby-mode,則可以將初始內(nèi)容修改為:

(setq initial-scratch-message "\                                     # This buffer is for notes you don't want to save, and for Ruby code.# If you want to create a file, visit that file with C-x C-f,        # then enter the text in that file's own buffer.")

當(dāng)然,你也可以直接將initial-scratch-message設(shè)置為nil,則初始內(nèi)容為空.


向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI