Skip to content

CJans121/.vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VIM Ubuntu Setup

Requirements

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>

Instructions

  1. Git clone this repository into the base directory, usually ~/
cd ~/ && git clone [email protected]:CJans121/.vim.git
  1. 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

  1. 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
  1. Create a symlink for the .vimrc file in your base directory:
 ln -s ~/.vim/.vimrc ~/
  1. Open VIM and enter the following command to install the vim plugins
:PluginInstall
  1. To setup the Markdown Preview plugin, execute the following command as well
:call mkdp#util#install()

Optional

  1. 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

Credits12

Footnotes

  1. Gruvbox theme from morhetz/gruvbox

  2. ROS autocompletion from Briancbn/ros_vim_autocomplete

About

VIM setup with plugins

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published