chore: organized and optimized startup
docs: updated documentation to be simpler and up to date
This commit is contained in:
+10
-96
@@ -1,18 +1,14 @@
|
||||
# 📦 Installation
|
||||
# **Installation**
|
||||
|
||||
Polydev can be installed using any plugin manager of your choice—or even manually. Below are some examples for popular managers to get you started.
|
||||
Polydev can be installed using any plugin manager of your choice — or even manually. Below are some examples for popular managers to get you started.
|
||||
|
||||
> ⚠️ **Disclaimer**: The `opts` and configuration values shown below are simply examples. You can customize them based on your preferences or even omit them entirely if not needed.
|
||||
|
||||
> 💡 **Heads up!** Many language presets in Polydev require a file named `<project_name>.polydev` in your project root. If it's missing, Polydev will let you know (loudly 😅).
|
||||
|
||||
> **Note**: Languages that require to build just need to be run, building is builtin to the run command
|
||||
> **Note: Requires Neovim 0.10+**
|
||||
|
||||
---
|
||||
|
||||
## 🛌 Lazy.nvim
|
||||
|
||||
> This is the **recommended** way if you're using [Lazy.nvim](https://github.com/folke/lazy.nvim):
|
||||
## **Lazy.nvim**
|
||||
|
||||
```lua
|
||||
return {
|
||||
@@ -21,26 +17,13 @@ return {
|
||||
"MunifTanjim/nui.nvim",
|
||||
"nvim-lua/plenary.nvim"
|
||||
},
|
||||
opts = { -- Below are just example values
|
||||
lua = {
|
||||
project_root = "~/Projects/Lua",
|
||||
keybinds = {
|
||||
["<leader>pr"] = "LuaRun",
|
||||
},
|
||||
},
|
||||
terminal = {
|
||||
border = true,
|
||||
number = true,
|
||||
},
|
||||
},
|
||||
opts = {}, -- Setup is later on for configs
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🧸 Mini.deps
|
||||
|
||||
For users of [mini.nvim](https://github.com/echasnovski/mini.nvim)'s dependency manager:
|
||||
## **Mini.deps**
|
||||
|
||||
```lua
|
||||
MiniDeps.add({
|
||||
@@ -51,25 +34,12 @@ MiniDeps.add({
|
||||
}
|
||||
})
|
||||
|
||||
require("Polydev").setup({
|
||||
rust = {
|
||||
project_root = "~/Projects/Rust",
|
||||
keybinds = {
|
||||
["<leader>pr"] = "RustRun",
|
||||
},
|
||||
},
|
||||
terminal = {
|
||||
border = true,
|
||||
number = true,
|
||||
},
|
||||
})
|
||||
require("Polydev").setup({})
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📁 Packer.nvim
|
||||
|
||||
For fans of [Packer.nvim](https://github.com/wbthomason/packer.nvim):
|
||||
## **Packer.nvim**
|
||||
|
||||
```lua
|
||||
use({
|
||||
@@ -78,65 +48,9 @@ use({
|
||||
"MunifTanjim/nui.nvim",
|
||||
"nvim-lua/plenary.nvim"
|
||||
},
|
||||
config = function()
|
||||
require("Polydev").setup({
|
||||
python = {
|
||||
project_root = "~/Projects/Python",
|
||||
keybinds = {
|
||||
["<leader>pb"] = "PythonPip",
|
||||
["<leader>pr"] = "PythonRun",
|
||||
},
|
||||
},
|
||||
terminal = {
|
||||
relativenumber = true,
|
||||
},
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
require("Polydev").setup({})
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🔐 Vim-Plug (Classic)
|
||||
|
||||
Even if you're still using [vim-plug](https://github.com/junegunn/vim-plug), you’re covered:
|
||||
|
||||
```vim
|
||||
Plug 'DarthMooMancer/Polydev'
|
||||
Plug 'MunifTanjim/nui.nvim'
|
||||
Plug 'nvim-lua/plenary.nvim'
|
||||
|
||||
lua << EOF
|
||||
require("Polydev").setup({
|
||||
c = {
|
||||
project_root = "~/Projects/C",
|
||||
keybinds = {
|
||||
["<leader>pr"] = "CRun",
|
||||
},
|
||||
},
|
||||
terminal = {
|
||||
number = true,
|
||||
},
|
||||
})
|
||||
EOF
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🛠 Manual Install
|
||||
|
||||
Clone the repo into your `~/.config/nvim/lua` or any runtime path:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/DarthMooMancer/Polydev ~/.config/nvim/lua/Polydev
|
||||
```
|
||||
|
||||
Then in your config:
|
||||
|
||||
```lua
|
||||
require("Polydev").setup({
|
||||
terminal = {
|
||||
border = true,
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
@@ -1,27 +1,4 @@
|
||||
### Python Setup for Polydev 🐍
|
||||
|
||||
#### Keybinds 🎮
|
||||
You can easily customize the keybinds for your Python projects using Polydev.
|
||||
|
||||
| Keybind | Action |
|
||||
|---------------------|---------------------------------------------------|
|
||||
| `<leader>pr` | Run the Python project in your active terminal |
|
||||
| `<leader>pb` | Install dependencies using pip |
|
||||
|
||||
#### Configuration Example:
|
||||
|
||||
```lua
|
||||
require("Polydev").python.setup({
|
||||
keybinds = {
|
||||
["<leader>pr"] = "PythonRun", -- Run the Python project
|
||||
["<leader>pb"] = "PythonPip" -- Install dependencies using pip
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
#### Python Features 🚀
|
||||
### **Python Features**
|
||||
|
||||
Here are some cool features available for Python projects using Polydev:
|
||||
|
||||
@@ -36,7 +13,7 @@ You no longer need to manually activate or deactivate virtual environments. With
|
||||
|
||||
---
|
||||
|
||||
#### File Structure 📂
|
||||
#### **File Structure**
|
||||
Here’s the recommended structure for your Python projects using Polydev:
|
||||
|
||||
| Directory/File Path | Description |
|
||||
@@ -47,7 +24,7 @@ Here’s the recommended structure for your Python projects using Polydev:
|
||||
| `venv/` | Virtual environment folder |
|
||||
| `main.py` | Main Python file for your project |
|
||||
|
||||
#### Example Structure:
|
||||
#### **Tree Structure**:
|
||||
|
||||
```md
|
||||
Projects/
|
||||
|
||||
+78
-112
@@ -1,12 +1,16 @@
|
||||
# Setup and Customizing Polydev
|
||||
# **Setup**
|
||||
|
||||
## Project Manager
|
||||
> 💡 **Heads up!** Many language presets in Polydev require a file named `<project_name>.polydev` in your project root. If it's missing, Polydev will let you know (loudly 😅).
|
||||
|
||||
> **Note**: Languages that require to build just need to be run, building is builtin to the run command
|
||||
|
||||
## **Project Manager**
|
||||
> Note: The project manager closely follows the netrw keybinds and allows for project management all in one spot
|
||||
|
||||
| Binding | Description |
|
||||
|------------------|-----------------|
|
||||
| **Enter** | `Open file / Enter directory` |
|
||||
| **../** | `Go to parent directory` |
|
||||
| **Delete** | `Go to parent directory` |
|
||||
| **/** | `Filter (fuzzy search)` |
|
||||
| **a** | `Create new folder` |
|
||||
| **%** | `Create new file` |
|
||||
@@ -15,129 +19,91 @@
|
||||
| **D** | `Delete file/folder` |
|
||||
| **q** | `Quit popup` |
|
||||
|
||||
## 🔧 Project Name Customization
|
||||
You can easily customize the default directory for your project! The project can be created from any directory, and Polydev will automatically create the required project root directory for you.
|
||||
> **WARNING**: Do not copy the defaults. Only change what you need for your workflow!
|
||||
|
||||
> **Note:** `project_root` allows you to customize where your project will be stored. If you don't specify it, the default is `~/Projects/Language`.
|
||||
## **Project Root**
|
||||
```lua
|
||||
-- Automatically creates a project root if not already made.
|
||||
-- Stores all projects in this root, not src files and such.
|
||||
-- For now, the top project root is assumed at ~/Projects until I refactor my code.
|
||||
|
||||
---
|
||||
### LazyVim Example
|
||||
-- Lua --
|
||||
project_root = "~/Projects/Lua"
|
||||
|
||||
-- Html --
|
||||
project_root = "~/Projects/Html"
|
||||
|
||||
-- Rust --
|
||||
project_root = "~/Projects/Rust"
|
||||
|
||||
-- Java --
|
||||
project_root = "~/Projects/Java"
|
||||
|
||||
-- Python --
|
||||
project_root = "~/Projects/Python"
|
||||
|
||||
-- C --
|
||||
project_root = "~/Projects/C"
|
||||
|
||||
-- C++ --
|
||||
project_root = "~/Projects/Cpp"
|
||||
```
|
||||
|
||||
## **Keybinds**
|
||||
|
||||
```lua
|
||||
return {
|
||||
...
|
||||
opts = {
|
||||
<language> = {
|
||||
project_root = "~/Home/..." -- Default: ~/Projects/Language
|
||||
}
|
||||
}
|
||||
...
|
||||
-- globals --
|
||||
keybinds = {
|
||||
-- Opens the Project Manager UI
|
||||
["<leader>po"] = "PolydevManager",
|
||||
}
|
||||
```
|
||||
|
||||
### Packer Example
|
||||
|
||||
```lua
|
||||
require("Polydev").language.setup({
|
||||
project_root = "~/Home/..." -- Default: ~/Projects/Language
|
||||
})
|
||||
```
|
||||
|
||||
## ⌨ Keybinds Customization
|
||||
Polydev allows you to easily manage keybinds, providing a uniform way to interact with different languages. Most keybinds are the same across languages, while some have language-specific ones (e.g., Python's pip keybind).
|
||||
|
||||
### Keybind Categories
|
||||
| Keybind Type | Description |
|
||||
|-------------------|--------------------------------------------------|
|
||||
| **Universal** | Cannot be changed through specific language settings (e.g., `<leader>po` for project manager). |
|
||||
| **Per-language** | Can be customized per language (e.g., `<leader>pr` for language run). |
|
||||
|
||||
### LazyVim Example
|
||||
|
||||
```lua
|
||||
return {
|
||||
...
|
||||
opts = {
|
||||
<language> = {
|
||||
["<leader>pr"] = "languageRun", -- Per-language
|
||||
["<leader>nh"] = "NewLanguageSecondaryFile", -- Universal
|
||||
["<leader>po"] = "PolydevManager", -- Universal
|
||||
}
|
||||
}
|
||||
...
|
||||
-- rust --
|
||||
keybinds = {
|
||||
["<leader>pr"] = "RustRun",
|
||||
}
|
||||
```
|
||||
|
||||
### Packer Example
|
||||
|
||||
```lua
|
||||
require("Polydev").language.setup({
|
||||
keybinds = {
|
||||
["<leader>pr"] = "languageRun", -- Per-language
|
||||
["<leader>nh"] = "NewLanguageSecondaryFile", -- Universal
|
||||
["<leader>po"] = "PolydevManager", -- Universal
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🖥 Terminal Customization
|
||||
You can further tweak the terminal settings to suit your preferences! These options allow you to adjust padding, borders, numbers, and scrolling behavior.
|
||||
|
||||
### Available Terminal Settings
|
||||
| Setting | Default Value | Description |
|
||||
|------------------|-----------------|---------------------------------------------------------|
|
||||
| **presets** | `center` | Presets for where the terminal is placed in the buffer |
|
||||
| **border** | `true` | Adds a rounded border to the window. |
|
||||
| **number** | `true` | Displays line numbers in the terminal. |
|
||||
| **relativenumber**| `true` | Displays relative numbers based on cursor position. |
|
||||
| **scroll** | `true` | Enables scroll functionality in the terminal. |
|
||||
|
||||
> **Note:** These terminal settings allow you to personalize the terminal view and improve usability. You can easily adjust the padding, borders, and other aspects to your preference.
|
||||
|
||||
### Available Presets
|
||||
| Preset | Placement |
|
||||
|--------|-----------|
|
||||
| **center** | `completely centerd in the screen with a small amount of padding on each side of the buffer` |
|
||||
| **right_panel** | `takes up about a third of the right side from top to bottom with a small amount of padding` |
|
||||
| **center_panel** | `takes up about a third of the center from top to bottom with a small amount of padding` |
|
||||
| **corner** | `takes up about a fourth of the bottom right corner with a small amount of padding` |
|
||||
|
||||
---
|
||||
### LazyVim Example
|
||||
|
||||
```lua
|
||||
return {
|
||||
...
|
||||
opts = {
|
||||
terminal = {
|
||||
presets = "center"
|
||||
border = true,
|
||||
number = true,
|
||||
relativenumber = true,
|
||||
scroll = true,
|
||||
}
|
||||
}
|
||||
...
|
||||
-- java --
|
||||
keybinds = {
|
||||
["<leader>pr"] = "JavaRun",
|
||||
}
|
||||
|
||||
-- python --
|
||||
keybinds = {
|
||||
["<leader>pr"] = "PythonRun",
|
||||
["<leader>pb"] = "PythonPip",
|
||||
}
|
||||
|
||||
-- lua --
|
||||
keybinds = {
|
||||
["<leader>pr"] = "LuaRun",
|
||||
}
|
||||
|
||||
-- c --
|
||||
keybinds = {
|
||||
["<leader>pr"] = "CRun",
|
||||
["<leader>nh"] = "NewCHeaderFile",
|
||||
}
|
||||
|
||||
-- cpp --
|
||||
keybinds = {
|
||||
["<leader>pr"] = "CppRun",
|
||||
["<leader>nh"] = "NewCppHeaderFile",
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
### Packer Example
|
||||
|
||||
## **Terminal Configuration**
|
||||
```lua
|
||||
require("Polydev").setup({
|
||||
terminal = {
|
||||
presets = "center"
|
||||
border = true,
|
||||
number = true,
|
||||
relativenumber = true,
|
||||
scroll = true,
|
||||
}
|
||||
})
|
||||
terminal = {
|
||||
presets = "centered", -- "centered", "center_panel", "right_panel", "cornered"
|
||||
border = true,
|
||||
number = true,
|
||||
relativenumber = true -- requires number to be true
|
||||
}
|
||||
```
|
||||
|
||||
## 🚀 Final Thoughts and Customizations
|
||||
This guide provided you with the basic configuration steps for setting up Polydev with your preferred package manager and customizing key aspects like project names, keybinds, and terminal settings.
|
||||
|
||||
You can further explore other Polydev features and modify the configuration to suit your development workflow.
|
||||
You can further explore other Polydev features and modify the configuration to suit your development workflow with language specific configs.
|
||||
|
||||
Reference in New Issue
Block a user