Skip to content

Krystof2so/pyflowenv-nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐍 pyflowenv-nvim

pyflowenv-nvim is a Neovim plugin written in Lua, designed to quickly generate the minimal structure for a Python project: an isolated virtual environment, a .gitignore file, the src/, assets/, and tests/ directories — all from an interactive interface inside Neovim.

demo

This plugin is ideal for Python developers who want to quickly initialize a project inside Neovim, without leaving the editor (usable from alpha or via a built-in Neovim command).


✨ Features

  • 📁 Creates a project directory and recommended architecture (Command :PyflowCreate)
  • 📂 Interactive selection of the destination directory with Telescope
  • 🐍 Automatically sets up a virtual environment with python3 -m venv and initializes a Git repository
  • 🧾 Generates .gitignore (adapted for Python projects), main.py, and README.md files
  • 💬 Interactive interface in a Neovim popup window
  • 🗂️ Existing project management interface (created or addedi - Command :PyflowManage)
    • 📋 List of saved projects (sorted by last modification date)
    • 🕓 Display of last modification date in relative format (2 hours ago, yesterday, 1 month ago...)
    • 🔍 Open a project with NvimTree (o)
    • ❌ Delete a project (d)
    • ➕ Add an existing project via Telescope (a)
  • 🏳️‍🌍 Multilingual support (fr, es, en)
  • ⚙️ Custom configuration: venv folder name, language...

🔗 Requirements

sudo apt-get install fd-find

📦 Installation (with lazy.nvim)

Add the plugin to your Lazy plugin list, along with Telescope if it is not already installed:

{  -- nvim-telescope : search in lists
    "nvim-telescope/telescope.nvim",
    dependencies = {
        "nvim-lua/plenary.nvim",
        "nvim-telescope/telescope-file-browser.nvim",
    },
    config = function()
        require("telescope").setup({
            extensions = {
                file_browser = {
                    theme = "dropdown",
                    hijack_netrw = true,
                },
            },
        })
        require("telescope").load_extension("file_browser")
    end,
},   

{
  "Krystof2so/pyflowenv-nvim",
  config = function()
    require("pyflowenv").setup({
      -- language : "fr" (by défault), "en", "es"
      lang = "fr",
      -- repertory venv : by défault ".venv"
      venv_dir = ".venv"
    })
  end
}

⚙️ Configuration

require("pyflowenv").setup({
  venv_dir = ".venv", -- virtual environment folder (default)
  lang = "en",        -- language : "fr", "en", "es"
  highlights = flt-- Color customization
    FloatBorder = { fg = "#88c0d0" },   -- Floating window border
    FloatTitle  = { fg = "#f2cc81", bold = true }, -- Windows title
    ProjectName = { fg = "#b8cc8c", bold = true }, -- Project names
  },
})

📘 Help

After installation, you can access plugin documentation with:

:help pyflowenv

📂 Generated Structure

my_project/
├── .gitignore
├── .git/
├── .venv/
├── assets/
├── README.md
├── src/
│   └── my_project/
│       └── main.py
└── tests/
  • .venv/: Python virtual environment (not activated automatically)
  • .gitignore: contains standard rules to ignore .venv, __pycache__/, .log files, etc.
  • main.py: contains minimal starter code.
  • README.md: contains # my_project

🌍 Available Languages

Messages displayed in popup windows can be dynamically translated.
Currently supported languages:

  • 🇫🇷 French (fr)
  • 🇪🇸 Spanish (es)
  • 🇬🇧 English (en)

The choice is made via the option lang = "en" in setup().


🔭 Roadmap (Coming Soon)

  • 🧪 Detection and integration with poetry or pyenv
  • 🔧 Advanced configuration (customizable templates)

👨‍💻 Author

Developed by Krystof26, a simple enthusiast of Python and Lua languages. I appreciate simple, efficient tools well integrated with Neovim.

About

Plugin Neovim for starting Python projects

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages