Skip to content

taDachs/ros-nvim

Repository files navigation

ros-nvim

Neovim ROS

Ros plugin for neovim

Installation

lazy.nvim

require("lazy").setup({
...
    {
        'tadachs/ros-nvim',
        config = function() require("ros-nvim").setup({only_workspace = true}) end,
        dependencies = { "nvim-lua/plenary.nvim" },
    },
...
})

You have to install treesitter and telescope separately. To install the grammar for syntax highlighting run TSInstall ros.

Features

  • Rosed command with tab completion
  • RosSource command for resourcing your workspace
  • Roscd command for changing directory
  • follow $(find ...) links in launch files
  • show message and service definitions in floating windows
  • autocmcds for setting ros filetype for definition files (messages, services, actions), sets commentstring as well
  • (optional) telescope finder
  • (optional) syntax highlighting for definition using treesitter
  • supports ROS2

Example Setup

Default Config

{
  lazy_load_package_list = true,
  telescope = {
    ws_filter = "current",
  },
  treesitter = {
    enabled = true,
  },
  commands = {
    enabled = true,
  },
  autocmds = {
    enabled = true,
  },
}

Keymaps

-- telescope finder
vim.keymap.set('n', '<leader>tr', '<cmd>Telescope ros ros<cr>', { noremap = true })

-- follow links in launch files
vim.keymap.set('n', '<leader>rol', function() require("ros-nvim.ros").open_launch_include() end, { silent = true, noremap = true })

-- show definition for interfaces (messages/services) in floating window
vim.keymap.set('n', '<leader>rdi', function() require("ros-nvim.ros").show_interface_definition() end, { silent = true, noremap = true })

Contributors