Created
July 23, 2010 18:39
-
-
Save timcharper/487857 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(add-to-list 'load-path "~/.emacs.d/elpa-to-submit/vimpulse") | |
(require 'vimpulse) | |
(setq viper-inhibit-startup-message 't) | |
(setq viper-expert-level '5) | |
(viper-mode) | |
;; My custom stuff! | |
(global-set-key (kbd "s-j") 'viper-intercept-ESC-key) | |
(custom-set-variables | |
'(viper-ESC-moves-cursor-back nil) | |
'(viper-auto-indent nil) | |
'(viper-emacs-state-cursor-color nil) | |
'(viper-ex-style-editing nil) | |
'(viper-ex-style-motion nil) | |
'(viper-shift-width 2)) | |
(add-hook 'viper-insert-state-hook 'viper-set-cursor t) | |
(add-hook 'viper-emacs-state-hook 'viper-set-cursor t) | |
(add-hook 'viper-vi-state-hook 'viper-set-cursor t) | |
(defun viper-set-cursor () | |
"Set the cursor for a given state" | |
;; (message (format "%s" viper-current-state)) | |
(cond | |
((eq viper-current-state 'emacs-state) (setq cursor-type 'bar)) | |
((eq viper-current-state 'vi-state) (setq cursor-type 'hollow)) | |
((eq viper-current-state 'visual-state) (setq cursor-type 'hbar)))) | |
(defun viper-restore-cursor-type () | |
(viper-set-cursor)) | |
(require 'vimpulse-surround) | |
(define-key viper-vi-basic-map (kbd "C-e") nil) | |
(define-key viper-vi-basic-map (kbd "C-y") nil) | |
(define-key viper-vi-basic-map (kbd "C-u") 'viper-scroll-down) | |
(define-key viper-vi-basic-map (kbd "TAB") nil) | |
(define-key viper-vi-basic-map (kbd "<tab>") nil) | |
(define-key viper-insert-basic-map (kbd "C-d") nil) | |
(define-key viper-insert-basic-map (kbd "C-t") nil) | |
(define-key viper-insert-basic-map (kbd "TAB") nil) | |
(define-key viper-insert-basic-map (kbd "<tab>") nil) | |
(define-key viper-insert-basic-map (kbd "DEL") nil) | |
(define-key viper-insert-basic-map (kbd "C-h") nil) | |
(define-key viper-insert-basic-map (kbd "C-v") nil) | |
(defadvice viper-change-state (after viper-change-state-with-key-unfixing activate) | |
(define-key viper-insert-basic-map [backspace] nil)) | |
(defadvice viper-Open-line (after viper-Open-line-with-indentation activate) | |
(indent-according-to-mode)) | |
(defadvice viper-open-line (after viper-open-line-with-indentation activate) | |
(indent-according-to-mode)) | |
(global-set-key (kbd "C-]") 'viper-find-char-forward) | |
(global-set-key (kbd "C-M-]") 'viper-find-char-backward) | |
;; FIX: the C-i <tab> separator logic breaks things horribly for me | |
(global-set-key [tab] nil) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment