您好,登錄后才能下訂單哦!
相信大家對*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)容為空.
免責(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)容。