dgrbrady / nvim-docker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nvim-docker

Docker management right inside Neovim!

Features

Screenshare - 2022-07-20 5_59_58 PM (1)

  • Container management
    • View containers on your local machine with live reloading
    • Bring containers up/down
    • Remove and rebuild containers
    • Send commands to containers (SoonTM)
    • View container logs
  • Configurable (SoonTM)
  • Docker compose integration (SoonTM)
  • Image management
    • View images on you local machine with live reloading (SoonTM)
    • Create new containers from images (SoonTM)

Installation

Packer

use {
  'dgrbrady/nvim-docker',
  requires = {'nvim-lua/plenary.nvim', 'MunifTanjim/nui.nvim'},
  rocks = '4O4/reactivex' -- ReactiveX Lua implementation
}

How to use

In your lua config:

  local nvim_docker = require('nvim-docker')
  -- list containers
  nvim_docker.containers.list_containers()

  -- OR
  -- setting up keybindings since the `list_containers` fn does not have a default binding
  vim.keymap.set('n', '<leader>C', nvim_docker.containers.list_containers)

Default Keymaps

Binding Where Effect
j Top popup Move cursor down on container list
k Top popup Move cursor up on container list
l Top popup Expand container details
L Top popup Expand all containers
h Top popup Collapse container details
H Top popup Collapse all containers
r Top popup Restart container
dd Top popup Deletes container (asks for confirmation)
t Top popup View container logs
<Tab> Top popup Focus bottom popup
t Bottom popup Toggles whether the cursor should be stuck to the bottom of the popup. Helpful if you want to watch the latest logs as they come in
<S-Tab> Bottom popup Focus top popup

Roadmap

  • Interact with containers
    • Start container 12c8e6
    • Stop container 12c8e6
    • Restart container 39a1be
    • Delete container 98b561
    • View logs from container c71005
    • Run command in container
  • Interact with images
    • List image
    • Delete image
    • Create container from image
  • Docker compose integration
  • Provide options for user configuration
  • Documentation
  • Telescope integration?

Development

  • clone the project git clone https://github.com/dgrbrady/nvim-docker
  • go to the project folder cd nvim-docker
  • start editing nvim --cmd "set rtp+=."
  • reference the dev configurations :luafile dev/init.lua
  • run the containers.list_containers() function using ,w keybind

About

License:MIT License


Languages

Language:Lua 100.0%