|
2 | 2 |
|
3 | 3 | Develop your next Repo in a Devcontainer using *nvim* thanks to the |
4 | 4 | [Devconatiner CLI](https://github.com/devcontainers/cli) and this plugin |
5 | | - |
6 | | - |
7 | | -As you can see in the GIF above, |
8 | | -[alacritty](https://github.com/alacritty/alacritty) is being used as a Terminal |
9 | | -Emulator. Any of the ones recommended [here](https://www.lazyvim.org/) would |
10 | | -work. For dotfiles setup I would recommend looking at the `devcontainer` branch |
11 | | -of [my dotfiles](https://github.com/erichlf/dotfiles). The `install.sh` script is |
12 | | -quite simple, but should be very informative. |
| 5 | + |
| 6 | + |
| 7 | +As you can see in the GIF above, guake with tmux is being used. Any of the ones |
| 8 | +recommended [here](https://www.lazyvim.org/) would work. For dotfiles setup I created |
| 9 | +a version of my dotfiles that doesn't have any private submodules. These dotfiles |
| 10 | +are probably more than what anyone would want, but if feel free to use them. The |
| 11 | +one gotcha with them is that it requires the environment variable DEV_WORKSPACE |
| 12 | +to be set. I would recommend looking at the `devcontainer-cli` branch of |
| 13 | +[my dotfiles](https://github.com/erichlf/dotfiles). The `install.sh` script ends |
| 14 | +up calling `script/devcontainer-cli` which is quite simple, but should get you |
| 15 | +some pretty good ideas of how things can be setup. |
13 | 16 |
|
14 | 17 | --- |
15 | 18 |
|
@@ -86,28 +89,6 @@ make assumptions about how you work. |
86 | 89 | { |
87 | 90 | "erichlf/devcontainer-cli.nvim", |
88 | 91 | dependencies = { 'akinsho/toggleterm.nvim' }, |
89 | | - opts = { |
90 | | - -- whather to verify that the final devcontainer should be run |
91 | | - interactive = false, |
92 | | - -- search for the devcontainer directory closest to the root in the |
93 | | - -- directory tree |
94 | | - toplevel = true, |
95 | | - -- Remove existing container each time DevcontainerUp is executed |
96 | | - -- If set to True [default_value] it can take extra time as you force to |
97 | | - -- start from scratch |
98 | | - remove_existing_container = true, |
99 | | - -- By default, if no extra config is added, following nvim_dotfiles are |
100 | | - -- installed: "https://github.com/erichlf/dotfiles" |
101 | | - -- This is an example for configuring other dotfiles inside the docker container |
102 | | - dotfiles_repository = "https://github.com/erichlf/dotfiles.git", |
103 | | - dotfiles_branch = "main", -- branch to clone from dotfiles_repository` |
104 | | - dotfiles_targetPath = "~/dotfiles", -- location to install dotfiles |
105 | | - dotfiles_intallCommand = "install.sh", -- script to run after dotfiles are cloned |
106 | | - shell = "bash", -- shell to use when executing commands |
107 | | - -- The particular binary to use for connecting to in the devcontainer |
108 | | - -- Most likely this should remain nvim |
109 | | - nvim_binary = "nvim", |
110 | | - }, |
111 | 92 | keys = { |
112 | 93 | -- stylua: ignore |
113 | 94 | { |
@@ -140,8 +121,33 @@ make assumptions about how you work. |
140 | 121 | "<CMD>DevContainerToggle<CR>", |
141 | 122 | desc = "Toggle the current DevContainer Terminal" |
142 | 123 | }, |
143 | | - } |
144 | | -}, |
| 124 | + }, |
| 125 | + init = function() |
| 126 | + local opts = { |
| 127 | + -- whather to verify that the final devcontainer should be run |
| 128 | + interactive = false, |
| 129 | + -- search for the devcontainer directory closest to the root in the |
| 130 | + -- directory tree |
| 131 | + toplevel = true, |
| 132 | + -- Remove existing container each time DevcontainerUp is executed |
| 133 | + -- If set to True [default_value] it can take extra time as you force to |
| 134 | + -- start from scratch |
| 135 | + remove_existing_container = true, |
| 136 | + -- By default, if no extra config is added, following nvim_dotfiles are |
| 137 | + -- installed: "https://github.com/erichlf/dotfiles" |
| 138 | + -- This is an example for configuring other dotfiles inside the docker container |
| 139 | + dotfiles_repository = "https://github.com/erichlf/dotfiles.git", |
| 140 | + dotfiles_branch = "devcontainer-cli", -- branch to clone from dotfiles_repository` |
| 141 | + dotfiles_targetPath = "~/dotfiles", -- location to install dotfiles |
| 142 | + dotfiles_intallCommand = "install.sh", -- script to run after dotfiles are cloned |
| 143 | + shell = "bash", -- shell to use when executing commands |
| 144 | + -- The particular binary to use for connecting to in the devcontainer |
| 145 | + -- Most likely this should remain nvim |
| 146 | + nvim_binary = "nvim", |
| 147 | + } |
| 148 | + require('devcontainer-cli').setup(opts) |
| 149 | + end, |
| 150 | +} |
145 | 151 | ``` |
146 | 152 |
|
147 | 153 | The default_config can be found [here](./lua/devcontainer_cli/config/init.lua). |
@@ -204,6 +210,5 @@ make test |
204 | 210 | (`:DevcontainerUp<cr>`) is closed when the process finishes successfully. |
205 | 211 | 4. [x] [Give the possibility of defining custom dotfiles when setting up the devcontainer](https://github.com/erichlf/devcontainer-cli.nvim/issues/1) |
206 | 212 | 5. [x] Add unit tests using plenary.busted lua module. |
207 | | -6. [ ] The logs printed in the floating window when preparing the Devcontainer |
208 | | - are saved and easy to access. |
| 213 | +6. [x] Create a logger. |
209 | 214 | 7. [x] Convert bash scripts in lua code. |
0 commit comments