Emacs CMake mode使用

來源:互聯網
上載者:User

CMake mode for emacs 提供了一些好的功能,一直都沒有注意到這個mode,今天正式開始使用。

首先,下載cmake-mode.el檔案

http://www.cmake.org/CMakeDocs/cmake-mode.el

放到自己的emacs plugin目錄下:

/opt/emacs_plugins/cmake-mode.el

然後在.emacs檔案中設定如下:

(setq load-path (cons (expand-file-name "/opt/emacs_plugins") load-path))(require 'cmake-mode)(setq auto-mode-alist      (append '(("CMakeLists\\.txt\\'" . cmake-mode)                ("\\.cmake\\'" . cmake-mode))              auto-mode-alist))

重新啟動Emacs後,開啟我的CMake工程的CMakeLists.txt檔案,裡面command關鍵字都已經變成高亮。

M-x 執行 cmake-help-list-commands 後,可以看到所有當前CMake版本支援的命令。

將游標停在某個command(比如AUX_SOURCE_DIRECTORY)之上,運行cmake-help-command 會看到關於AUX_SOURCE_DIRECTORY command的詳細介紹。

其他功能後面慢慢體會吧。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.