- Configure YouCompleteMe to provide error checking, code completion, and source navigation within the Fuchsia tree.
- Set path so that
gfknow how to find files.
- Fidl syntax highlighting (using /lib/fidl/tools/vim/).
- Basic build system integration so that
:makebuilds and populates the QuickFix window.
Update your login script:
Steps #2 and #3 depend on configuration set by the
fx setcommand. Add these lines to your startup script (typically
export FUCHSIA_DIR=/path/to/fuchsia-dir fx set core.x64
Update your Vim startup file:
If this line exists in your
~/.vimrc file, remove it:
filetype plugin indent on
Then add these lines to your
if $FUCHSIA_DIR != "" source $FUCHSIA_DIR/scripts/vim/fuchsia.vim endif filetype plugin indent on
Install YouCompleteMe (YCM):
Optionally install YouCompleteMe for fancy completion, source navigation and inline errors.
If it's installed,
fuchsia.vimconfigures YCM properly.
If everything is working properly, you can place the cursor on an identifier in a .cc or .h file then hit Ctrl+], to navigate to the definition of the identifier.
fx compdbto build a compilation database. YCM will use the compilation database which is more reliable and efficient than the default
In the future it would be nice to support: * Fidl indentation * GN indentation * Dart, Go and Rust support * Navigate between generated files and fidl source
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.