Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Edit a Google doc with vim (commandlinefu.com)
63 points by obilgic on Dec 9, 2013 | hide | past | favorite | 18 comments


When I try to open an existing spreadsheet this way, it crashes:

  ~ $ google docs edit --title "skijanje"
  Traceback (most recent call last):
    File "/usr/bin/google", line 849, in <module>
      main()
    File "/usr/bin/google", line 835, in main
      run_once(options, args)
    File "/usr/bin/google", line 627, in run_once
      task.run(client, options, args)
    File "/usr/lib/pymodules/python2.7/googlecl/docs/__init__.py", line 206, in _run_edit
      folder_entry_or_path=folder_entry or options.folder)
    File "/usr/lib/pymodules/python2.7/googlecl/docs/base.py", line 129, in edit_doc
      subprocess.call(command_args)
    File "/usr/lib/python2.7/subprocess.py", line 522, in call
      return Popen(*popenargs, **kwargs).wait()
    File "/usr/lib/python2.7/subprocess.py", line 709, in __init__
      errread, errwrite)
    File "/usr/lib/python2.7/subprocess.py", line 1326, in _execute_child
      raise child_exception
  OSError: [Errno 2] No such file or directory
I guess I was expecting some magic, i.e. a spreadsheet automatically converted to/from CSV or YAML. :)


For me, it displays the XLS file, but it doesn't convert it to anything human readable (Using OS X 10.8 and vi).


(2010) and looks like it hasn't got any updates in a couple years unfortunately.


Indeed, googlecl hasn't seen much love lately. :(

I recently wrote a tool in the spirit of googlecl, that lets you call Google APIs from the command-line, although admittedly without support for editing Google Docs in Vim. Something like that may be possible to add though.

Check it out: https://github.com/ImJasonH/gapi


Last release for googlecl is from 3/31/11 :(


Can someone post a screenshot of how it looks like?


Not being a grammar Nazi, but just pointing out a minor error to help with your English: if the sentence ends in "like", then you should use "what":

Can someone post a screenshot of what it looks like?


I'm not GP but thanks for the tip!

As a non-native speaker, I'd love if I were corrected all the time! These little mistakes are prone to getting stuck in your head and hard to get rid of if uncorrected (especially since the Internet is filled with non-native speakers making the same mistakes over and over again).

Curiously enough, I hesitate doing so myself when I notice a mistake, in case I bother or embarrass the guy. I think I'll start changing that :P


Looks like vim, it's just a vim buffer with the contents of the google doc. Not sure how it handles things like tables/images though.


I'm also pleased to see an upload feature from terminal. Avoiding the interface YouTube has in place is great, I always seem to get bugs regarding upload times and it freezing.


The title should be suffixed (2011), reflecting the latest changelog date by the 'googlecl' author.


This is a killer feature for google interviews.


I just tried it out, and it seems it doesn't update after a save, you have to quit the document, so it's not real-time enough for an interview.


FYI, Floobits offers real time collaboration with vim.


Vimperator and ^I as well, no?


Lol.

Now if you can teach me how to edit Ms Word documents with vim, you win the prize :)


If you're on a Mac you can use KeyRemap4MacBook's vi mode in Word.

https://pqrs.org/macosx/keyremap4macbook/


When you are on a Mac you can use XCode! Hell Yes!!!




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

Search: