views:

1245

answers:

8

Any other tweaks for making emacs as vim-like as possible would be appreciated as well.

Addendum: The main reason I don't just use vim is that I love how emacs lets you open a file in two different frames [ADDED: sorry, this was confusing: I mean separate windows, which emacs calls "frames"]. It's like making a vertical split but I don't have to have one enormous window.

A: 

You could always start vim in a shell buffer and resize it so it filled the whole frame?

1800 INFORMATION
A: 

If you want VIM functionality, it makes more sense to just install VIM!

OJ
+2  A: 

I don't have any viper or vimpulse tweaks for you, but I do recommend that you try follow-mode.

Of course I'd also recommend that you start learning Emacs too. I mean, if you're in this far you might as well go through the tutorial and maybe have a look at emacswiki.

jfm3
A: 

I'm not sure if I answer your question, as it is not entirely clear what you are asking (why the macro's are not working, or which tweaks are available for emulating vim in emacs)
so, is this your problem?:

  • One user who uses an ancient emacs-snapshot (from 2005) mentions
    that this mode causes all the keys on his keyboard to stop working unless he deletes the line that reads 'viper--key-maps from the macro my-get-emulation-keymap in this file

if it is, you can try the stated solution.

I got this information from the emacs wiki, and it's a known bug.

Sven
In terms of the bounty, let's say the question is how to make vim macros work in viper/emacs. Additional tips for closing the gap between true vim and vimpulse can be considered tie-breakers/bonus.
dreeves
+2  A: 

I don't know how to make Vim macros work, but since you asked for tweaks for making emacs as vim-like as possible, here's a few additions to vimpulse I use everyday:

(define-key viper-vi-global-user-map [(delete)] 'delete-char)
(define-key viper-vi-global-user-map "/" 'isearch-forward-regexp)
(define-key viper-vi-global-user-map "?" 'isearch-backward-regexp)
(define-key viper-vi-global-user-map "\C-wh" 'windmove-left)
(define-key viper-vi-global-user-map "\C-wj" 'windmove-down)
(define-key viper-vi-global-user-map "\C-wk" 'windmove-up)
(define-key viper-vi-global-user-map "\C-wl" 'windmove-right)
(define-key viper-vi-global-user-map "\C-wv" '(lambda () (interactive)
                                                (split-window-horizontally)
                                                (other-window 1)
                                                (switch-to-buffer (other-buffer))))

(define-key viper-visual-mode-map "F" 'viper-find-char-backward)
(define-key viper-visual-mode-map "t" 'viper-goto-char-forward)
(define-key viper-visual-mode-map "T" 'viper-goto-char-backward)
(define-key viper-visual-mode-map "e" '(lambda ()
                                         (interactive)
                                         (viper-end-of-word 1)
                                         (viper-forward-char 1)))

(push '("only" (delete-other-windows)) ex-token-alist)
(push '("close" (delete-window)) ex-token-alist)

Of course, learning Emacs is very important too, but Emacs relies on customization to make it behave exactly like you want it to. And the default Vim key bindings are so comfortable that using Viper simply means that Viper does some Emacs customization for you.

As for using Vim instead of Emacs, I love Vim, but I love the interactiveness of the Lisp system that is Emacs. Nothing feels like typing a line of code anywhere in your editor and instantly evaluating it with a single keystroke, changing or inspecting the state of your editor from your editor (including the live documentation) with a single keystroke (C-M-x) while it is running.

Sébastien RoccaSerra
+7  A: 

You could run VIM in client server mode, then you could have two windows connecting to one instance, hence removing the need for Emacs.

chillitom
Brilliant! Has anyone tried this? Does it work fine?
dreeves
Dreeves: yes, this is exactly what pida IDE does, and it works fine.
Ali A
+1  A: 

The version of VIM I use support (Window version) support splitting a file into 2 different frames using "Ctrl+W s"...

Sean
Interesting; is this a windows-only feature?
dreeves
'CTRL+W s' is is the same as :split, there's still only one main Vim window. You can't individually minimize one of the windows or drag one of them onto a 2nd monitor.
too much php
I don't believe it's a Windows only feature. If I run the console version of vim I'm able to do the same.@Peter: The question doesn't say anything about minimizing or dragging to additional monitors...
Sean
In my Windows version of gVim, "Ctrl-W s" (or "Ctrl-W v") splits in two windows, not two frames.
Sébastien RoccaSerra
+1  A: 

Vim easily lets you open a file in two different frames:

:split to split it horizontally

:vsplit to split it vertically

You can split the screen as many times as you want between the same file, different files, or both.

CTRL-w-w switches frames.

:resize +n or :resize -n resizes the current frame.

MCS
Thanks, this is good, but it doesn't quite work for me. For example, you can't put the frames on different monitors.
dreeves
I must be missing something here, but if that's what you're trying to do, why not simply open the same file twice using two different vim windows?
MCS
Opening the file twice is not the same. You won't have a shared undo-history and if you edit both windows before saving, there's no way to merge. AFAIK Emacs doesn't do this ...
too much php
Peter is correct. In Emacs it works just like a split, despite being in different windows (what emacs calls "frames"). That's what I'm after.
dreeves