What Vim features are missing in Emacs with Viper and Vimpulse? - vim

There are important features of Emacs which are missing in Vim, such as the comint mode, and there are no scripts/plugins which can replace them.
There are also benefits of Vim over Emacs, such as modal editing and generally better default shortcuts. However, Viper mode gets me both. Vimpulse also enables visual mode.
Unfortunately, no mode can make Emacs work as fast as Vim.
So I mostly learned Vim-in-Emacs. What Vim features am I missing?

I'm a regular vim user but not an emacs user and haven't used vimpulse to confirm this.
But browsing the vimpulse code below I see no mention of text objects.
http://www.emacswiki.org/cgi-bin/wiki/vimpulse.el
Vim introduced some very useful idioms for selection and movement that aren't in regular vi
cat 'cut around tag' for xml/html tags
diw 'delete in word'
di( di" delete text within a "" () etc.
in the vim help see :he text-objects for more.

Unfortunately, no mode can make Emacs work as fast as Vim.
If you mean that the emacs startup time is poor, you can cut it down dramatically by having an emacs session permanently open, and use gnuclient/emacsclient whenever you need to edit a file.
http://www.emacswiki.org/emacs/GnuClient

One vi feature that I miss in emacs is the . (dot) command that repeats the last edit. There is dot-mode.el which implements C-. to simulate this but it didn't always work for me (I am not proficient in elisp to figure out why).
Even viper doesn't implement this command exactly like vi does (last time I checked), and even if it does, I don't think that is enough for me to start using viper.

To get a complete list of what vimpulse may be missing type
:helpgrep not in Vi
Every feature in the help that is not vi compatible will be listed.
Theres about 700 matches.
Of course there will be a lot of duplicated functionality

Vi motion everywhere - in Vi you can always navigate using the same shortcuts, whether you are inside a directory listing, a help file, a write only file or something you're allowed to edit.
Correct visual and delete behaviour - very similar to emacs marking but idiomatically different, so difficult for a Vi user to retrain. If you're already used to the emacs marking you're not really missing anything.
Correct escape behaviour - should cancel all other modal activity and return you to command mode. Again, if you're comfortable in emacs you're probably used to having modal inputs and such anyway.
The obvious chestnuts about Vi being deployed on every nix system in the world (Gentoo purists correct me?) - not a very strong argument in my eyes anyway.
Those are the ones that sprang out during my use of emacs+viper.

Vim macros don't seem to work with viper/vimpulse:
Vim macros don't work when using viper + vimpulse in Emacs
(Btw, the killer emacs feature that makes me care about vim/vimpulse is that different frames can edit the same file. It's like having a split where the two pieces can be in different windows. If anyone knows how to accomplish that in vim, you'd be my hero.)

Incremental search using / and ? is missing.

Being a lover of emacs as an OS and vi as an input model, naturally I wanted to love viper. However within two seconds of using it I had to give it up: viper does not support C-[ as a substitute for the escape key–which is an essential shortcut for the most frequently used command in vi.

Related

What is the vim equivalent of emacs' reftex?

I write a lot in LaTeX and I only use vi/vim. Looking at other editors (emacs, specifically) I notice that vi lacks an easy way to insert references and citations, with me having to do them by hand (all the rest doesn't really bother me). In emacs, this feature exists and is called reftex mode (if i'm not mistaken).
The closest thing on vi that I thought would have this was auctex.vim, but reading its keybindings I can't find such a mode anywhere.
So, is there something similar for vi/vim that I am missing?
Cheers

What is the difference between gVim and gVim easy?

The question is self explanatory, but I haven't found a single resource that explains what the difference is after an hour of searching. After poking around a little bit in both, it appears that gVim and gVim easy are identical.
Gvim easy is started and locked in insert-mode (every character you type is printed like a simple notepad).
Standard gvim starts in normal mode and you have to toggle between normal/insert like all other vim.
From help:
Easy mode. Implied for |evim| and |eview|. Starts with
'insertmode' set and behaves like a click-and-type editor.
This sources the script $VIMRUNTIME/evim.vim. Mappings are
set up to work like most click-and-type editors, see
|evim-keys|. The GUI is started when available.
{not in Vi}
gVim-Easy, which is installed with gVim, has all the functionality of
normal gVim but lacks modes. This is especially useful for begginers
and people who do not want to, or do not have the time to, learn how
to use gVim. Users can benefit from gVim's superior syntax
highlighting and auto-indentation while not having to have to learn
the, often deemed complex, command set of gVim in order to edit a
simple document. It is recommended that readers of this tutorial at
least try to learn how to use gVim in normal mode, the learning curve
is steep, but, the benefits in speed and usability this confers is
worth the investment.
Read here
gVim Easy: gvim.exe -y (pass a parameter y)
gVim: gvim.exe
It seems that Insert and Replace are available modes, and command mode is missing. And at first glance it appears to have lost the ability to save a document using keystrokes - the File menu shows only ":w" for Save and without command mode, the command simply isn't there. What isn't shown however is Alt-F followed by S - this works, although also missing is the status line confirmation of the file being written.

Linux text editor: Pretty. Fast. Powerful. Easy to pick up

Looking for a linux text editor. I can fumble my way through emacs a little but only really know the basics. I liked TextMate on OSX but thought it was a bit weak at times (maybe I just didn't learn it well enough). I don't know if emacs or vim are worth it since I'll still mostly program in eclipse.
Syntax highlighting
Themeing support. I'd like something like sunburst if possible.
Hopefully don't have to think in a different way when I use it versus other programs. i.e. I don't think I want to learn all the shortcuts for emacs/vi. (If I were to be sold on this route I'd need something to help me get up to speed quickly and hopefully something in app that helps discover functionality as I go). Cream might be a go here but I don't know what I'm missing if I do that.
Mouse usage (text selection, cursor placement, etc)
doesn't look awful (yes aesthetics do matter to me).
Auto-formatting support
Light-weight
Easily callable from the command line.
Depends on the task at hand.
I've been using Geany to write scripts, it has basic IDE functions, good syntax highlighting etc.
+1 for vim. The learning curve can be a bit steep, but vimtutor can help you a lot.
Once you get accustomed to it you'll wonder how you lived without it.
gEdit. Has a bunch of plugins and has support for vi bindings. I think it meets all of your requirements.
+1 for Vim - it's my all time favorite editor and the more I learn about the shortcuts and use more plugins and stuff, I would never go to another editor :) Although in my spare time I have started dabbling with Emacs, just for the kicks. Vim essentially has two modes - normal and insert, so you switch back and forth between them. In the insert mode you type, in the normal mode you do magic with the shortcuts. The power is awesome and after a while it becomes intuitive, and you start finding that you just did a keyboard combination and it worked as you expected, although you never specifically read about this combination. E.g. delete till the character 'x' before the current position of the cursor = Esc+d+T+x (when you only knew that Esc+d+t+x (small t) works in the forward mode.
Simpler ones on Linux are nano, pico, and gEdit :)
I recommend Komodo Edit for big projects. It's possible to create macros, key-bindings for commands and snippets through an easy-to-use interface. And there's a good syntax highlight support for most languages too.
A second choice would be geany. It's faster and simple, useful for the most cases where you just want to edit a single file or a small project.
If you wish to learn vim or emacs, then print yourself the vim or emacs quick reference card.
In fact, I'd recommend learning vim or emacs even if you wind up mostly using a more modern editor simply because they exist when nothing else does.
I personally prefer vim because many vim commands match sed and perl commands, definitely consider vim if you use these often. And you should obviously pick emacs if you like lisp.
There was an issue with bash's vi mode in which it ignored the arrow keys for ages, which forced people into using vim for editing and emacs mode in bash, but now set -o vi works correctly in bash.

Can you tell me the relationships and differences between Vi and Vim

I often see Vim in my lab, but I also know Vi, but I never have a chance to use it, I search for it by using google, but I can't get a website to download Vi. Can you show me the relationships and differences between Vi and Vim, if possible, give me a url to download the Vi. Thanks!
Despite what others have said, Vim is not an enhanced version of Vi, nor is it an extension. It might seem that way because Vim was designed to be, by default, as compatible with Vi as possible (even more so in Vi-compatible mode). Obtaining Vi source code used to required a Unix source code license, and since additional features were desired, Vim was developed independently of Vi. It is more properly called a clone, which has additional features.
Vim is the standard editor on many *nix systems. The "program" vi is often just a symlink to vim. Historical interests aside, I can't think of a compelling argument for using Vi. Vim is much more modern, and any features you don't want can be disabled, or support for them not compiled in.
You can download the source for vi here: http://ex-vi.sourceforge.net/
Vim is an enhanced version of Vi with extra features. If you know how to use Vi, you won't have trouble using Vim, since you know the basics. Sometimes people used to Vim have trouble with Vi as it doesn't have all the extra features as Vim.
Vim has an option called compatible that makes vim behave nearly exactly like vi. See :help 'compatible for more information.
VIM is Vi iMproved. VIM is basically an extension of Vi. I would learn VIM not Vi as it just gets too hard for many things. The advantage is if you can use Vim you can use Vi, just the extra snazzy stuff like syntax highlighting etc will be missing.
See wikipedia for more details on the history of the two: http://en.wikipedia.org/wiki/Vi & http://en.wikipedia.org/wiki/Vim_(text_editor)
Here is a good guide to Vi including how to install for your distro: http://www.yolinux.com/TUTORIALS/LinuxTutorialAdvanced_vi.html

How not to give up on VIM?

I have started to do some programming using VIM.
I have very mixed feelings so far. On one side I do love the idea, on the other - it is just hard to remember everything.
So I took the approach of learning while actually doing some stuff (for Ruby on rails development).
Unfortunately there is no chance in hell for me to be more productive as in other "conventional" text editor for now. And it seems it will take quite a lot of time to get used to VIM.
I noticed, that I often don't use VIM navigation/search&replace abilities, but instead just move around as I would do in other editors.
I am trying hard pushing myself not to open anything in other editors except VIM so I can learn it.
But, honestly, yesterday I gave up and did my last 20 minutes of coding in GEdit.
UPDATE: I want to say why I gave - just because of I would finish what I need faster (it was veeeery late and it was not the best time for learning VIM). And indeed I did enjoy using VIM. But I always had the "there must a better way of doing this" feeling and spent a lot of time finding that way.
So my question wold be: how can I learn and start using VIM more productively from day to day provided that I want to do some real coding when learning?
Thanks,
Dmitriy.
Keep the following in mind. While there are physical limits to the speed of your fingers, there seem to be few limits on the processing that your brain can perform. Therefore, the time you invest in learning vi(m)'s keyboard editing commands and shortcuts will be paid back handsomely over time as the speed with which you edit improves breaking the physical speed limits you would encounter when using a traditional editor. For instance, to delete the next five words in vi(m) you type 5dw and to insert 50 * characters you type 50i* ESC.
You can begin using vi(m) after learning very few commands: basic movement, inserting, changing, deleting, opening a new line, and saving a document. Coupling these commands together produces powerful combinations. As you master these, you'll be looking for more.
Print a vi reference sheet (like this, or this or this more extensive list), and keep it near you at all times.
I use Gvim (the GUI mode). If you forgot the key sequence for some action you can invoke it through the GUI. For most actions you can also see the necessary keys, so that Gvim can also serve as a quick reference for Vim.
Off course a different text editor will not magically make you more productive. But if you like to use keyboard shortcuts on the mainstream editors, you'll like Vim because you can trigger fairly powerful actions with a few keystrokes.
I personally don't like Vim, I prefer mainstream editors. But Vim has REST syntax coloring, and I found it perfectly usable after about a week.
Why? Use whatever editor suits you best and makes you the most productive. I use vi for editing configuration files, because it's usually the quickest way to edit a few lines and then exit. For serious programming, it's either TextMate (ruby), Emacs (python or ruby on platforms without TextMate) or Xcode (objective-c).
Start using it when it makes sense : quick edits on config files, commit messages, README updates, etc...
The startup speed can difficult be beat.
When you get the hang of the basics, explore the help file if you think "there must be something in there for the task I need to do now". ...
Build the knowledge gradually.... step by step...
Until you find one day you do a lot of your editing in VIM or find that your toolchain is well integrated with Vim.
I personally use whichever works best, IntelliJ for Java, Emacs for clojure, Vim for perl and ruby scripts, ...
I'm more static typed languages guy and here is my story:
For me VIM was all about hjkl movement in normal mode + intert mode. I've found it so efficient that I wanted to have it all the time, everywhere.
Then I started to read cheatsheets from time to time and picking up the best gestures to remember (somehow sorted from most commonly useful to less useful ones): b, w, x, gj, gk, gg, G, numberg, *, #, %, f/t/F/T, /, >>, <<, =, v then mark with j/k, <</=/>>.
Then I started to write Makefiles to everything and configured Vim to impretet it. So I do :mak and I'm right at the line that error was found.
Then autocompletion happened (binded to TAB).
Then natural language checking z=.
Then I've written a wrappers for switching buffers. Opening them with :e filename.c and then doing Ctrl+l, Ctrl+h.
I have my config publicly available in git archive here:
http://github.com/dpc/vim-config
I am trying hard pushing myself not to open anything in other editors except VIM so I can learn it.
But, honestly, yesterday I gave up and did my last 20 minutes of coding in GEdit.
Developer should be comfortable with the environment he works with. That's why there are lots of editors developed by the developers for the developers.
As long as the editor does what you want, the way you want, it is all fine: editor is just a mean to do the work.
So my question wold be: how can I learn and start using VIM more productively from day to day provided that I want to do some real coding when learning?
For the VIM, unfortunately, my recommendation would be to spend several days with it without doing any real work, but simply learning. It took me about two days to get to know the basic functions required for the efficient editing. I knew that editor would play important role in my daily work that's why I have invested close to the week of my spare time to learn both VIM and Emacs.
My ex-colleague also kept a VIM cheat sheet as his desktop wallpaper. Helped in the beginning.
This might help: Why, oh WHY, do those #?#! nutheads use vi?
Anyone else looking to learn Vim should check out the Open Vim website. It is a fantastic resource for any newcomer to Vim. It has an interactive tutorial and various sandbox modes for playing with the editor. Have fun!
I've heard very good things about SwaroopCH's Byte Of Vim book. Haven't gotten around to reading it myself yet, but his Byte Of Python book is definitely excellent.
Learn at your rhythm. I think you should start mastering the basics:
modes: command, normal and visual
the commands: paste, yank, delete.
Then you can improve these knowledges:
learn some useful commands in command mode (list buffers, substitution)
learn to move faster (beginning/end of the word/line/file)
search/substitute a pattern
Look at people's vim config and customize yours
While doing this, always keep a vim cheat sheet near you. The basics commands are easy to remember (d for delete, p for paste, y for yank, i for insert, a for append, ...).
Learn progressively and stay simple.
How about books?
These ones are excellent:
Learning the vi and Vim Editors
VI Editor Pocket Reference
And after all, so what - so you don't work with vim. What is the big added value for vim, which worth the difficulty of learning it?
Here's some novel advice from Yehuda Katz, a core member of the Ruby on Rails team who recently switched to Vim: Try using it exactly the same as you would any other editor at first so you can keep being productive. Maybe this means continuing to use the arrow keys or *gasp* mouse at first. Don't try to learn all the Vim ways at once. Rather, let them come slowly and naturally.
The full article is a great read:
Everyone Who Tried to Convince Me to use Vim was Wrong
Additionally, try using vi key bindings in other applications. If your shell supports vi movement, use that. For web browsing, try the phenomenal Vimperator Firefox plugin.
Perhaps some Easter Eggs would help you get started on the right foot. Try the following and enjoy the wonderful world of open source tradition and legacy of contained silliness :)
:help 42
:help holy-grail
:help!
:help map-modes (see comment below the table about :nunmap)
:help UserGettingBored
:help spoon
:help showmatch (read the note)
:Ni!
(know more: visit vim.org)
vim takes a lot of time to get used to and actually be productive with
this is how i look at it:
suppose your productivity index is anywhere between 1 and 10
when you start using an other editor, your productivity index is like 6, and can go up to 8.
when you start using vim, your productivity is like 2, but you can go up to as high as 10. it just takes time.
Here is how I learnt when I switched from Windows to Linux:
1) I printed out the vim quick reference card(pdf) and kept it next to my keyboard at all times.
2) I started off with gvim and used the easy mode (gvim -y or evim). This makes vim behave like a regular editor - it is always in insert mode, and the keys are mapped to work like a regular CUA editor (e.g. CTRL-X/C/V for cut/copy/paste). You can still access all the vim functionality with CTRL-o to enter a single Vim command, then it will go back to insert mode.
After a while I got fed up with using CTRL-o or the menus all the time, and switched to proper Vim mode. I have not looked back since then and now use Vim for everything, even on Windows. I even use Vimperator on FireFox.
It is also worth taking a look at Cream - this is like vim easy mode on steroids.
If you find that you comfortable using evim or cream then there is no reason that you have to go all the way switch to normal vim mode, whatever vim purists may say. You should aim to become a master of your tools, not a slave to them.

Resources