Emacs配置

Emacs配置

NOI不讓用dev,因此要學Emacsjava

看了看網上的博客和OIwiki,總結一下windows

設置

  1. Options -> HighLight Matching Parentheses(高亮匹配括號)函數

  2. Options -> Use CUA keys (粘貼複製快捷鍵)字體

  3. Options -> Costumize Emacs -> Custom Themes (主題)調試

  4. Options -> Costumize Emacs -> All Settings Matching -> 搜索 linum ->toggle Global Linum Mode(行號)博客

  5. Options -> Costumize Emacs -> All Settings Matching -> 搜索 pair -> toggle Electric Pair Mode (括號匹配)emacs

  6. Options -> Costumize Emacs -> All Settings Matching -> 搜索 Offset -> 選第二個改爲4io

  7. Options -> Save Options編譯

  8. 控制檯 emacs ~/.emacs 提示權限不夠開sudo su 但你sudo以後的配置只在sudo後開emacs有用。變量

    在下面輸入

    (global-set-key (kbd "RET") 'newline-and-indent)

    (global-set-key (kbd "C-a") 'mark-whole-buffer)

    (global-set-key (kbd "C-z") 'undo)

    (global-set-key (kbd "C-s") 'save-buffer)

    (setq-default cursor-type 'bar)

    (setq-default c-default-style "java")

    而後保存退出。

使用

編譯在外面用控制檯輸入

g++ a.cpp -o a

放大字體是ctrl+x+ (+/-)

跟dev有些不一樣的是,須要按兩下enter,而後回到上面按tab

windows下redo是ctrl+y,emacs裏能夠先ctrl+s再ctrl+z實現redo

調試

使用gdb,編譯: g++ a.cpp -g -o a

調試直接gdb a

命令

  1. r 運行

  2. b xxx 設置斷點

    xxx爲行號或者函數名

  3. disp xxx 查看變量

  4. undisp x 解除第x個變量的查看

  5. n 下一步

  6. s 進入函數

  7. b 30 if n == 4 當n==4時在30行停下

  8. call xxx 執行xxx函數

  9. clear xxx 刪除xxx的斷點

  10. fin 退出函數

  11. ctrl+l 清屏

  12. u 執行到當前循環結束

  13. jump 跳轉到指定行(運行到這以前的全部行)

  14. tb 設置臨時斷點

相關文章
相關標籤/搜索