Seemy integration of Vim in Eclipse

author Posted by: whaledawg on date Aug 2nd, 2009 | filed Filed under: general

So in my last post I mentioned that I want to start doing mobile apps and I chose to work with Android(I’ll explain why later). And Android has proven to be great, but developing in it has forced me to use Eclipse, which is…less than great.

Now when I say forced it’s not like anyone from Google came to my house and threatened me but all the learning material I’ve come across, from the free stuff on the web to published books to what Google puts out themselves, assumes that you are using it. There are some explanations of how to do things without Eclipse but when you’re learning something you should always try as best you can to mirror the environment of who ever’s teaching. It helps narrow down the origin of errors.

And when I say it’s less than great I don’t mean it’s bad. I just don’t like IDEs, and for 2 main reasons. They hide things I should know from me and force me to do things their way. As an example of the first one, Eclipse has this nice feature that allows you to hit CTRL-SHIFT-o and it will automatically import any packages you need for a java file. Very convient. Except now I don’t know what packages corrolate with which objects. Even the most dynamic of languages force you to import foreign code expliciatly, that tells me that this is information the programmer should know.

As an example of the second one, it’s a pain in the ass to edit files in Vim. Every other text editor is notepad to me. I tried googling around and there are a few ways. The first if viPluggin, which seems good but it’s not free and to be honest I’m going to try and ditch Eclipse as soon as possible. Theres vimpluggin which I installed but it doesn’t work right/well. I couldn’t get arguments to Vim and I kept having to right-click and open-as to switch between Vim and the native text editor. And cosidering I sent a question to the support list and was promptly offered a deal on pills to make it ‘Thicker, longer, better.’ I’m going to assume it’s not supported anymore. I didn’t try Eclim but that seemed to be going backwards, adding Eclipse features to Vim. I need to make sure my developement environment is as close as possible to standard.

So what am I really looking for? I’d like to be able to edit files with full Vim functionality(including using my .vimrc file) and use the full feature set of Eclipse at the same time. And I’d like to be able to jump from one to the other seemlessly. That I did not accomplish(hence the title) but I have a hybrid approach that comes pretty close.

HowTo

So my two pronged approach involves installing VRapper so I can quickly switch to a Vim like navigation scheme within Eclipse. 4 keyboard strokes and I’m there. But it doens’t have the full functionality I need or take rc files(I can’t live without the elflord) so I used Eclipses built in ability to use an external editor. It’s a bit slower to start and switch back and forth but it works adequatly.

Elflord

Setting up VRapper

VRapper is an open source project that is constantly evolving and adding new features, but currently missing quite a few. Still, being able to navigate with the home keys and yank lines makes installing this worthwhile.

First, you have to add the repo path to your software updates. Click on Help->Software Updates:

You should the software window. Click on the tab Available Software and the button Add Site:

You’ll get a popup window that let’s you…add a sight. Go ahead and put in http://vrapper.sourceforge.net/eclipse-update-site

Then click OK and you’ll have this repo added to your list. Select Vrapper and then press Install

Then just click through until it starts installing and restart. You should now notice a new button on your toolbar:

Pressing the button toggles Vim edditing mode on and off. Congratulations, you now have some vim functionality available to you. However, it’s still kind of a pain to use. You have to close whatever you’re working on, click the button then open it again. I could open it in Vim for that much effort.

So what we’re going to do is set up a hot key to toggle Vim mode, then we can switch back and forth from VRapper to native Eclipse editing with a few keystrokes.

First we need to open up the preferences. Go to Window->Preferences

Then expand General, select Keys and type vrapper into the filter.

Then type any key combo you want into the binding box(I chose VV) and done. Now typing those keys toggles Vim mode on and off. You still have to close and reopen the file, but I can do entirely from the keyboard(CTRL-W closes, F3 opens a file). So I type CTRL-W SHIFT-v SHIFT-v F3 and I can jump from one mode to the other. There’s probobly a way to macro that all into one keypress for Eclipse but that’s fast enough for my needs.

However, VRapper is still missing a lot of Vim functionality. No macros, no rc files, etc. So I also want to be able to open files from Eclipse directly in gVim.

Setting up gVim

This is actually pretty easy using Eclipse’s ability to call external editors. If I could find a way to do this with keystrokes instead of using the mouse I wouldn’t even bother with VRapper.

optional

I don’t call gVim directly from Eclipse because I want it to behave slightly differently when I’m editing files from Eclipse. This means I set up a little bash script in my home directory that looks like this:

/usr/bin/gvim -U /home/whaledawg/.vimeclipserc -- $1

That calls gVim and gives it an rc file I use just for Eclipse. The rc file looks like this:

set noswapfile
set nobackup
set noswapfile
set nobackup

Note: if you do this then the bash script must be named gvim. gVim checks the name of whatever calls it and it must be gvim or it won’t work.

/optional

OK so again we need to go to Window->Preferences, expand Gernal but now we’re going to choose File Associations. If you click add you can add new file associations here(you may need to do this for *.java files) and if you select a file type you can see all the associated editors in the bottom window:

Clicking Add(next to the associated editors) allows us to add a new editor to that file type(these are the editors that appear when you right click a file in Eclipse and choose “Open with”) From the pop up window select External Programs and then click Browse. If you created my bash script above, then you would browse to tha script(make sure it’s permissions are executable) or if not you will browse to wherever gvim is on your system.

Now if you right click on a file of that type and mouse to Open With you’ll see gvim as an option. Hurray.

There’s still a minor problem though. If you have a file open in Eclipse and open it again with gVim it will either not update the changes to Eclipse or will give you an annoying prompt. Let’s fix that.

Again under Window->Preferences->General, we’ll find Workspace. You don’t need to expand Workspace, just select it and you’ll see some options. Check Refresh Automically and it will automatically update your open files in Eclipse if you edit them with an external editor.

Click OK and that’s it.

Now you have a quick way to get most of the functionality in Vim and a slightly more cumbersome way to get the full functionality. While far from perfect, this approach has worked for me so far, at least until I’m able to dump Eclipse completely(which I hope to do in the near future).

An app of terrible genious

author Posted by: whaledawg on date Jul 9th, 2009 | filed Filed under: general

In searching the Market for a new not taking app for the G1, I happened across Magic Note. I was intrigued because it said it was based on pbwiki. I thought that a very smart idea, as my traditional note tool was TomBoy and I always thought that if you took it one step further you basically had a wiki.

So I install it, and go about the very basic task of making a grocery list. The UI is very simple: a name for the note, a text area and 2 buttons. Load and Save. I type in the name “grocery list”, add my items and press Save and at the bottom I get a message:

You can edit this not on your computer at notes.pbwiki.com/grocery-list

And I realize, it’s not some striped down version of the pbwiki source code creating a simple database on your phone. It just uploaded my grocery list to a wiki. WTF!

In fact, go to http://notes.pbworks.com/grocery-list right now. You can edit my grocery list. Go ahead, add “penis”. I know you want to.

In case you are at all unclear on what I just said, my basic note taking app uploads my personal notes to the internet and allows anyone to edit them. And when you go there, sure enough you can see other notes people have recently posted. Under http://notes.pbworks.com/concert you’ll find:

Marina del rey symphany @ 7pm..

Did I say 7? Better make it 6. Or 5, can’t be to sure. I wouldn’t want to miss the symphony(at least the wiki will allow me to fix this guys spelling).

And in case you’re doing the math at home, this seems like a recipe for namespace collisions. I can’t imagine I’m the only guy who wants a grocery list. I doubt the next one will want exactly the same things(unless he loves penis as much as I apparently do. Who keeps editing that?)

But if you want to access notes you created from your phone, you’d better remember what you called them. Because this app stores nothing on your phone. It has no idea what notes you’ve created, so if you need to load it onto your phone you need to remember exactly what you called it. Maybe that’s why that other guy called his note “concert” and not “symphany”.

So, in conclusion, Magic Note is perhaps the worst note taking application ever. I expect 2 things from my note app, it should store what I write and make it easy to access/search for my notes. Magic Note half does one of those things.

But……

While I found this to be an atrocious note taking app, it’s a pretty decent wiki accessing app. The experience is at least streamlined, not always easy with a phone app. And if you fixed the things that stop this from being a great ‘wiki page editor’ app, you’ll also make it a somewhat decent note taking app at the same time. So here’s where I think this should go:

  1. Give me an identifier field. Something to distinguish my grocery list from someone else’s or a simple form of classification. Hell, just slapping my initials on the front increases the namespace by 45k. I know you could do this inside the name box but that’s confusing to users, so they won’t.
  2. Don’t list the most recent edited files on the web page. That’s not going to be useful to anyone except griefers.
  3. Give me a damn history. I should be able to hit menu and get a list of the pages I’ve viewed/edited in order. Otherwise you can’t have more than 3 notes.
  4. Make it easy to share this page with friends, family and colleagues. I know you tell me the URL, but being able to pop up a list of contacts and email them a link would be worlds better. It would actually make this useful.

I think this app was made by a smart guy who wanted to make an Android app, but didn’t want to really think about how users were going to use this app. But a little inovation(linking it with pbwiki) means he’s actually very close to a great app. Just not the one he set out to write.

What the hell?

author Posted by: whaledawg on date May 3rd, 2009 | filed Filed under: general

While I’d love to be playing Warhammer right now, Charter’s service is screwy today. It’s not slow, but I’m getting 10-30 second spans of no activity. Which means I am wandering around the server like a ghost as everyone fades in and out, but that’s only interesting for so long.

So I decided to sit down and get Android running, which I’ve been poking at for weeks. I was hesitant because you have to install Eclipse and some special pluggins and blah blah blah.  So I install it and the Android SDK and create a project and…nothing. I’m looking at the same welcome screen I’ve seen the whole time.

Eclipse welcome

I assumed when you create a project it would open it up, probably in a tab next to the Welcome tab. So I check the files, everything was created. Delete, restart Eclipse and do it all over again. Still nothing. Can’t open a project under File or the Project menu.  In my random attempts to get something to happen I click on the X next to Welcome and boom, there’s my project.

So the people who make Eclipse essentially decided to add a fake tab at the top of a Welcome screen that covered up any work you tried to do. So anyone who fires it up for the first time is actively fooled into clicking through the Welcome interface.

At what point did free software become evil?

  • chicago bears 61
  • chad ochocinco height and weight
  • chicago bears posters
  • randy moss height
  • cspan kucinich
  • dope
  • bengals kids jersey
  • greg olsen 2009 calendar
  • chicago bears schedule 2011
  • hp support chat
  • randy moss bio
  • battleship kirishima
  • c span youtube obama
  • gregg olsen books
  • hp support hard drive replacement
  • search dog foundation
  • bengals for adoption
  • tea party for kids
  • la ink phone number
  • battleship bismarck wreck
  • freida pinto miral
  • hp support 530
  • chicago bears 96
  • chad ochocinco yesterday
  • tea party 8 28 09
  • freida pinto chanel
  • wolff
  • randy moss college
  • agents
  • chicago bears number 17
  • wave
  • hp support venezuela
  • chicago bears 2009 roster
  • la ink jabberwocky
  • disconnect
  • bengals merchandise
  • vince young stats
  • la ink corey
  • search and seizure
  • chad ochocinco johnson
  • summertime
  • search engines of the world
  • mtv 25 lame
  • search engines other than google
  • hp support 6930p
  • chicago bears 08 record
  • randy moss 07 08 highlights
  • bombings
  • dis boards cruise
  • bengals images
  • randy moss 98 vikings
  • rooms
  • search 32
  • freida pinto jeansfreida pinto kissing
  • new england patriots 3 4
  • search engines usage statistics 2010
  • whaler
  • search tumblr
  • tea party chicago
  • dis systems
  • zara phillips school
  • meeting
  • search vim
  • connie
  • stadium
  • connecticut 97.7connecticut attorney general
  • connecticut lottery
  • mtv website
  • connecticut airports
  • mtv rivals
  • volunteer
  • denso
  • la ink 03x05
  • zara phillips kids
  • chicago bears 09 draft
  • tea party hats
  • new england patriots 07
  • la ink games online
  • tea party nj
  • gearbox
  • battleship texas hours
  • dis pater
  • new england patriots 84
  • frazer
  • hp support greece
  • chad ochocinco quotes video
  • hull
  • vince young usc
  • geography
  • dis windsor wi
  • 22lr
  • vince young football camp
  • want
  • bea karp
  • chicago bears 17 lisa lampanelli
  • vince young released
  • la ink tattoos
  • search with image
  • bengals xxiii
  • bengals tryouts
  • vince young depression
  • chicago bears 1985
  • tea party agenda
  • kayaking
  • zara phillips baby
  • vince young 3rd 30
  • la ink season 6
  • new england patriots wiki
  • search engines for jobs
  • sense
  • bea test
  • chad ochocinco parents
  • bea luna
  • bea 4603
  • beagle
  • bea 2011 map
  • search operatorssearch people
  • disassembledis boards
  • hp support center
  • tavern
  • sahara
  • la ink season 5 premiere
  • connecticut sun
  • iver
  • anual
  • new england patriots 50
  • bea diy
  • chicago bears football club
  • bengals games
  • chad ochocinco quits football
  • randy moss arrested
  • widget
  • la ink show
  • bengals new uniforms 2012
  • mtv true life
  • battleship wilmington nc
  • zara phillips yachtzara phillips zimbio
  • bengals forum
  • vince young rivals
  • acessories
  • 10000
  • c span shelby foote
  • chicago bears pictures
  • cingular
  • bengals arrests
  • diamondback
  • search 78search 800 numbers
  • aires
  • bengals cheerleaders tryouts 2011
  • dis poem
  • c span kozol
  • dis lyrics
  • accumulator
  • freida pinto 1995
  • mtv overdrive
  • winston
  • la ink bam margera
  • new england patriots xxl
  • sling
  • dillon
  • new england patriots espn blog
  • search google cache
  • search 990 filings
  • hp support assistant review
  • greg olsen twitter
  • chad ochocinco age
  • connecticut lakes
  • search engines compared
  • mtv 30 years
  • vince young dadvince young eagles
  • centurion
  • connecticut 7 day weather forecast
  • bea verdi
  • connecticut education
  • new england patriots helmet
  • search engines 9
  • dist 91
  • cspan washington correspondents dinner 2011
  • chad ochocinco and cheryl burke
  • search domains
  • eyelet
  • whirlpool
  • la ink watch online free
  • battleship classes
  • search engines and flash
  • connecticut 104.1
  • chad ochocinco quickstep
  • intrest
  • mtv cartoons
  • vince young jay cutler
  • protective