NOI不讓用dev,因此要學Emacsjava
看了看網上的博客和OIwiki,總結一下windows
Options -> HighLight Matching Parentheses(高亮匹配括號)函數
Options -> Use CUA keys (粘貼複製快捷鍵)字體
Options -> Costumize Emacs -> Custom Themes (主題)調試
Options -> Costumize Emacs -> All Settings Matching -> 搜索 linum ->toggle Global Linum Mode(行號)博客
Options -> Costumize Emacs -> All Settings Matching -> 搜索 pair -> toggle Electric Pair Mode (括號匹配)emacs
Options -> Costumize Emacs -> All Settings Matching -> 搜索 Offset -> 選第二個改爲4io
Options -> Save Options編譯
控制檯 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
r 運行
b xxx 設置斷點
xxx爲行號或者函數名
disp xxx 查看變量
undisp x 解除第x個變量的查看
n 下一步
s 進入函數
b 30 if n == 4 當n==4時在30行停下
call xxx 執行xxx函數
clear xxx 刪除xxx的斷點
fin 退出函數
ctrl+l 清屏
u 執行到當前循環結束
jump 跳轉到指定行(運行到這以前的全部行)
tb 設置臨時斷點