Python linters: black, flake8
Python fixer: isort
Cpp linter: cppcheck
Cpp fixer: clang-format
Xml linter: xmllint as part of libxml2-utils
Code documentation tool: doxygen
Fuzzy file searcher: fzf
All of these can be installed with sudo apt-get install <program_name>
- Git clone this repository into the base directory, usually
~/
cd ~/ && git clone [email protected]:CJans121/.vim.git
- If you haven't installed the above requirements yet, install all of them at once with:
cat ~/.vim/supplements/requirements.list | xargs sudo apt-get -y install
- Create a folder called "bundle" inside this repo and git clone the vim plugin manager, Vundle into it:
mkdir ~/.vim/bundle
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
- Create a symlink for the .vimrc file in your base directory:
ln -s ~/.vim/.vimrc ~/
- Open VIM and enter the following command to install the vim plugins
:PluginInstall
- To setup the Markdown Preview plugin, execute the following command as well
:call mkdp#util#install()
- If you want C++ and python autocompletion for ROS and ROS2, compile YCM by:
cd ~/.vim/bundle/YouCompleteMe/
python3 install.py --clang-completer
Python autocompletion is ready at this point. However, for C++ additional compilation flags need to be passed to YCM through a compile_commands.json file. For ROS, this can be done by configuring catkin-tools with an additional CMake argument. Navigate to catkin workspace, and execute the following command and catkin build:
catkin config --cmake-args \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
or for workspaces built with catkin_make:
catkin_make \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
For ROS2, navigate to colcon workspace, execute the following command, and colcon build:
colcon build --cmake-args \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
Finally, copy to ROS workspaces the python script that tells YCM where to look for the compile_commands.json file:
cp ~/.vim/supplements/.ycm_extra_conf.py ~/<ROS_ws>
You are all set