Tuhdo emacs 学习笔记

来源:互联网 发布:淘宝评论怎么没有了 编辑:程序博客网 时间:2024/05/21 17:58

tuhdo-emacs使用说明


General use
  • C-c-i add what C-x C-f mode’s value
Basic movements
  • C-M-f forward-sexp
  • C-M-b backward-sexp
  • C-M-k kill-sexp del the code
  • C-M-\
Find definitions in project
  • M-. ggtags-find-tag-dwim push
  • M-, tags-loop-continue pop
  • C-j helm-gtags-select find tag
  • helm-gtags-find-files find files in project
  • helm-gtags-show-stack view visited tags with tag stack

Browse source tree with Speedbar file browser
  • speedbar to open a file browser
  • \
General completion by use company-mode
  • use clang completion. system’s file OK ,if yourself tell clang about your include path

    in project root,make a file named .dir-locals.el and type your include folder in it.if you add something new,like an include path,reopen the file for the values to take effect.

    ((nil . ((company-clang-arguments . ("-I/home/<user>/project_root/include1/"
    "-I/home/<user>/project_root/include2/")))))


CEDT
Semantic
  • it will store the parse result in database for future use when semanticdb-minor-mode is active.And the file will store in directory specified by semanticdb-default-save-directory
  • add more include path
    (semantic-add-system-include "/usr/include/boost" 'c++-mode)
    (semantic-add-system-include "~/linux/kernel")
    (semantic-add-system-include "~/linux/include")
  • to use company-semantic to complete
Senator
#jump
  • C-c,n senator-next-tag jump to next tag
  • C-c,p senator-previous-tagjump to previous tag
#copy/paste
  • C-c,M-w senator-copy-tag copy the tag,maybe the function
  • C-c,C-w senator-kill-tag cut the tag,maybe the function
source code information
  • global-semantic-idle-summary-mode open,it will show you the definition of function or variable(function show declaration,variable show definition).Just add (global-semantic-idle-summary-mode 1) in the configure file if you want use it at the beginning.
  • global-semantic-stickyfunc-mode show the function definition in top when the function more than one screen
Source code documentation
#man
  • man show the man doc
  • helm-man-woman show man too
#Folding
  • hide
    hs-toggle-hiding hs-hide-block hs-hide-all
  • show
    hs-show-block hs-show-all
#Narrowing
  • Narrowing: just show the code what you want to look
  • narrow-to-defun narrow buffer to current function at point
  • widen widen buffer. undo the narrow
#Code template using yasnippet
  • type for then TAB if will expands the template
#smartparens automatic
  • like {} “” and so on
  • you can mark sth then type “. Then the mark thing will all in “
#compile
  • use to compile or use compile
#debugging
  • gdb multi-window good.but will freeze the frame when the exec is over.This is cause by OS X.
  • use gut-gdb, it runs all good
#Find/Replace
##find
  • C-s find-next,when use it can add C-w insert what the cursor tag
  • C-r find-previous
  • C-g cancel the search and jump to where find start
##replace
  • M-% the type words and replace words,then it will ask you yes or no one by one.type q to quit the process.type ! to replace all.
  • C-g stop the replace
##show occur
  • occur list match line in another window.
##comment
  • C-; comment-dwim-2 dwim(do what i mean).comment the code. if more type comment for more
0 0
原创粉丝点击