fuchsia.vim script sets up Vim
to do the following:
- Set paths so that
gfknow how to find files.
- Enable FIDL syntax highlighting (using
- Integrate basic build system so that
:makebuilds and populates the QuickFix window.
- Configure YouCompleteMe (YCM) to provide error checking, code completion, and source navigation within the Fuchsia tree.
The steps are:
- Update your login script.
- Run the fx set command.
- Update your Vim startup file.
- Restart Vim to configure YouCompleteMe.
- Build a compilation database.
Update your login script
Add the following line to your startup script (typically
Run the fx set command
This command uses the format
fx set [PRODUCT].[BOARD]. For example:
fx set core.x64
Update your Vim startup file
If the following line exists in your
~/.vimrc file, remove it:
filetype plugin indent on
Then add the following lines to your
if $FUCHSIA_DIR != "" source $FUCHSIA_DIR/scripts/vim/fuchsia.vim endif filetype plugin indent on
Restart Vim to configure YouCompleteMe
To configure YouCompleteMe (YCM), you need to source the
Restart your Vim to run the
source $FUCHSIA_DIR/scripts/vim/fuchsia.vim command in your
file (see Update your Vim startup file).
To verify that your YCM works, place the cursor on an
identifier in a
.h file in Vim, then hit
to navigate to the definition of the identifier.
Build a compilation database
To build a compilation database, run the following command:
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.
Last updated 2019-12-30.