What is the difference between gVim and gVim easy? - vim

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.

Related

Vim: Is it possible to bind a key to open search (i.e. put me in the command mode having entered a slash, but do not type anything)

While vim's way of doing things is generally good, I feel like there are aspects that really get in the way as somebody who is not completely committed to vim for text-editing.
This means that I am hitting Esc+/ and typing slashes into files in Sublime Text, and hitting Ctrl+F in vim, scrolling down a page.
Similar things happen with Ctrl+S and :w and custom mapping ; to : still doesn't make it as convenient and fail-safe as Ctrl+S. Not to mention in PuTTY, Ctrl+S does something rather upsetting (it suspends output from the terminal till Ctrl+Q is pressed). Basically, IMHO some things (like switching to a "find mode" and saving the file) are good to attach to a global left-hand home-row shortcut chord rather than requiring the user to mess about in a modal command line. It simply is too often used to subject the user to these mode changes. I suppose this isnt a legitimate complaint because the entirety of vim is constructed around the modal concept, and these functionalities are a result of that.
In any case I'd like to make it a bit easier on my brain because I've tried for a while now to keep it all intact and it's simply too much (I have more or less internalized the switching between Ctrl on a windows machine on a desktop keyboard and the use of the thumb for the Cmd on my Macbook, but this modal text editor business seems to be too much). It did not take too much deliberation for me to decide that global homerow key chords are simply more intuitive.
Mapping Ctrl+S to :w is trivial, so the question here is about the find mode. I want to bind Ctrl+F to put me in find mode, but repeating it should not type slashes into the find command. Can this be done? Is there perhaps a colon-command that when executed simply drops me into the current find-command-buffer-thing?
In your .vimrc add:
inoremap <C-f> <Esc>/
noremap <C-f> <Esc>/
In whatever mode you are in, this will put you in "find" mode (it actually just types a slash in the command line which you can use to search). With these bindings it will work for all modes, even if you are in insert mode.
do you want this?
nnoremap <c-f> /
if you like you can also try
nnoremap <c-f> q/
the 2nd mapping brings you to a search history window. you could choose previous search keywords/patterns. also available to type new pattern (by pressing i)
btw, there is no find mode
Mappings can be defined separately for the different modes in Vim, see :help map-modes. This automatically takes care of your proposed <C-f> mapping: Initially, you're in normal mode, then the search pattern is entered in command-line mode.
If you so far only occasionally use Vim, and find it too "different", several things may make the switch easier:
easy Vim (evim or vim -y) defaults to insert mode
on Windows, :behave mswin and the $VIMRUNTIME/mswin.vim script create some common Windows shortcuts
graphical GVIM has menu items like Edit > Find... and toolbars.
Some things like the flow-control freeze on <C-s> in terminals are unfortunate, mostly historical accidents; you can't blame Vim for those.
You don't need to map anything. / is expressive enough and is definitely not slower than <C-f>. Same for <C-s> which, despite a certain familiarity, is not much better than :w<CR>. You are learning a new tool, remember?
What you should focus your efforts on is getting confortable with Vim's modality. The simple fact that, for you, doing a search involves hitting <Esc> is a sign that you didn't get that part. Your other comments on using Vim shortcuts in ST and ST shortcut in Vim are not good signs either and the part where you complain about having to adjust to your Mac's Cmd is the icing on the cake, IMO.
It may sound brutal but, from your question, it seems like you are doing too much at the same time, without organization and for, probably, no good reasons.
Switching from Windows to Mac OS X and switching from ST2 to Vim at the same time is sure to be confusing and I suggest you slow down a little and make a choice before you loose your mind and waste more of your time.
Which leads me to this: Why do you use a Mac and why are you using Vim?
Windows is a fine OS. Sublime is a fine editor. Even if you switch to the Mac, Sublime works very well there. So Why Vim?
If you are tired by some Sublime limitations and want the awesome power of Vim, fine. But you must wrap your head around its modality and awkwardness and accept to change your habit.
If you don't approach Vim with more flexibility, you'll never get full benefits.
If you decided to use Vim because it is trendy, I'll respectfully suggest you to stop there and go back to Sublime. Vim is weird, Vim is different, Vim is huge, Vim is a rabbit hole… if you are not ready to work with it and insist on not accepting its core design, you won't get far so why bother? You can pretty much live all your professional carreer without ever touching Vim. There's no shame in that.
Remapping / to <C-f>, on the other hand…

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.

Is there a way to change vim's default mode

Does anyone know how to change vim's default mode? Its default mode is command mode, but could I change it to insert mode?
Just add the following line to your vimrc:
start
Vim's default mode will be changed to Insert mode. Just press Esc to enter Command mode.
You can try the 'insertmode' option (add set insertmode to your .vimrc file), although I recommend that you learn the standard vi operation, because not all vi-like editors support this mode of work.
cheers,
mitch
If you really want an editor that starts out in insert mode, perhaps vim is not the editor for you.
Most editors that aren't based on vi behave the way you want. Emacs is very powerful, but it may be too complicated for your needs. Nano (man nano for info nano for more information) might be a good choice. There are other possibilities.
vim really isn't designed to be used that way. As others have said, there are ways to force it to start up in insert mode. (I've been using vi-style editors for decades, and I didn't even know about :set insertmode until now.) But it's awkward to use.
My advice: either (1) use an editor that behaves the way you want, or (2) spend some time learning to use vim in its default configuration, and see if you can get used to it.
One big advantage of vim's separation of insert and command modes is that the command mode can use letters as commands; modeless editors generally have to use control keys or function keys to execute commands.
Update (a decade later): vim has an option -y that starts it with insertmode enabled. evim is equivalent to vim -y, and eview to view -y. From the man page (emphasis added):
eVim starts Vim and sets options to make it behave like a modeless editor. This is still Vim but used as a point-and-click editor. This feels a lot like using Notepad on MS-Windows. eVim will always run in the GUI, to enable the use of menus and toolbar.
Only to be used for people who really can't work with Vim in the normal way. Editing will be much less efficient.
The 'insertmode' option is set to be able to type text directly.
Mappings are setup to make Copy and Paste work with the MS-Windows keys. CTRL-X cuts text, CTRL-C copies text and CTRL-V pastes text. Use CTRL-Q to obtain the original meaning of CTRL-V.
You can use
vi -cstartinsert
or
vi -cstart
That launch vi and put it insert mode. You can do an alias to that if it's really usefull (I still understand why you want that anyway). You can also look at this tip.
"Cream" is a project that aims to make Vim easier to use. By default everything you do in Cream is in insert mode, I believe:
http://en.wikipedia.org/wiki/Cream_%28software%29

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.

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

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.

Resources