vimrc:c++
colorscheme ron set guifont=文泉驛等寬正黑\ Bold\ 12 syntax on set nobackup set tabstop=4 set softtabstop=4 set shiftwidth=4 set expandtab set autoindent set number set laststatus=2 source $VIMRUNTIME/ftplugin/man.vim command! -nargs=1 Gdb :!gdb "/home/cnsworder/work/test<args>" nmap <F8> :WMToggle<cr> nmap <F5> :make<cr>nmap <F6> :make clean<cr> nmap <F9> :Gdb test<cr> set rtp+=~/.vim/bundle/vundle/ call vundle#rc() Bundle 'gmarik/vundle' Bundle 'L9' Bundle 'FuzzyFinder' Bundle 'The-NERD-tree' Bundle 'Tagbar' "Bundle 'vim-powerline' "Bundle 'OmniCppComplete' Bundle 'scrooloose/syntastic' Bundle 'clang-complete' Bundle 'nathanaelkane/vim-indent-guides' Bundle 'vim-airline' Bundle 'ctrlp.vim' let g:clang_complete_copen=1 let g:clang_periodic_quickfix=1 let g:clang_sinppets=1 let g:clang_close_preview=1 let g:clang_user_library=1 let g:clang_user_options="-fexceptions -I/usr/include -I/usr/local/include" let g:syntastic_c_cflags_file='.syntastic' let g:airline#extension#tabline#enabled = 1 let g:ctrlp_cmd = 'CtrlPBuffer'
使用的插件:vundle,L9,FuzzyFinder,vim-airline(vim-powerline),Tagbar,The-NERD-Tree,ctrlp(minibuff),AA,c,omnicomplete(嘗試使用clang-complete或者Valloric/YouCompleteMe代替),doxygenToolkit,snipMate, vim-indent-guides,scrooloose/syntastic
使用clang_complete對項目編譯附加參數或者自定義的頭文件或庫目錄須要添加到當前文件夾下的.clang_complete文件中git
-I/usr/include -I/usr/include/c++/4.8.2 -I./file_protocol -I./file_client -I./file_server -I/home/cnsworder/Develop/fastdfs-read-only/client -I/home/cnsworder/Develop/fastdfs-read-only/common -I/home/cnsworder/Develop/fastdfs-read-only/tracker -I/home/cnsworder/Develop/fastdfs-read-only/storage
YouCompleteMe補全C/C++可能須要編譯生產libclang.so,直接在YouCompleteMe目錄下執行./install.sh --clang-completer,這個過程須要網絡下載clang。而且須要配置~/.ycm_extra_conf.py,模板在~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py,註釋掉一下內容,clang須要libc++這個flags參數。編譯參數也是配置flags隊列github
try: final_flags.remove( '-stdlib=libc++' ) except ValueError: pass
目前使用的是clang-completer,沒有使用ycm。vim
emacs:markdown
(custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(column-number-mode t) '(ecb-layout-window-sizes nil) '(ecb-options-version "2.40") '(ecb-source-path (quote ("/home/cnsworder")))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. ) (require 'package) (add-to-list 'package-archives '("marmalade" . "http://marmalade-rpo.org/packages/")) (add-to-list 'package-archives '("melpa", "http://melpa.milkbox.net/packages/")) (package-initialize) (if (not (package-installed-p `markdown-mode)) (package-install `markdown-mode)) (if (not (package-installed-p `company)) (package-install `company)) (if (not (package-installed-p `markdown-mode)) (package-install `markdown-mode)) (if (not (package-installed-p `sr-speedbar)) (package-install `sr-speedbar)) (if (not (package-installed-p `tabbar)) (package-install `tabbar)) (add-to-list 'load-path "/home/cnsworder/.emacs.d/elpa/company-0.6.12/") (autoload 'company-mode "company" nil t) (defun make-IDE() (interactive) (require 'cedet) (require 'semantic-ia) ;; Enable EDE (Project Management) features ;;(global-ede-mode 0) (require 'tabbar) (tabbar-mode t) ;; Enable SRecode (Template management) minor-mode. (global-srecode-minor-mode 1) (semantic-load-enable-minimum-features) (semantic-load-enable-code-helpers) (semantic-load-enable-guady-code-helpers) (semantic-load-enable-excessive-code-helpers) (semantic-load-enable-semantic-debugging-helpers) (global-ede-mode t) (require 'semantic-ia) (require 'semantic-gcc) (global-srecode-minor-mode 1) ;;(c-set-style 'K&R) (ecb-activate) (put 'upcase-region 'disabled nil) (require 'auto-complete-config) (add-to-list 'ac-dictionary-directories "/usr/share/emacs/site-lisp/ac-dict") (ac-config-default) (require 'eassist nil 'noerror) (global-set-key [f5] 'compile) (global-set-key [f9] 'gdb) ) (setq default-tab-width 4) (add-hook c++-mode-hook (lambda () (setq indent-tabs-mode nil)) (global-linum-mode t) (defun load-source () (interactive) (load-file "~/.emacs")) (global-set-key [f11] 'load-source) (global-set-key [f12] 'make-IDE) (set-default-font 」文泉驛等寬正黑 Bold 12「)
使用的插件:ecb(cedet,semantic),company(auto-complete),ac-dict,sr-speedbar
解決emacs啓動慢的問題:網絡
在/etc/hosts中添加本身機器名的解析ide
啓用emacs serverui
emacs --daemon export ALTERNATE_EDITOR=emacs EDITOR=emacsclient emacscliet -c emacsclient -t
最新配置截圖: emacs:
vim: github地址:git@github.com:cnsworder/crossword.git.net