Hacker News new | past | comments | ask | show | jobs | submit login
Vim made easy: how to get your favorite IDE features in Vim (arstechnica.com)
67 points by sdfx on May 18, 2009 | hide | past | favorite | 44 comments



OR get Vim in your Visual Studio. http://viemu.com I think getting Vim in VS is much better option because I can't live without Resharper. Now I get best of both the worlds!


ViEmu rocks. I hope the guy who wrote it does reasonably out of it, because it's a great piece of software.


On that note, you can also emulate Vim in Eclipse: http://eclim.sourceforge.net/


Although not free, I find the plugin at viplugin.com to integrate far better with Eclipse. Eclim to me feels like I'm running two separate applications, vim and eclipse, and they don't seem to play together very well. The implementation of the viplugin.com emulation layer isn't nearly as good as actual vim, but the eclipse integration more than makes up for it.

On that note, if you prefer netbeans to eclipse, the jvi plugin for netbeans is much better than the eclipse vi plugin and I very rarely miss a vim feature when using it, and it's completely free as well. I really wish there were something as good as the jvi plugin available for eclipse, as eclipse is more feature-rich for java projects.


Do you know of something like this for emacs?


What, Emacs-like keybindings for Visual Studio? That seems kind of like putting a steering wheel on your coffee table and calling it an Aston Martin.


Actually, Visual Studio does come with Emacs-like keybindings by default - check out Tools > Options > Keyboard, and choose the Emacs option from the dropdown menu.

Nice analogy though :-)


I don't knock something till I try it. I have been using Emacs recently, and I like it. I was simply asking a question. I was not looking to be made fun of.


I wasn't making fun of you - I was pointing out that (in my opinion) what makes Emacs Emacs can't really just be a "plugin" thrown onto an IDE.

Maybe a better analogy would be asking what sort of engine I need to purchase to turn my Civic into a 747.


While that's true, it can be kind of a pain in the ass to learn different key bindings for every program you might have to use.


Another which I'm surprised wasn't mentioned - NERDTree (http://www.vim.org/scripts/script.php?script_id=1658) will give you a tree view of files and folders.


I love NERDTree as a matter of fact I got it mapped to <F3>[1] (it only works on Linux and Windows)

[1]: map <F3> :NERDTreeToggle <CR>


the colorscheme being used is oceandeep: http://www.vim.org/scripts/script.php?script_id=368

in case you were wondering...


I can't believe they talked about MiniBuffExplorer and didn't mention Vim 7's tabs.


Why? Because you think Vim's tabline is a replacement for :ls<CR> ? I talk to a lot of people trying to use Vim's tabs the way other editors use tabs--to list the open files--but it doesn't always work.


just wanna mention my setup, which is to bind the tabs to Alt+number keys:

  map <A-1> 1gt
  map <A-2> 2gt
  map <A-3> 3gt
        .
        .
        .


I don't think it's a replacement for :ls<CR>. I simply think it is worth mentioning both in an article called "Vim made easy...".


Sorry. That's what I assumed since you compared tabpages to MiniBuffExplorer. MBE does what a lot of people think the tabline should do, but doesn't.


Definitely. At first I made the mistake thinking that tabs were there to help me manage my buffers (and used them for this purpose, remapping :e to :tabe), but it turns out that instead they're just workspaces, which isn't what I actually want most of the time. I use buftabs (http://www.vim.org/scripts/script.php?script_id=1664) to display the list of open buffers in the status line, and map the right and left arrows to :bnext and :bprev.


All I want is CTRL+C and CTRL+V, and to not have to type I before I can edit anything. Is there any way to tell the thing to simply behave like Notepad so that I can edit some text?


All I want is for my car to behave like walking. How can I replace the ignition key with tying shoelaces?

Vim is really a crude programming language for text manipulation, more than anything else. Trying to use it like notepad throws out more or less all the reasons you would have for using it.

(As a side note: there are wrappers around it that try to do what you want. see 'evim' or 'cream')


Both evim and cream appear to be GUI wrappers for vim. I'm hoping for the opposite: a usable text editor for SSH sessions. I mean really, if you have access to a GUI environment, why would you use something as primitive as vi?

Know of anything that would fit the bill?


nano or pico, perhaps?


If you want to use Vim without learning how to use Vim, you're probably better off not using Vim.


I'd actually prefer not to use vim, but it appears that the only alternative is editing the files on a windows box and FTPing them across, which is actually slightly more painful. If you know of a good command-line text editor that actually behaves like a text editor, I'd love to hear about it.


I'm an emacs junkie, but I still have to stand up for the vimfidels and say, "man, you just don't get it"

That being said, emacs -nw

It is the answer to all your problems and will give you oral pleasure.


If you want a really simply text-mode editor, just use nano/pico.

http://en.wikipedia.org/wiki/Nano_(text_editor)

You may also like Cream (an easy to use configuration of vim - perhaps gvim only?)

http://cream.sourceforge.net/


Thanks for the link, but how does one go about downloading and installing Nano? My only access to an EC2 Linux machine is via the command line, so there's no visiting the website, downloading and unzipping it. Am I really expected to visit that site from a windows box, view source on the download page, paste the url into an ssh session and do a wget just to get a copy of the source code? And then compile it before I can use it? Just so that I can edit text???

This is a fundamental thing I've never understood about Linux, and probably the reason I find it so painful. I can only assume there is something I'm missing. Any help would be much appreciated.


So... you're saying that the fundamental problem with Linux is that when logging in remotely from the command line it's not as easy to use as a GUI/Desktop environment?

I'd like to see you ssh into text-only Windows!

In any case, you find it hard because you don't understand it and I see no motivation on your part to spend any time trying to understand it. vi/vim is installed by default on most installs because vi has been a staple of using Unix systems for decades, it's part of the standard set of tools. And even if you just want to use it to edit text, I don't see any reason that you can't use it once you learn the basic commands: * Esc or Ctrl-C to escape from Insert Mode * i to enter Insert Mode * :q from command mode to exit

Now you can use it to edit text files. Are you so hard up for keystrokes that you can't type an extra 1 or 2 in there somewhere? Are you just on some really slow connection or something? Sometimes I really don't understand people's resistance to anything that varies even slightly from what they deem to be 'normal.' Your argument against vim comes off to me like the people that will spend hours circling a parking lot so that they can park 8 ft. closer to the entrance to a store.

edit: forgot ':w' to save file to disk


I seem to have put you on the defensive, and I apologize for having done so. You're mistaken that I don't want to learn, as evidenced by the fact that I'm here asking for help.

I do actually know how to use vi/vim, and have done so successfully for years. I just find it annoying that it behaves so differently from every other text editor that one comes across. Since this is an article stating that you can make vim behave like an IDE, I figured it would be a good place to ask if it were possible to make vim behave like an IDE in the text-editing sense. From what everybody is saying, it sounds like it's not possible.

Out of curiosity, how do you manage your remote servers if not via the command line? Do you have some sort of windowing environment set up on them that you access through a VNC client or similar? If it were possible to do away with the command line, I'd love to hear about it.

Thanks.


If you're running Linux on EC2 (or anywhere else for that matter), I strongly suggest you pick up an introductory Linux book. Any decent one will tell you about modeless editors like nano/pico, as well as introduce you to modal ones like Vim and emacs. It's not a huge investment of time and will probably spare you lots of headaches.


Depending on the distro used in your EC2 instance, it could be as easy as ssh'ing into it and then running:

sudo apt-get install nano

or whatever other package manager is used.


sudo apt-get install nano

It's either going to be that or

sudo yum install nano

Depending on which linux OS you're using. But it may already be installed.


  [root@domU-12-31-39-00-E8-E8 ~]# sudo yum install nano
  Setting up Install Process
  Setting up repositories
  Cannot find a valid baseurl for repo: updates-released
  Error: Cannot find a valid baseurl for repo: updates-released
That's pretty much what I get every time I try to install anything with yum. Are you saying that it can actually find and install software for you?

The only time it ever worked for me was installing Mono. I just assumed that there were very few software packages that it worked for and that you had to hand-install the rest.

Is there an easy way to teach it how to find stuff? If so, that would be great news.


In cases like this google is your friend. Just type "Cannot find a valid baseurl for repo: updates-released" (in quotes) into google.

I use Ubuntu and apt-get. It all just works. Don't know anything about yum myself.

edit: I'm guessing you're using Fedora 10? Here's the package list: https://admin.fedoraproject.org/pkgdb/collections/id/19


You're missing that a minimal headless environment is always going to be more painful than a full desktop.

Also, I suspect you're also missing that linux has package managers that will find, download, (possibly compile) and install packages for you. It depends on the distro, but if you're running a Debian derivative, 'apt-get install whatever-you-want' would find, download, and install it for you.


As I mentioned above, those package managers (apt-get & yum) have never actually worked in my experience. After a dozen failed attempts to install anything with any of them, I had just assumed that they weren't intended to install anything other than a few well-known packages.

Any idea how to teach yum to actually find anything?


You point it to a repository. Apt-get currently knows about near 35,000 packages, though, and I've never needed to point it to a separate repository.


So why even use it? If you're on linux grab Gedit or Kate, on OSX just use the built in textpad, and on windows, you've obviously got Notepad.


I'm forced to use it because it's the only text editor that comes pre-installed on Linux. I'd love to find something else. How does one go about "grabbing" these things? Are they usable in an SSH session?


Every Linux comes with the standard editor, Ed.


vimtutor

No one can do your job for you.


You may like cream ( http://cream.sourceforge.net/ ).


I hated vim the first time I ever tried it. It's "natural" to hate it if you're used to only Windowsy things (as I was).

After trying it out a couple of times, though, I came to realize that I like it.

Maybe you could give it another chance or two.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: