jamestthompson3/nvim-remote-containers
关于
像在 VS Code 中一样,在 Docker 容器内开发。
系统与基础设施实测星标增长
- 24小时
- 0
- 7天
- +1
- 15天
- +1
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文NVIM-Remote-Containers
This plugin aims to give you the functionality of VSCode's remote container development plugin. It will allow you to spawn and develop in docker containers and pulls config information from a devcontainer.json file.
Available Lua Functions
parseConfig: parsesdevcontainer.jsonfile--takes in argument specifying type (dockerCompose, dockerFile, image)attachToContainer: Attaches to a docker container or builds a container from a user chose imagebuildImage: Builds container from the Dockerfile specified in thedevcontainer.jsonfile. Takes a boolean parameter to determine whether or not to show the build process in a floating window or in the quickfix list.composeUp: Brings docker-compose upcomposeDown: Brings docker-compose downcomposeDestroy: Destorys docker-compose containers
Available Vim Commands
AttachToContainerwrapper for theattachToContainerlua function.BuildImagewrapper for thebuildImagelua function, takes "true" or "false" as an argument to decide whether or not to show the build progress in a floating window.StartImagelists all available images and starts the one selected by you given the arguments found in thedevcontainer.jsonfile in your project's workspace.ComposeUpwrapper forcomposeUplua function.ComposeDownwrapper forcomposeDownlua function.ComposeDestroywrapper forcomposeDestroylua function.
Extras
Set your statusline to reflect the current connected container through g:currentContainer:
hi Container guifg=#BADA55 guibg=Black
set statusline+=%#Container#%{g:currentContainer}
Usage
Before using this plugin, you should install the jsonc treesitter module: :TSInstall jsonc, this is needed to parse the config file.
If you are in the root directory that has the .devcontainer/ folder, you can run the following vim commands:
" If you haven't built the image specified in your config.
" Takes `true` or `false` depending on whether or not you want to see the build progress in a floating window.
:BuildImage
" Attach to the container you just built / a previously built container
:AttachToContainer
" Start a container from a pre-built image
:StartImage
" Runs the docker-compose -f <file> up
:ComposeUp
" Runs docker-compose -f <file> down
:ComposeDown
" Runs docker-compose rm <file> -fsv
:ComposeDestroy
Contributing
Lua code is formatted in a pre-commit hook using stylelua. Please install this as part of contributing to the project.
Contributors using Linux may use the pre-push hook to ensure formatting. Install the pre-push hook by running tools/init.sh.
探索相关项目
加载中…