Neovim as IDE in Docker container. The idea is to create comfy programming environment for various languages with usage of Docker. On host machine there should be the least of dependencies connected with development environment. Only Docker should be required, so development environment can be used on any computer - work, private or even VPS. Base image will contain Git and Neovim installation with basic configuration for itself and extensions like file explorer, Git integration, support for files like JSON, HTML, CSS, etc. From base image there will be created images for specific programming languages, so base configuration will be extended per programming language.
All images build with this repository will be available on Docker Hub.
WARNING: all images on Docker Hub with dev tag are using the newest stable version of Neovim installed from source.
Detailed images description (every directory matches single image, directory name represents image name).
How to run image? For testing it could be:
docker run -it mashmb/nvim:[tag] /bin/bash
For work suggested is docker-compose.yml file where configuration will be more tidy. Programming projects should be mounted from host to /root/workspace/ directory:
version: '3.8'
services:
nvim:
image: mashmb/nvim:[tag]
deploy:
replicas: 1
resources:
limits:
memory: 2G
volumes:
- [path_to_projects]:/root/workspace
Base Neovim image. Software installed:
- curl - for downloading stuff
- fzf - for fast files search
- ripgrep - for fast text occurrence search
- tree - files tree visualization
- Git - Git support inside container (with GIT Flow)
- Lazygit - Git visualization inside terminal
- xclip - clipboard handling
- Python 3 - for proper Neovim work
- pip - for Python 3
- NodeJS - for proper Neovim work
- npm - for NodeJS
- tzdata - for default container timezone settings
- Everything needed to install Neovim from source
All components for Neovim are installed (pynvim with pip and neovim with npm).
Image contains general settings and some key bindings for Neovim (saved in /root/.config/nvim/general/).
Spell check for English and Polish is added.
Europe/Warsaw as default timezone.
Extensions are managed by Vim Plug. Installed and configured extensions:
- Gruvbox theme
- Airline status bar
- Files tree (with Git integration and icons pack)
- Welcome screen
- Fuzzy finder (search for file and text occurrence)
- Git integration
- Hex colors preview support
- Conquer of completion:
- Code completion
- Code documentation
- Symbols and references highlighting
- Code formatting
- Code actions (optimize imports, generate, etc.)
- Project scope renaming
- Go to definition
- Go to type definition
- Go to implementation
- Go to declaration
- References
- Quick fix
- Code diagnostics
- Code outline
- Symbols search
- Debugger
Supported languages:
- CSS
- HTML
- JavaScript
- JSON
- SH
- SQL
- YAML
For users that type really fast on keyboard, Conquer of Completion can be too slow. You can disable auto completion with setting in coc-settings.json:
"suggest.autoTrigger": "none"
Completion will be available on shortcut Ctrl + Space.
File can be saved once without formatting with noa w command.
Additionally there are some Bash aliases:
alias cl="clear"
alias ls="ls -al --color"
alias du="du -h"
alias vi="nvim"
alias vim="nvim"
alias lg="lazygit"
alias gf="git flow"
Neovim background is transparent. It can be disabled in Neovim configuration (.config/nvim/general/settings.vim line 85).
Image dedicated for Flutter development. It is overriding the base nvim image. Conquer of completion is realized with:
- coc-flutter
- dart-vim-plugin (syntax highlighting)
This image contains raw Flutter installation (no Android SDK, etc.).
For Android development follow the tutorial. There are two ways to run Android emulator:
- Install and configure
xauth
(tutorial), nextly install emulator in container and run it (remember about Docker privileged mode - without it there will be no hardware acceleration required by emulator). - Install Android SDK on host and in Docker container, connect to emulator on host over
adb
.
Image dedicated for Go development. It is overriding the base nvim image. Conquer of completion is realized with:
- coc-go
- gopls
Image has configured debugger for Go development with usage of vimspector (required Delve is installed also).
Image dedicated for Oracle Java 8 development. It is overriding the base nvim image. Conquer of completion is realized with:
- coc-java
- Eclipse JDT Language Server (for Oracle Java 8, version 0.57.0 is required)
Image has configured debugger for Oracle Java 8 with usage of vimspector and coc-java-debug.
Additionally coc-xml is installed for proper XML files handling with Java.
NOTE: to use Lombok it should be downloaded and mounted to container. Nextly it should be configured in coc-settings.json:
{
"java.jdt.ls.vmargs": "-javaagent:[path]/lombok.jar"
// "java.jdt.ls.vmargs": "-javaagent:[path]/lombok.jar -Xbootclasspath/a:[path]/lombok.jar" // older Java versions
}
Image dedicated for LaTeX files edition. It is overriding the base nvim image. Conquer of completion is realized with:
- coc-texlab
PDF output file can be built with :CocCommand latex.Build [file.pdf]
Image dedicated for OpenJDK 11 (Java 11) development. It is overriding the base nvim image. Conquer of completion is realized with:
- coc-java
- Eclipse JDT Language Server
Image has configured debugger for OpenJDK 11 with usage of vimspector and coc-java-debug.
Additionally coc-xml is installed for proper XML files handling with Java.
NOTE: to use Lombok it should be downloaded and mounted to container. Nextly it should be configured in coc-settings.json:
{
"java.jdt.ls.vmargs": "-javaagent:[path]/lombok.jar"
// "java.jdt.ls.vmargs": "-javaagent:[path]/lombok.jar -Xbootclasspath/a:[path]/lombok.jar" // older Java versions
}
Image dedicated for OpenJDK 17 (Java 17) development. It is overriding the base nvim image. Conquer of completion is realized with:
- coc-java
- Eclipse JDT Language Server
Image has configured debugger for OpenJDK 11 with usage of vimspector and coc-java-debug.
Additionally coc-xml is installed for proper XML files handling with Java.
NOTE: to use Lombok it should be downloaded and mounted to container. Nextly it should be configured in coc-settings.json:
{
"java.jdt.ls.vmargs": "-javaagent:[path]/lombok.jar"
// "java.jdt.ls.vmargs": "-javaagent:[path]/lombok.jar -Xbootclasspath/a:[path]/lombok.jar" // older Java versions
}
Image dedicated for Python3 development. It is overriding the base nvim image. Conquer of completion is realized with:
- coc-pyright
- coc-python
- jedi-language-server
Image has configured debugger for Python3 development with usage of vimspector.
All dependencies used to Python3 development are installed in virtual environment (/root/.env) so it can be easily modified with usage of volumes mounting. All user created virtual environments should be mounted in /root/envs.
For more flexible workspace manging, pyrightconfig.json file can be created and mounted in /root/ directory. Example configuration used to avoid import errors in workspace without env:
{
"reportMissingImports": false,
"reportGeneralTypeIssues": false
}
Image dedicated for Typescript development. It is overriding the base nvim image. Conquer of completion is realized with:
- coc-tsserver
Image has configured debugger for Typescript development with usage of vimspector.