Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vimrc customization for googlecl use

Tags:

vim

I've started using google docs for collaborating with others who can't/won't break down and learn my standard vim/latex/git workflow for writing and collaborating. Google has a command line interface called googlecl which allows you to call something like:

$ googlecl docs edit --title "Some Document" --editor vim

which allows me to edit my google docs in vim.

What I'd really like though is to be able to change some vim settings if the file I'm working on is a google docs file. The easiest example here is changing the line wrapping. Is there a way to use an augroup type of construct for googlecl documents? Is this even possible currently, or would this require me poking around in the source?

like image 482
Bryan Ward Avatar asked Dec 13 '25 22:12

Bryan Ward


1 Answers

How about creating a very simple bash script in ~/bin that looks like this?

#!/bin/sh
vim -c 'set ft=google_docs' $@

Save that as ~/bin/google_vim and do chmod +x ~/bin/google_vim. Then create a file:

~/.vim/ftplugin/google_docs.vim

with the settings that you need (e.g. set nowrap or whatever) and start the editor with:

googlecl docs edit --title "Some Document" --editor google_vim

(assuming ~/bin is in your path: if not you could probably do --editor ~/bin/google_vim)

like image 183
DrAl Avatar answered Dec 16 '25 23:12

DrAl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!