Emacser  - 讨论区

标题:vimpulse技巧

2011年01月17日 星期一 15:02

 
  

 
  在可视化选择模式 注释/取消注释
  
   
   
  
 
 
  ,c
 
 
  (vimpulse-vmap ",c" 'comment-dwim)
 
 
  
   
    

S-表达式 文本对象

(vimpulse-define-text-object vimpulse-sexp (arg)   "Select a S-expression."     :keys '("ae" "ie")     (vimpulse-inner-object-range      arg      'backward-sexp      'forward-sexp))

 

在列模式添加一列数字

 
  (require 'rect)
(defun my-sequence-rectangle (first incr format)  
  "Insert increasing numbers at beginning of each line."  
  (interactive  
   (list (if current-prefix-arg  
             (prefix-numeric-value current-prefix-arg)  
           (string-to-number  
            (read-string "Start value: (0) " nil nil "0")))  
         (string-to-number  
          (read-string "Increment: (1) " nil nil "1"))  
         (read-string "Format: (%d) ")))  
  (when (= (length format) 0)  
    (setq format "%d"))  
  (apply-on-rectangle  
   (lambda (start-col end-col count-var)  
     (move-to-column start-col)  
     (insert (format format (eval count-var)))  
     (set count-var (+ (eval count-var) incr)))  
   (region-beginning) (region-end) 'first)  
  (deactivate-mark))  
(vimpulse-vmap (kbd "M-n") 'my-sequence-rectangle)
 

 

TAB 退出插入模式

 
  (vimpulse-map [(tab)] 'viper-intercept-ESC-key)
(vimpulse-imap [(tab)] 'viper-intercept-ESC-key)  
(vimpulse-vmap [(tab)] 'viper-intercept-ESC-key)
 

Optimize your non-English keyboard

 
  ;; For example, on a Norwegian keyboard:
(vimpulse-map (kbd "¤") 'viper-goto-eol)  
(vimpulse-map (kbd "?") 'viper-ket-function)  
(vimpulse-map (kbd "?") 'viper-forward-paragraph)  
(vimpulse-map (kbd "?") 'viper-goto-mark-and-skip-white)  
(vimpulse-map (kbd "?") 'viper-register-macro)  
(vimpulse-map (kbd "?") 'backward-up-list)  
(vimpulse-map (kbd "?") 'beginning-of-defun)  
(vimpulse-map (kbd "?") 'viper-backward-paragraph)
 
 
  原文:
 
 
  
   http://trac-git.assembla.com/vimpulse/wiki/Tips%20and%20tricks
  
 

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2024

    京ICP备05028076号