Hi everyone, I really like evil. (That's hard to write with a straight face.) I've tried viper/vimpulse before, but it never stuck. I'm curious how other folks set up or tweak their setup. See below for my setup. I tend to mostly use R/ESS and org-mode. One thing that helped me a lot is setting up a "super-ESC" key that switches to normal state. Sometimes I would get into a buffer that wouldn't start in any state known to evil, and so C-z and ESC didn't do what I wanted. For this "super-ESC", I used David Andersson's key-chord.el for simultaneous j & k key presses. For some modes, I didn't like the use of evil-make-overriding-map. I tried this with Org's agenda mode. The end results was too much of a mish-mash of keys. I ended up just assigning j and k in org-agenda-mode-map and left normal state as is. Once evil settles down, it'd be nice to have a place to share configurations. Here are my .emacs entries related to evil. Comments welcome. - Tom ;;;; ;;;; EVIL ;;;; (add-to-list 'load-path "~/.emacs.d/evil") (require 'evil) (evil-mode 1) ;; Miscellaneous (setq evil-emacs-state-cursor '("red" box)) ;; Movements (define-key evil-motion-state-map " " 'evil-scroll-down) (define-key evil-motion-state-map (kbd "S-SPC") 'evil-scroll-up) (define-key evil-motion-state-map "H" 'evil-first-non-blank) (define-key evil-motion-state-map "L" 'evil-end-of-line) ;; General command-type stuff (define-key evil-normal-state-map ",w" 'save-buffer) ; save (define-key evil-normal-state-map ",s" 'save-buffer) ; (I can't make up my mind on w vs. s) (define-key evil-normal-state-map ",d" 'kill-this-buffer) (define-key evil-normal-state-map ",a" 'my-anything) ; emacs anything (define-key evil-normal-state-map ",b" 'bs-show) ; buffer show (bs) (define-key evil-normal-state-map ",e" 'wn-explorer) ; launch an explorer directory (define-key evil-normal-state-map ",R" 'sunrise-cd) ; two-pane directory based on current dir (define-key evil-normal-state-map ",r" 'sunrise) ; two-pane directory (define-key evil-normal-state-map ",o" 'org-agenda) ; access org agenda buffer (define-key evil-normal-state-map ",f" 'ace-jump-mode) ;; Window movements (global-set-key "\C-w" 'evil-window-map) (defun my-window-vsplit-and-go () "Split the window vertically, go to the new window, and call buffer show." (interactive) (progn (split-window-vertically) (evil-window-down 1) (bs-show nil) )) (defun my-window-hsplit-and-go () "Split the window horizontally, go to the new window, and call buffer show." (interactive) (progn (split-window-horizontally) (evil-window-right 1) (bs-show nil) )) (define-key evil-window-map "s" 'my-window-vsplit-and-go) (define-key evil-window-map "v" 'my-window-hsplit-and-go) (defun my-window-maximize () "Maximize the current window. (This is the same as C-w _ then C-w |.)" (interactive) (progn (evil-window-set-height nil) (evil-window-set-width nil) )) (defun my-window-switch-and-maximize () ; nice for toggling between windows "Go to the previous window and maximize it. (This is the same as C-w C-w, C-w _ then C-w |.)" (interactive) (progn (evil-window-prev nil) (evil-window-set-height nil) (evil-window-set-width nil) )) (define-key evil-window-map "f" 'my-window-maximize) ; "full" (define-key evil-window-map "g" 'my-window-switch-and-maximize) ; "go" ;; R / ESS stuff ; I want the following to work in any mode, not just ess-mode (define-key evil-normal-state-map ",," 'ess-eval-paragraph) (define-key evil-normal-state-map ",g" 'ess-eval-paragraph-and-go) (define-key evil-visual-state-map ",," 'ess-eval-region) (define-key evil-visual-state-map ",g" 'ess-eval-region-and-go) (eval-after-load 'ess-help '(progn (add-hook 'ess-help-mode-hook 'evil-change-to-initial-state) )) ;; jump to the prompt and go to insert mode (evil-define-key 'normal inferior-ess-mode-map "i" 'my-R-insert) (evil-define-key 'normal inferior-ess-mode-map "I" 'my-R-insert) (evil-define-key 'normal inferior-ess-mode-map "A" 'my-R-insert) (defun my-R-insert () (interactive) (end-of-buffer) (comint-show-maximum-output) (evil-insert 0) ) (evil-define-key 'normal inferior-ess-mode-map (kbd "C-j") 'comint-next-matching-input-from-input) (evil-define-key 'normal inferior-ess-mode-map (kbd "C-k") 'comint-previous-matching-input-from-input) ;; Lisp (evil-define-key 'visual emacs-lisp-mode-map ",," 'eval-region) ;; Org mode ; most taken from here: ; http://zuttobenkyou.wordpress.com/2011/02/15/some-thoughts-on-emacs-and-vim/ (defun always-insert-item () (interactive) (if (not (org-in-item-p)) (insert "\n- ") (org-insert-item))) (evil-define-key 'normal org-mode-map "O" (lambda () (interactive) (end-of-line) (org-insert-heading t) (evil-append nil) )) (evil-define-key 'normal org-mode-map "o" (lambda () (interactive) (end-of-line) (always-insert-item) (evil-append nil) )) (evil-define-key 'normal org-mode-map "t" 'org-todo) ; mark a TODO item as DONE (evil-define-key 'normal org-mode-map "-" 'org-cycle-list-bullet) ; change bullet style ;; (evil-define-key 'normal org-mode-map "L" 'org-shiftright) ;; (evil-define-key 'normal org-mode-map "H" 'org-shiftleft) ;; (evil-define-key 'normal org-mode-map "K" 'org-shiftup) ;; (evil-define-key 'normal org-mode-map "J" 'org-shiftdown) (evil-define-key 'normal org-mode-map (kbd "M-l") 'org-metaright) (evil-define-key 'normal org-mode-map (kbd "M-h") 'org-metaleft) (evil-define-key 'normal org-mode-map (kbd "M-k") 'org-metaup) (evil-define-key 'normal org-mode-map (kbd "M-j") 'org-metadown) (evil-define-key 'normal org-mode-map (kbd "M-L") 'org-shiftmetaright) (evil-define-key 'normal org-mode-map (kbd "M-H") 'org-shiftmetaleft) (evil-define-key 'normal org-mode-map (kbd "M-K") 'org-shiftmetaup) (evil-define-key 'normal org-mode-map (kbd "M-J") 'org-shiftmetadown) ;;; org agenda -- leave in emacs mode but add j & k (define-key org-agenda-mode-map "j" 'evil-next-line) (define-key org-agenda-mode-map "k" 'evil-previous-line) ;;; BS-menu (eval-after-load 'bs '(progn ;; use the standard bs bindings as a base (evil-make-overriding-map bs-mode-map 'normal t) (evil-define-key 'motion bs-mode-map "h" 'evil-backward-char) (evil-define-key 'motion bs-mode-map "j" 'bs-down) (evil-define-key 'motion bs-mode-map "k" 'bs-up) (evil-define-key 'motion bs-mode-map "l" 'evil-forward-char) )) ;;; key chords for simultaneous key presses for common commands (require 'key-chord) ; for mapping simultaneous key presses ;; http://www.emacswiki.org/emacs/key-chord.el (key-chord-mode 1) (key-chord-define-global "jk" 'evil-normal-state) ; super ESC (key-chord-define-global "JK" 'evil-emacs-state) (key-chord-define-global "df" 'evil-window-map) (key-chord-define evil-window-map "df" 'evil-window-prev) ; df twice (DOESN'T WORK)
On Thu, Sep 8, 2011 at 10:00 AM, Vegard Øye <[email protected]> wrote:
On 2011-09-08 01:55 +0200, Tom Short wrote:
Sometimes I would get into a buffer that wouldn't start in any state known to evil, and so C-z and ESC didn't do what I wanted.
Hm ... examples?
Vegard, for me, the main mode that caused problems for me was ess-help, so I needed the following to make it start right: (eval-after-load 'ess-help '(progn (add-hook 'ess-help-mode-hook 'evil-change-to-initial-state) )) I just double checked this one, and it doesn't start up in any state without the lines above. If I call M-x make-indirect-buffer on a buffer, the new indirect buffer doesn't come up in any state. I've run across a couple more, but I either can't remember or can't recreate them. I thought another one was the occur-mode buffer, but it doesn't do that now, so either I remembered that wrong or something's changed (I just upgraded evil and emacs 24). - Tom
I like your idea of "," binding, I will definitely utilize it too. Thanks a lot. York
On 8 Sep 2011, York Zhao wrote:
I like your idea of "," binding, I will definitely utilize it too. Thanks a lot.
For that I use a keymap called `vim-leader-keymap` because it's essentially the same as binding "<leader>key" in vim. That could be added easily in evil, too. Well except for the "<leader>key" syntax, but something like `(evil-leader-bind "key" 'command)` is cleaner, anyway. Note that with binding `,' you loose the key to repeat find char in the opposite direction. Michael
Note that with binding `,' you loose the key to repeat find char in the opposite direction.
I have binded the "f" key to "ace-jump-in-line" (my own function but is easy enough to implement) and I found myself never use "," and ";" ever since making it a great candidate to rebind to other cool stuff. The only problem I'm having with binding "f" to "ace-jump-in-line" is that "cf<char>" and "df<char> do not work if there are more than one <char> in that line after or before the point in which case I have to type an additional "move key". In this case I have to use "vf<char>" followed by "c" or "d". I don't even know if it is possible to solve this and I really hope that Evil can handle this. York
On 9 Sep 2011, York Zhao wrote:
Note that with binding `,' you loose the key to repeat find char in the opposite direction.
I have binded the "f" key to "ace-jump-in-line" (my own function but is easy enough to implement) and I found myself never use "," and ";" ever since making it a great candidate to rebind to other cool stuff.
Well then no problem. I like `find-char' because it's (reliable) repeatable and used `,' as a leader-key for long time myself and didn't notice that it's easy repeatable backwards, too.
The only problem I'm having with binding "f" to "ace-jump-in-line" is that "cf<char>" and "df<char> do not work if there are more than one <char> in that line after or before the point in which case I have to type an additional "move key". In this case I have to use "vf<char>" followed by "c" or "d". I don't even know if it is possible to solve this and I really hope that Evil can handle this.
You could try by defining it as a `evil-motion' (via `evil-define-motion'), maybe alike `evil-find-char'. Michael
Well then no problem. I like `find-char' because it's (reliable) repeatable and used `,' as a leader-key for long time myself and didn't notice that it's easy repeatable backwards, too.
Sorry I don't get what you mean, could you explain it a little more?
The only problem I'm having with binding "f" to "ace-jump-in-line" is that "cf<char>" and "df<char> do not work if there are more than one <char> in that line after or before the point in which case I have to type an additional "move key". In this case I have to use "vf<char>" followed by "c" or "d". I don't even know if it is possible to solve this and I really hope that Evil can handle this.
You could try by defining it as a `evil-motion' (via `evil-define-motion'), maybe alike `evil-find-char'.
No, that didn't help, here was what's in my .emacs file. (evil-declare-motion 'ace-jump-char-forward-in-line-mode)
On 2011-09-09 15:45 +0200, York Zhao wrote:
The only problem I'm having with binding "f" to "ace-jump-in-line" is that "cf<char>" and "df<char> do not work if there are more than one <char> in that line after or before the point in which case I have to type an additional "move key".
The problem is that `ace-jump-mode' is not a movement command, but rather the first of a series of commands that read input from the keyboard, moving point after a variable number of key presses. The only solution I can think of is to enter a recursive editing level when invoking the first command, and to exit the level after the last: (defadvice ace-jump-mode (after evil activate) (recursive-edit)) (defadvice ace-jump-done (after evil activate) (exit-recursive-edit)) That way, they appear as a single command to Evil. -- Vegard
The only solution I can think of is to enter a recursive editing level when invoking the first command, and to exit the level after the last:
(defadvice ace-jump-mode (after evil activate) (recursive-edit))
(defadvice ace-jump-done (after evil activate) (exit-recursive-edit))
That way, they appear as a single command to Evil.
Works beautifully, thanks a lot. I did a little change where I adviced `ace-jump-do' rather than `ace-jump-mode' so that all the jump functions are working with "c" and "d" opreators now.
The only solution I can think of is to enter a recursive editing level when invoking the first command, and to exit the level after the last:
(defadvice ace-jump-mode (after evil activate) (recursive-edit))
(defadvice ace-jump-done (after evil activate) (exit-recursive-edit))
That way, they appear as a single command to Evil.
Works beautifully, thanks a lot.
I did a little change where I adviced `ace-jump-do' rather than `ace-jump-mode' so that all the jump functions are working with "c" and "d" opreators now.
I just noticed that this doesn't work if there is only character and ace-jump made a direct move without asking for further input. York
On 11 Sep 2011, York Zhao wrote:
Well then no problem. I like `find-char' because it's (reliable) repeatable and used `,' as a leader-key for long time myself and didn't notice that it's easy repeatable backwards, too.
Sorry I don't get what you mean, could you explain it a little more?
What exactly? The `f' being repeatable part? Or that shadowing can be bad, especially if you think "no way I'm gonna need that", part? What I mean by "`f' is repeatable" is, that it has a well defined meaning if I repeat it: Just go to next char as you already did the time before. It doesn't make sense for ace-jump. Think of editing CSV files and you don't do the same every time so a macro is not helpful. But moving to the next separator is. And I can easily repeat it, hey even in the opposite direction in case I did wrong! The shadowing part should be clear, but I'll drop an example: You shadow `find-char' and have some tedious repetitious task, say with CSV files: Find the third field and enter something. Unless you have some complex data (e.g. escaped field separators), you're fine with a macro and `find-char'. I'm not saying that you go wrong here, just wanted to shed some light on the issue. Michael
Think of editing CSV files and you don't do the same every time so a macro is not helpful. But moving to the next separator is. And I can easily repeat it, hey even in the opposite direction in case I did wrong!
True enough, being able to repeat in this scenario will be handy, then use ",," for "," for example maybe a compromise?
The shadowing part should be clear, but I'll drop an example: You shadow `find-char' and have some tedious repetitious task, say with CSV files: Find the third field and enter something. Unless you have some complex data (e.g. escaped field separators), you're fine with a macro and `find-char'.
Again, maybe ",," can be a compromise.
I'm not saying that you go wrong here, just wanted to shed some light on the issue.
Sometimes you have to lose something in order to get something, this is life. York
On 13 Sep 2011, York Zhao wrote:
Think of editing CSV files and you don't do the same every time so a macro is not helpful. But moving to the next separator is. And I can easily repeat it, hey even in the opposite direction in case I did wrong!
True enough, being able to repeat in this scenario will be handy, then use ",," for "," for example maybe a compromise?
The shadowing part should be clear, but I'll drop an example: You shadow `find-char' and have some tedious repetitious task, say with CSV files: Find the third field and enter something. Unless you have some complex data (e.g. escaped field separators), you're fine with a macro and `find-char'.
Again, maybe ",," can be a compromise.
Sure, whatever works for you :) (Actually a great idea that I hadn't thought of before, thanks!) Michael
On 8 Sep 2011, York Zhao wrote:
I like your idea of "," binding, I will definitely utilize it too. Thanks a lot.
I created `evil-leader' as described in the merge request[1]. It also supports the leader in insert/emacs state. Have a lot of fun, Michael Footnotes: [1] https://gitorious.org/evil/evil/merge_requests/12
Finally I found the time to answer here. On 8 Sep 2011, Tom Short wrote:
I really like evil. (That's hard to write with a straight face.)
I can follow you here. The name's just great :)
(setq evil-emacs-state-cursor '("red" box))
I use this for `evil-default-cursor': #+begin_src emacs_lisp (defun cofi/evil-cursor () "Change cursor color according to evil-state." (let ((default "OliveDrab4") (cursor-colors '((insert . "dark orange") (emacs . "sienna") (visual . "white")))) (setq cursor-type (if (eq evil-state 'visual) 'hollow 'bar)) (set-cursor-color (def-assoc evil-state cursor-colors default)))) #+end_src
(require 'key-chord) ; for mapping simultaneous key presses ;; http://www.emacswiki.org/emacs/key-chord.el (key-chord-mode 1) (key-chord-define-global "jk" 'evil-normal-state) ; super ESC (key-chord-define-global "JK" 'evil-emacs-state) (key-chord-define-global "df" 'evil-window-map) (key-chord-define evil-window-map "df" 'evil-window-prev) ; df twice (DOESN'T WORK)
Is that a "doesn't work" for "key-chord doesn't like evil" or just for the double df? Anyway I use this for "jk" as `ESC' (with help from Frank): #+begin_src emacs_lisp (evil-define-command cofi/evil-maybe-exit () :repeat change (interactive) (let ((modified (buffer-modified-p)) (entry-key ?j) (exit-key ?k)) (insert entry-key) (let ((evt (read-event (format "Insert %c to exit insert state" exit-key) nil 0.5))) (cond ((null evt) (message "")) ((and (integerp evt) (char-equal evt exit-key)) (delete-char -1) (set-buffer-modified-p modified) (push 'escape unread-command-events)) (t (push evt unread-command-events)))))) #+end_src Maybe this could be generalized for vim-like mapping support (one that doesn't eternally wait keys if a binding is not reached)? To contribute a tweak myself: #+begin_src emacs_lisp (defadvice evil-goto-definition (around evil-goto-lisp-def activate) "Make use of emacs' and slime's possibilities for finding definitions." (case major-mode (lisp-mode (if slime-mode (or (slime-find-definitions (symbol-name (symbol-at-point))) ad-do-it) ad-do-it)) (emacs-lisp-mode (condition-case nil (find-function (symbol-at-point)) (error (condition-case nil (find-variable (symbol-at-point)) (error ad-do-it))))) (otherwise ad-do-it))) #+end_src My complete evil config is on github[1]. Michael Footnotes: [1] https://github.com/cofi/dotfiles/blob/master/emacs.d/cofi-evil.el
On Tue, Sep 13, 2011 at 4:32 PM, Michael Markert <[email protected]> wrote:
Finally I found the time to answer here.
On 8 Sep 2011, Tom Short wrote:
(key-chord-define evil-window-map "df" 'evil-window-prev) ; df twice (DOESN'T WORK)
Is that a "doesn't work" for "key-chord doesn't like evil" or just for the double df? Anyway I use this for "jk" as `ESC' (with help from Frank):
It's just the double df that doesn't work. The other key chords in general are working very well for me (except on a terminal on a slow connection). Thank you for sharing your evil config. I'm going to try some of your org-mode bindings. I also liked the way you layed out your configuration file. - Tom
On 13 sept. 2011, at 22:32, Michael Markert wrote:
(setq evil-emacs-state-cursor '("red" box))
I use this for `evil-default-cursor':
#+begin_src emacs_lisp (defun cofi/evil-cursor () "Change cursor color according to evil-state." (let ((default "OliveDrab4") (cursor-colors '((insert . "dark orange") (emacs . "sienna") (visual . "white")))) (setq cursor-type (if (eq evil-state 'visual) 'hollow 'bar)) (set-cursor-color (def-assoc evil-state cursor-colors default)))) #+end_src
Hello, I've tried both of these (adding them to my .emacs), and I could make neither work. Is it because I'm on Aquamacs? Or because I'm using a color theme? Thanks, Alan
On 14 Sep 2011, Alan Schmitt wrote:
On 13 sept. 2011, at 22:32, Michael Markert wrote:
(setq evil-emacs-state-cursor '("red" box))
I use this for `evil-default-cursor':
#+begin_src emacs_lisp (defun cofi/evil-cursor () "Change cursor color according to evil-state." (let ((default "OliveDrab4") (cursor-colors '((insert . "dark orange") (emacs . "sienna") (visual . "white")))) (setq cursor-type (if (eq evil-state 'visual) 'hollow 'bar)) (set-cursor-color (def-assoc evil-state cursor-colors default)))) #+end_src
Hello,
I've tried both of these (adding them to my .emacs), and I could make neither work. Is it because I'm on Aquamacs? Or because I'm using a color theme?
For my code this is missing (sorry): #+begin_src emacs-lisp (defun def-assoc (key alist default) "Return cdr of `KEY' in `ALIST' or `DEFAULT' if key is no car in alist." (let ((match (assoc key alist))) (if match (cdr match) default))) #+end_src emacs-lisp Aquamacs could be a cause for this but I have no experience with it. color themes are most probably not interfering as they do little more than assigning faces themselves. Michael
On 14 sept. 2011, at 12:08, Michael Markert wrote:
Aquamacs could be a cause for this but I have no experience with it. color themes are most probably not interfering as they do little more than assigning faces themselves.
Thanks for the reply. I'm still investigating. What's strange is that when I do a "(set-cursor-color "red")", the cursor becomes red for a couple seconds, then takes back its previous color. I've searched all my init files for anything related to "cursor", and I don't find anything. I did another experience though: if I don't load evil, then the cursor color change sticks. So I'm wondering if this might not be an evil related issue. Alan
On 14 Sep 2011, Alan Schmitt wrote:
On 14 sept. 2011, at 12:08, Michael Markert wrote:
Aquamacs could be a cause for this but I have no experience with it. color themes are most probably not interfering as they do little more than assigning faces themselves.
Thanks for the reply. I'm still investigating. What's strange is that when I do a "(set-cursor-color "red")", the cursor becomes red for a couple seconds, then takes back its previous color.
I've searched all my init files for anything related to "cursor", and I don't find anything.
I did another experience though: if I don't load evil, then the cursor color change sticks. So I'm wondering if this might not be an evil related issue.
Can it be that you don't set `evil-default-cursor' to your function and do something else? That way evil resets the cursor to `evil-{emacs,normal,...}-state-cursor' or `evil-default-cursor'. So please post your related config. Michael
On 14 sept. 2011, at 15:18, Michael Markert wrote:
On 14 Sep 2011, Alan Schmitt wrote:
On 14 sept. 2011, at 12:08, Michael Markert wrote:
Aquamacs could be a cause for this but I have no experience with it. color themes are most probably not interfering as they do little more than assigning faces themselves.
Thanks for the reply. I'm still investigating. What's strange is that when I do a "(set-cursor-color "red")", the cursor becomes red for a couple seconds, then takes back its previous color.
I've searched all my init files for anything related to "cursor", and I don't find anything.
I did another experience though: if I don't load evil, then the cursor color change sticks. So I'm wondering if this might not be an evil related issue.
Can it be that you don't set `evil-default-cursor' to your function and do something else?
That way evil resets the cursor to `evil-{emacs,normal,...}-state-cursor' or `evil-default-cursor'.
So please post your related config.
I managed to make it work by manually setting the colors (using the suggested functions): ;; Cursor colors (setq evil-emacs-state-cursor '("sienna" box)) (setq evil-insert-state-cursor '("dark orange" bar)) (setq evil-visual-state-cursor '("black" hollow)) What I was not able was to use the generic code you sent. But I'm happy with this version. Thanks, Alan
Yes, I agree with Tom. I tried viper and vimpulse, but evil is the first emacs / vim plugin that feels natural. Thanks for writing it. I hope this doesn't make me sound hopelessly ignorant and lazy. But will there ever be a way to use an existing .vimrc file to configure evil? I know that's a matter of parsing vim syntax. And I don't know what lex/yacc tool emacs lisp uses. Tim On Wed, Sep 14, 2011 at 10:39 AM, Alan Schmitt < [email protected]> wrote:
On 14 sept. 2011, at 15:18, Michael Markert wrote:
On 14 Sep 2011, Alan Schmitt wrote:
On 14 sept. 2011, at 12:08, Michael Markert wrote:
Aquamacs could be a cause for this but I have no experience with it. color themes are most probably not interfering as they do little more than assigning faces themselves.
Thanks for the reply. I'm still investigating. What's strange is that when I do a "(set-cursor-color "red")", the cursor becomes red for a couple seconds, then takes back its previous color.
I've searched all my init files for anything related to "cursor", and I don't find anything.
I did another experience though: if I don't load evil, then the cursor color change sticks. So I'm wondering if this might not be an evil related issue.
Can it be that you don't set `evil-default-cursor' to your function and do something else?
That way evil resets the cursor to `evil-{emacs,normal,...}-state-cursor' or `evil-default-cursor'.
So please post your related config.
I managed to make it work by manually setting the colors (using the suggested functions):
;; Cursor colors (setq evil-emacs-state-cursor '("sienna" box)) (setq evil-insert-state-cursor '("dark orange" bar)) (setq evil-visual-state-cursor '("black" hollow))
What I was not able was to use the generic code you sent. But I'm happy with this version.
Thanks,
Alan _______________________________________________ implementations-list mailing list [email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
On Thu, Sep 22, 2011 at 01:12:16AM -0400, Timothy Washington wrote:
Yes, I agree with Tom. I tried viper and vimpulse, but evil is the first emacs / vim plugin that feels natural. Thanks for writing it.
I hope this doesn't make me sound hopelessly ignorant and lazy. But will there ever be a way to use an existing .vimrc file to configure evil? I know that's a matter of parsing vim syntax. And I don't know what lex/yacc tool emacs lisp uses.
I think you expected this answer: That is VERY unlikely The reason is that you do not only have to parse the configuration file but also to interpret it (vim has its own programming language) and therefore provide an implementation for *all* functions vim has. This means more or less that one has to reimplement vim in Emacs - not only the editing interface but the whole internal programming interface - and the effort to do this is in no relation to its usefulness. Perhaps the vim people implement an emacs-lisp interpreter in vim ... ;) Frank
On Thu, Sep 22, 2011 at 08:24, Frank Fischer <[email protected]> wrote:
On Thu, Sep 22, 2011 at 01:12:16AM -0400, Timothy Washington wrote:
I hope this doesn't make me sound hopelessly ignorant and lazy. But will there ever be a way to use an existing .vimrc file to configure evil? I know that's a matter of parsing vim syntax. And I don't know what lex/yacc tool emacs lisp uses.
I think you expected this answer: That is VERY unlikely
Thank god for that!
On 22 Sep 2011, Timothy Washington wrote:
Yes, I agree with Tom. I tried viper and vimpulse, but evil is the first emacs / vim plugin that feels natural. Thanks for writing it.
Could you elaborate on this? Why does it feel natural in contrast to viper/vimpulse? I'm still collecting reasons to switch to evil, so information like this is quite useful. Michael
I'll second that question. What are the current benefits of evil over viper/vimpulse? Thanks. On 9/22/11, Michael Markert <[email protected]> wrote:
On 22 Sep 2011, Timothy Washington wrote:
Yes, I agree with Tom. I tried viper and vimpulse, but evil is the first emacs / vim plugin that feels natural. Thanks for writing it.
Could you elaborate on this? Why does it feel natural in contrast to viper/vimpulse?
I'm still collecting reasons to switch to evil, so information like this is quite useful.
Michael
-- Natan -- blog: http://natanyellin.com <http://natanyellin.com/>twitter: @aantn <http://twitter.com/aantn>
Michael Markert <[email protected]> writes:
On 22 Sep 2011, Timothy Washington wrote:
Yes, I agree with Tom. I tried viper and vimpulse, but evil is the first emacs / vim plugin that feels natural. Thanks for writing it.
Could you elaborate on this? Why does it feel natural in contrast to viper/vimpulse?
I'm still collecting reasons to switch to evil, so information like this is quite useful.
Michael
Michael, I can't give you specific reasons but my overall impression is similar to Timothy's above. evil is the first vi(m) emulator that doesn't cause more problems than it solves! The problem is I cannot remember why I gave up on the earlier vi emulators despite trying hard to get used to them. It's been a while! In any case, I only turn on evil mode in text editing buffers, mostly org mode but also message composition buffers and for coding. And I have C-z bound to evil-local-mode in all other modes for easy access. HTH, eric -- Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D)
On Thu, Sep 22, 2011 at 1:37 PM, Eric S Fraga <[email protected]> wrote: (...)
I can't give you specific reasons but my overall impression is similar to Timothy's above. evil is the first vi(m) emulator that doesn't cause more problems than it solves! The problem is I cannot remember why I (...)
IMHO the biggest hurdle in the case of Vimpulse was not Vimpulse itself, but Viper. To be sure, Viper is an excellent emulation layer, but this fact is not apparent until you're a pretty advanced Viper user and have a .viper file with 200+ lines. It is so versatile that you may even make it behave like Vim :) When I moved from Vimpulse to Evil I had to rewrite all that code (including e.g. stuff like my own input method for authoring XML in nxml, go figure,) but excepting for that my general impression is that with Evil you just set it in your .emacs file, and it starts working as expected right here right now -- no "expert level" questions, no separate configuration file, no nothing, it just works. Cheers, -- José A. Romero L. [email protected] "We who cut mere stones must always be envisioning cathedrals." (Quarry worker's creed)
On Thu, Sep 22, 2011 at 12:26, Michael Markert <[email protected]> wrote:
On 22 Sep 2011, Timothy Washington wrote:
Yes, I agree with Tom. I tried viper and vimpulse, but evil is the first emacs / vim plugin that feels natural. Thanks for writing it.
Could you elaborate on this? Why does it feel natural in contrast to viper/vimpulse?
I’m not Michael, but my feeling is, as others before me have stated, that Viper tries to hard to shield you from Emacs, while not doing a good enough job at it. Evil is a thin veneer over Emacs that provides all the niceties of Vi without trying too hard to make everything behave as in Vi. Most modes that should come up in Evil mode do so and most modes that shouldn’t don’t. It’s easy to figure out what mode you’re in and it’s always easy to get to the mode you want to be in. The mode and mapping management is simply better better in Evil than it is in Viper (with or without Vimpulse). Perhaps this is more of a feeling than anything else, but having Emacs, Viper, and Vimpulse fight over what to do with your input was a pain. Somehow, Evil manages to work together with Emacs to take care of your input in the best possible way. Also, Evil has all its settings set the way I want them by default. Viper, not so much…
+1 on these last 3 answers - much better than anything that I could have given. Tim On Thu, Sep 22, 2011 at 8:59 AM, Nikolai Weibull <[email protected]> wrote:
On Thu, Sep 22, 2011 at 12:26, Michael Markert <[email protected]> wrote:
On 22 Sep 2011, Timothy Washington wrote:
Yes, I agree with Tom. I tried viper and vimpulse, but evil is the first emacs / vim plugin that feels natural. Thanks for writing it.
Could you elaborate on this? Why does it feel natural in contrast to viper/vimpulse?
I’m not Michael, but my feeling is, as others before me have stated, that Viper tries to hard to shield you from Emacs, while not doing a good enough job at it. Evil is a thin veneer over Emacs that provides all the niceties of Vi without trying too hard to make everything behave as in Vi. Most modes that should come up in Evil mode do so and most modes that shouldn’t don’t. It’s easy to figure out what mode you’re in and it’s always easy to get to the mode you want to be in. The mode and mapping management is simply better better in Evil than it is in Viper (with or without Vimpulse).
Perhaps this is more of a feeling than anything else, but having Emacs, Viper, and Vimpulse fight over what to do with your input was a pain. Somehow, Evil manages to work together with Emacs to take care of your input in the best possible way.
Also, Evil has all its settings set the way I want them by default. Viper, not so much…
_______________________________________________ implementations-list mailing list [email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
participants (11)
-
Alan Schmitt -
Eric S Fraga -
Frank Fischer -
José A. Romero L. -
Michael Markert -
Natan Yellin -
Nikolai Weibull -
Timothy Washington -
Tom Short -
Vegard Øye -
York Zhao