Tips for using Vim for Chromium development?

405 views
Skip to first unread message

Ilya Sherman

unread,
Sep 21, 2018, 6:02:15 PM9/21/18
to chromium-dev, Aidan Day, Rouslan Solomakhin
TL;DR: Does anyone have any tips for effectively using Vim for Chromium development?

---

I'm trying to help a new team member, Aidan, get set up for Chromium development. He prefers to use Vim, which I'm not very familiar with. I'm guessing that there are some plugins/autoformatters that are useful to plug in for Chromium development, but I'm not quite sure where to look. Much to my surprise, the Editor Guides under https://www.chromium.org/developers do not include a page on Vim development.

Does anyone have any tips for Aidan. And, would anyone perhaps be willing to go the extra mile and write up a helpful doc that could be included under the Editor Guides?

Thanks!
~ilya

Christian Biesinger

unread,
Sep 21, 2018, 6:13:45 PM9/21/18
to Ilya Sherman, chromium-dev, aida...@google.com, Rouslan Solomakhin
There seems to be
https://chromium.googlesource.com/chromium/src/tools/vim/+/HEAD/

But I don't really know much about it...
> --
> --
> Chromium Developers mailing list: chromi...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-dev
> ---
> You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
> To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAA3nRah0uu52vCq1UnCPfEvJjb%3DbRkxs3Hzg_DfxeeHHKuBLMQ%40mail.gmail.com.

Nico Weber

unread,
Sep 21, 2018, 6:45:56 PM9/21/18
to Christian Biesinger, Ilya Sherman, Chromium-dev, aida...@google.com, Rouslan Solomakhin
Welcome, Aidan! I do almost all of my Chromium development in vim.

As Christian said, there's a bunch of stuff in tools/vim. clang-format.vim adds a "format this line" shortcut, which is handy. ninja-build.vim has a "compile this file (or target)" shortcut which I sometimes use.

Some folks like YCM and there's an example config in that folder, but I don't use that myself.

https://github.com/chromium/vim-codesearch is cs.chromium.org integration for vim, which gives you working 'jump to definition' and whatnot. (But I use cs.chromium.org directly most of the time.)

If you have any questions, feel free to ask me on IRC or hangouts :-)

Scott Graham

unread,
Sep 21, 2018, 6:47:54 PM9/21/18
to Ilya Sherman, aida...@google.com, chromium-dev, rou...@chromium.org, Christian Biesinger
I really really like having buildtools/clang_format/script/clang-format.py and https://gn.googlesource.com/gn/+/master/tools/gn/misc/vim/gn-format.py (personally, I bind to <F1>) instead of using git cl format which I find a bit slow. (There's a GN syntax near there too if you're working on build files.)

Depending on what you're working on, asanka@'s https://github.com/chromium/vim-codesearch can be very helpful.

There's a YCM config file too, but I've always found YCM too much of a hassle to get working, and it makes things feel sluggish when it is working.

ctrlp and alt are two plugins that I use a bazillion times a day on Chromium.

Other than that, just the usual: generate a tags file, and spend a few minutes making sure your tabstop, colorcolumn, encoding, etc. all get set properly when you're in the chromium tree.



Scott Graham

unread,
Sep 21, 2018, 6:49:14 PM9/21/18
to Nico Weber, Christian Biesinger, Ilya Sherman, chromium-dev, aida...@google.com, rou...@chromium.org
Ha, another rule of Chromium development (Vim or otherwise...). Just ask Nico for a quick(er) answer.  ;-)

Rouslan Solomakhin

unread,
Sep 24, 2018, 11:32:16 AM9/24/18
to aida...@google.com, Scott Graham, tha...@chromium.org, Christian Biesinger, Ilya Sherman, Chromium-dev
Welcome Aidan!

Chromium is huge and, therefore, developers greatly benefit from efficient search tools. I found fzf.vim to be the best combination of speed and convenience. I have it integrated into my vimrc using vim-plug, which is also very fast.

Good luck!

Cheers,
Rouslan

On Fri, Sep 21, 2018 at 7:35 PM Aidan Day <aida...@google.com> wrote:
Thanks for the advice, folks! I'll follow up over individually if I have any questions :)

Cheers,
Aidan
Reply all
Reply to author
Forward
0 new messages