|
2 | 2 |
|
3 | 3 |  |
4 | 4 |
|
5 | | -This is a template for python-based projects. Many DS/ML workflows require |
6 | | -hardware-specific platforms in detailed OS-level libraries and python |
7 | | -dependencies. In some cases, it is useful to perform code editing in the same |
8 | | -environment in which applications are run. This template can help vim users to |
9 | | -run vim-ide with the same project environment on a local or remote machine. |
10 | | -Please, feel free to massage everything in the template as you wish. |
| 5 | +<!-- vim-markdown-toc GFM --> |
11 | 6 |
|
12 | | -Vim is configured in a modern style and supports almost all ide-specific |
13 | | -features. Please see `.vimrc.dist` for reference. |
| 7 | +* [🧰 About the Template](#-about-the-template) |
| 8 | +* [✅ Features](#-features) |
| 9 | +* [🧪 Tested with](#-tested-with) |
| 10 | +* [🚀 Getting Started](#-getting-started) |
| 11 | + * [1. Configure environment and Python settings](#1-configure-environment-and-python-settings) |
| 12 | + * [2. Set up Python project dependencies](#2-set-up-python-project-dependencies) |
| 13 | + * [3. Build your Vim IDE image](#3-build-your-vim-ide-image) |
| 14 | + * [4. Start developing inside the container](#4-start-developing-inside-the-container) |
| 15 | + * [5. Update dependencies when needed](#5-update-dependencies-when-needed) |
| 16 | + * [6. Build and run your application](#6-build-and-run-your-application) |
| 17 | + * [📓 Optional: Run JupyterLab](#-optional-run-jupyterlab) |
| 18 | +* [🧠 Vim IDE Features](#-vim-ide-features) |
| 19 | + * [✨ Core Capabilities](#-core-capabilities) |
| 20 | + * [🔌Included Plugins](#included-plugins) |
| 21 | + * [🧠 Code Intelligence](#-code-intelligence) |
| 22 | + * [📁 Navigation & UI](#-navigation--ui) |
| 23 | + * [🔄 Git Integration](#-git-integration) |
| 24 | + * [📝 Markdown Support](#-markdown-support) |
| 25 | + * [📊 Data Science & Python Dev](#-data-science--python-dev) |
| 26 | + * [🎨 Theme & Aesthetics](#-theme--aesthetics) |
| 27 | + * [⚙️ Python-Specific Tuning](#-python-specific-tuning) |
| 28 | + * [🗂 Additional Notes](#-additional-notes) |
14 | 29 |
|
15 | | -Tested under versions: |
| 30 | +<!-- vim-markdown-toc --> |
16 | 31 |
|
17 | | -- docker `27.3.1` |
18 | | -- buildx `2.32.1` |
19 | | -- compose `2.32.1` |
| 32 | +## 🧰 About the Template |
20 | 33 |
|
21 | | -## How to use template |
| 34 | +**vim-python-docker-template** is a lightweight, flexible starting point for |
| 35 | +containerized Python development. It’s especially well-suited for data science |
| 36 | +and machine learning workflows that require OS-level packages, |
| 37 | +hardware-specific dependencies, or reproducible environments. |
22 | 38 |
|
23 | | -First, initialize the compose env, pick the required OS packages, and set the |
24 | | -python/poetry versions: |
| 39 | +This template allows you to write and run code inside the same containerized |
| 40 | +environment using **Vim configured as a full-featured IDE** — making it ideal |
| 41 | +for both local and remote development. |
25 | 42 |
|
26 | | -```bash |
27 | | -cp .env.dist .env |
28 | | -vim .env |
29 | | -``` |
| 43 | +Whether you're scripting pipelines, prototyping machine learning models, or |
| 44 | +building production tools, this setup provides a consistent, customizable |
| 45 | +workflow with Vim at the center. |
| 46 | + |
| 47 | +> ✨ Designed to work with *any* Python project — just plug in your code and |
| 48 | +> dependencies. |
| 49 | +
|
| 50 | +The configuration is intentionally minimal and easy to adapt. You’re free to: |
| 51 | +- Add or update Python dependencies |
| 52 | +- Swap in different OS packages |
| 53 | +- Customize the Vim environment |
| 54 | +- Change Python or Poetry versions |
| 55 | + |
| 56 | +Use it as-is or tailor it to match your team's development workflow. |
| 57 | + |
| 58 | +--- |
| 59 | + |
| 60 | +## ✅ Features |
30 | 61 |
|
31 | | -Edit the poetry configuration file to manage python project-specific things and |
32 | | -dependencies: |
| 62 | +- 📦 **Reproducible environments** for Python development |
| 63 | +- 🛠 **IDE-like Vim setup**, ready to go out of the box |
| 64 | +- 🐍 Supports custom **Python and Poetry** versions |
| 65 | +- 🧩 Simple to extend with Jupyter, SQL drivers, and more |
| 66 | +- 🔁 Works identically on any machine with Docker |
| 67 | + |
| 68 | +--- |
| 69 | + |
| 70 | +## 🧪 Tested with |
| 71 | + |
| 72 | +- **Docker**: `27.3.1` – `28.2.2` |
| 73 | +- **buildx**: `0.20.0` – `0.25.0` |
| 74 | +- **Compose**: `2.32.1` – `2.37.1` |
| 75 | + |
| 76 | +--- |
| 77 | + |
| 78 | +## 🚀 Getting Started |
| 79 | + |
| 80 | +### 1. Configure environment and Python settings |
33 | 81 |
|
34 | 82 | ```bash |
35 | | -vim pyproject.toml |
| 83 | +cp .env.dist .env |
| 84 | +vim .env # Set OS packages, Python version, Poetry version, etc. |
36 | 85 | ``` |
37 | 86 |
|
38 | | -Build python base image with poetry layer and create a lock file: |
| 87 | +### 2. Set up Python project dependencies |
39 | 88 |
|
40 | 89 | ```bash |
| 90 | +vim pyproject.toml # Edit dependencies, metadata, etc. |
41 | 91 | docker compose build poetry |
42 | | -docker compose run --rm poetry lock --no-cache |
| 92 | +docker compose run --rm poetry lock # Generate poetry.lock |
43 | 93 | git add poetry.lock |
44 | 94 | ``` |
45 | 95 |
|
46 | | -Second, create the image with python dependencies and vim-ide on top of it: |
| 96 | +### 3. Build your Vim IDE image |
47 | 97 |
|
48 | 98 | ```bash |
49 | 99 | cp .vimrc.dist .vimrc |
50 | 100 | cp .coc-settings.json.dist .coc-settings.json |
51 | | -git config --local user.name "John Doe" |
52 | | -git config --local user.email johndoe@example.com |
| 101 | +git config --local user.name "Your Name" |
| 102 | +git config --local user.email you@example.com |
53 | 103 | docker compose build vim-ide |
54 | 104 | ``` |
55 | 105 |
|
56 | | -Launch vim and do some development inside the container: |
| 106 | +### 4. Start developing inside the container |
57 | 107 |
|
58 | 108 | ```bash |
59 | 109 | docker compose run --rm vim-ide |
60 | 110 | ``` |
61 | 111 |
|
62 | | -Don't forget to update the lock file: |
| 112 | +### 5. Update dependencies when needed |
63 | 113 |
|
64 | 114 | ```bash |
65 | | -docker compose run --rm poetry lock --no-cache |
| 115 | +docker compose run --rm poetry lock |
66 | 116 | ``` |
67 | 117 |
|
68 | | -Finally, build and run your application: |
| 118 | +> 🔄 Note: If you've changed dependencies (e.g. updated pyproject.toml or |
| 119 | +> poetry.lock), you must rebuild the Vim IDE image to apply them: |
| 120 | +
|
| 121 | +```bash |
| 122 | +docker compose build vim-ide |
| 123 | +docker compose run --rm vim-ide |
| 124 | +``` |
| 125 | + |
| 126 | +### 6. Build and run your application |
69 | 127 |
|
70 | 128 | ```bash |
71 | 129 | docker compose build app |
72 | 130 | docker compose run --rm app |
73 | 131 | ``` |
74 | 132 |
|
75 | | -If desired, you can run Jupyter on top of the application: |
| 133 | +### 📓 Optional: Run JupyterLab |
76 | 134 |
|
77 | 135 | ```bash |
78 | 136 | docker compose build jupyterlab |
79 | 137 | docker compose run --rm --service-ports jupyterlab |
80 | | -# accsess http://127.0.0.1:8888/lab?token=<.env token> |
| 138 | +# Open: http://127.0.0.1:8888/lab?token=<your .env token> |
81 | 139 | ``` |
82 | 140 |
|
| 141 | +## 🧠 Vim IDE Features |
| 142 | + |
| 143 | +This template comes with a thoughtfully configured Vim environment that |
| 144 | +replicates many features you'd expect from a modern IDE. It’s built for |
| 145 | +productivity and designed to work out of the box — but is fully customizable. |
| 146 | + |
| 147 | +### ✨ Core Capabilities |
| 148 | + |
| 149 | +- ✅ Syntax highlighting & intelligent folding |
| 150 | +- ✅ Autocompletion and LSP features via `coc.nvim` |
| 151 | +- ✅ Linting, formatting, and diagnostics |
| 152 | +- ✅ Git integration and diff signs |
| 153 | +- ✅ Markdown editing with ToC, folding, and preview support |
| 154 | +- ✅ Snippets, code actions, and refactoring shortcuts |
| 155 | +- ✅ Enhanced status line, file tree, and fuzzy finding |
| 156 | +- ✅ Python-focused indentation, folding, and style enforcement |
| 157 | + |
| 158 | +--- |
| 159 | + |
| 160 | +### 🔌Included Plugins |
| 161 | + |
| 162 | +#### 🧠 Code Intelligence |
| 163 | + |
| 164 | +- **[coc.nvim](https://github.com/neoclide/coc.nvim)** – LSP engine with autocompletion, diagnostics, and more |
| 165 | +- **[coc-pyright](https://github.com/fannheyward/coc-pyright)** – Python LSP support |
| 166 | +- **[ultisnips](https://github.com/SirVer/ultisnips)** + **[vim-snippets](https://github.com/honza/vim-snippets)** – Powerful snippet expansion |
| 167 | + |
| 168 | +#### 📁 Navigation & UI |
| 169 | + |
| 170 | +- **[NERDTree](https://github.com/preservim/nerdtree)** – File tree explorer |
| 171 | +- **[fzf.vim](https://github.com/junegunn/fzf.vim)** – Fuzzy file and symbol search |
| 172 | +- **[tagbar](https://github.com/preservim/tagbar)** – Code structure sidebar |
| 173 | +- **[vim-airline](https://github.com/vim-airline/vim-airline)** – Status/tab line enhancement |
| 174 | + |
| 175 | +#### 🔄 Git Integration |
| 176 | + |
| 177 | +- **[vim-fugitive](https://github.com/tpope/vim-fugitive)** – Git commands from within Vim |
| 178 | +- **[vim-gitgutter](https://github.com/airblade/vim-gitgutter)** – Git diff signs in the gutter |
| 179 | + |
| 180 | +#### 📝 Markdown Support |
| 181 | + |
| 182 | +- **[vim-markdown](https://github.com/plasticboy/vim-markdown)** – Markdown editing enhancements |
| 183 | +- **[vim-markdown-toc](https://github.com/mzlogin/vim-markdown-toc)** – Auto-generated table of contents |
| 184 | + |
| 185 | +#### 📊 Data Science & Python Dev |
| 186 | + |
| 187 | +- **[vim-slime](https://github.com/jpalardy/vim-slime)** – Send code to REPL or terminal |
| 188 | +- **[vim-doge](https://github.com/kkoomen/vim-doge)** – Generate docstrings in Google/Numpy style |
| 189 | + |
| 190 | +#### 🎨 Theme & Aesthetics |
| 191 | + |
| 192 | +- **[gruvbox-material](https://github.com/sainnhe/gruvbox-material)** – Color scheme (dark, high-contrast) |
| 193 | +- Airline integrated with Gruvbox |
| 194 | + |
| 195 | +--- |
| 196 | + |
| 197 | +### ⚙️ Python-Specific Tuning |
| 198 | + |
| 199 | +- Smart indentation for Python, with 4-space formatting |
| 200 | +- `textwidth` and `colorcolumn` set to PEP8 defaults |
| 201 | +- Spellcheck enabled for English and Russian |
| 202 | +- LSP-based completion, hover docs, jump-to-definition, code actions |
| 203 | + |
| 204 | +--- |
| 205 | + |
| 206 | +### 🗂 Additional Notes |
| 207 | + |
| 208 | +- To customize the LSP setup, see `.coc-settings.json` |
| 209 | +- To update CoC extensions: `:CocUpdate` |
| 210 | +- Snippets can be edited under `~/.vim/plugged/vim-snippets` |
| 211 | +- Full configuration lives in `.vimrc.dist` — tweak freely |
| 212 | + |
| 213 | +This is a template for python-based projects. Many DS/ML workflows require |
| 214 | +hardware-specific platforms in detailed OS-level libraries and python |
| 215 | +dependencies. In some cases, it is useful to perform code editing in the same |
| 216 | +environment in which applications are run. This template can help vim users to |
| 217 | +run vim-ide with the same project environment on a local or remote machine. |
| 218 | +Please, feel free to massage everything in the template as you wish. |
| 219 | + |
| 220 | +Vim is configured in a modern style and supports almost all ide-specific |
| 221 | +features. Please see `.vimrc.dist` for reference. |
0 commit comments