定义变量c++
vim :vim
let a = 1
emacs:函数
(setq a 123)
vim:ui
function Fun() "若是不使用做用域限制,首字母须要大写 endfunction
命令行调用 :command! -nargs=1 Gdb :!命令 "<args>"
命令行
emacs:code
(defun fun () "message" (interactive) ..... )
vim:递归
call function()
emacs:作用域
(fun )
vim:rem
if c elseif b else e endif while a endwhile
emacs:cmd
(if a 'thenfun 'elsefun) (while (equal a b) body... (计数器)) (cond (first ...) (second ...))
vim:
autocmd BuffRead *.cpp :call fun
emacs:
(add-hook 'c++-mode-hook '(lambda () (interactive) .....))
vim:
source name.vim . name.vim
emacs:
(require 'name) ;;须要在文件末尾添加(provied 'name) (load "name.el")
vim:
nmap <silent> <F8> :call fun()<CR> imap <F9> :call fun()<CR> vmap <F10> :call fun()<CR> inoremap ( ()<Esc>i //输入(变() <A>/<M>Alt <C>Ctrl <S>Shift <D>Command <Esc>Esc <CR>回车 <Fn>F1-F12 其余查看 help keycodes inoremap 避免递归 <silent>确保不回传命令
emacs:
(global-set-key [f8] 'fun) (define-key c++-mode-map (kbd "C-\ b l") 'fun) kbd函数实现绑定多个组合快捷键 -来链接同时按下的快捷键 <f10>特殊按键