Better config on plugins, add lazygit & update readme #7
9 changed files with 132 additions and 66 deletions
135
README.md
135
README.md
|
|
@ -4,6 +4,61 @@
|
||||||
|
|
||||||
A pre-configured, performance-oriented Neovim setup designed to get you from zero to coding in minutes. Built for local developers who want a powerful IDE experience without the manual overhead of a 500-line `init.lua`.
|
A pre-configured, performance-oriented Neovim setup designed to get you from zero to coding in minutes. Built for local developers who want a powerful IDE experience without the manual overhead of a 500-line `init.lua`.
|
||||||
|
|
||||||
|
## Get Started
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
To ensure all plugins (LSP, Tree-sitter, and Telescope) function correctly, please install the following:
|
||||||
|
|
||||||
|
* **Neovim** (v0.10+ recommended)
|
||||||
|
* **Git** (For cloning the repo and managing plugins)
|
||||||
|
* **Tree-sitter-cli** (For syntax highlighting)
|
||||||
|
* **Ripgrep** (Required for Telescope live grep)
|
||||||
|
* **Yazi** (Required for file expolorer)
|
||||||
|
* **Node & NPM** (Required for various LSP servers like `html` and `eslint`)
|
||||||
|
* **Go** (Required for certain internal tools)
|
||||||
|
|
||||||
|
For the best results, we recommend you install and use the Ghostty terminal with the following configuration:
|
||||||
|
|
||||||
|
```Ini, TOML
|
||||||
|
theme = Adwaita Dark
|
||||||
|
font-size = 18
|
||||||
|
background-opacity = 0.85
|
||||||
|
background-blur-radius = 20
|
||||||
|
```
|
||||||
|
|
||||||
|
### Installation
|
||||||
|
|
||||||
|
#### 1. Prepare Configuration Directory
|
||||||
|
Depending on whether you have an existing setup, follow the appropriate step below:
|
||||||
|
|
||||||
|
**For a Fresh Install:**
|
||||||
|
If you have never configured Neovim, create the configuration folder:
|
||||||
|
```bash
|
||||||
|
mkdir ~/.config/nvim
|
||||||
|
```
|
||||||
|
|
||||||
|
**For an Existing Setup:**
|
||||||
|
If you have configured Neovim already, create a backup folder:
|
||||||
|
```bash
|
||||||
|
mv ~/.config/nvim ~/.config/nvim.bak
|
||||||
|
mkdir ~/.config/nvim
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 2. Clone the Repository
|
||||||
|
Clone the Mzansi Vim configuration into your config folder:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd ~/.config/nvim
|
||||||
|
git clone https://git.mzansi-innovation-hub.co.za/yaso_meth/mzansi_vim.git .
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 3. Initialize
|
||||||
|
Simply launch Neovim:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nvim
|
||||||
|
```
|
||||||
|
|
||||||
## Key Features
|
## Key Features
|
||||||
|
|
||||||
* **LSP & Auto-completion:** Powered by `mason.nvim` and `nvim-cmp`, featuring out-of-the-box support for Python, Lua, Docker, SQL, and more.
|
* **LSP & Auto-completion:** Powered by `mason.nvim` and `nvim-cmp`, featuring out-of-the-box support for Python, Lua, Docker, SQL, and more.
|
||||||
|
|
@ -116,6 +171,12 @@ The **Leader Key** is set to `Space`.
|
||||||
| **List Devices** | `:FDevices` | Show a list of available physical/virtual devices. |
|
| **List Devices** | `:FDevices` | Show a list of available physical/virtual devices. |
|
||||||
| **Toggle Logs** | `:FLogs` | Open or close the Flutter Dev Log split. |
|
| **Toggle Logs** | `:FLogs` | Open or close the Flutter Dev Log split. |
|
||||||
| **Clear Logs** | `:FLogsClear` | Clear the current Flutter Dev Log buffer. |
|
| **Clear Logs** | `:FLogsClear` | Clear the current Flutter Dev Log buffer. |
|
||||||
|
| **Clean Project** | `:FClean` | Execute flutter clean in split terminal. |
|
||||||
|
| **Pub Get** | `:FPubGet` | Fetches project dependencies. |
|
||||||
|
| **Start DevTools** | `:FDevToolsStart` | Start the local Flutter DevTools server |
|
||||||
|
| **Open DevTools** | `:FDevToolsOpen` | Open Flutter DevTools in your default browser. |
|
||||||
|
| **Build Runner** | `:FBuild` | Execute dart run build_runner build in split terminal. |
|
||||||
|
| **Watch Runner** | `:FWatch` | Execute dart run build_runner watch in split terminal. |
|
||||||
|
|
||||||
### Copilot Code Completion
|
### Copilot Code Completion
|
||||||
| Action | Keybinding | Description |
|
| Action | Keybinding | Description |
|
||||||
|
|
@ -161,60 +222,42 @@ The **Leader Key** is set to `Space`.
|
||||||
| **Confirm Completion**| `Enter` | Accept the current suggestion in the popup menu. |
|
| **Confirm Completion**| `Enter` | Accept the current suggestion in the popup menu. |
|
||||||
| **Scroll Docs** | `Ctrl + f / b` | Scroll up/down in the LSP documentation window. |
|
| **Scroll Docs** | `Ctrl + f / b` | Scroll up/down in the LSP documentation window. |
|
||||||
|
|
||||||
## Get Started
|
### Lazygit Navigation & Commands
|
||||||
|
|
||||||
### Prerequisites
|
| Action | Keybinding | Description |
|
||||||
To ensure all plugins (LSP, Tree-sitter, and Telescope) function correctly, please install the following:
|
| :--- | :--- | :--- |
|
||||||
|
| **Switch Panels** | `H` / `L` or `←` / `→` | Move between the left side panels (Status, Files, Branches, Commits, Stash). |
|
||||||
|
| **Navigate List** | `J` / `K` or `↑` / `↓` | Move up and down within a panel's list. |
|
||||||
|
| **Quit** | `q` | Close lazygit. |
|
||||||
|
| **Help Menu** | `?` | Open the contextual keybindings help menu. |
|
||||||
|
|
||||||
* **Neovim** (v0.10+ recommended)
|
### Lazygit Files Panel
|
||||||
* **Git** (For cloning the repo and managing plugins)
|
|
||||||
* **Tree-sitter-cli** (For syntax highlighting)
|
|
||||||
* **Ripgrep** (Required for Telescope live grep)
|
|
||||||
* **Yazi** (Required for file expolorer)
|
|
||||||
* **Node & NPM** (Required for various LSP servers like `html` and `eslint`)
|
|
||||||
* **Go** (Required for certain internal tools)
|
|
||||||
|
|
||||||
For the best results, we recommend you install and use the Ghostty terminal with the following configuration:
|
| Action | Keybinding | Description |
|
||||||
|
| :--- | :--- | :--- |
|
||||||
|
| **Stage / Unstage File** | `Space` | Toggle staging for the highlighted file. |
|
||||||
|
| **Stage All** | `a` | Stage or unstage all changes in the working directory. |
|
||||||
|
| **Commit Changes** | `c` | Open the commit message prompt. |
|
||||||
|
| **Discard Changes** | `d` | Open options to discard local changes to the file. |
|
||||||
|
| **Ignore File** | `i` | Add the highlighted file to `.gitignore`. |
|
||||||
|
| **Stash Changes** | `s` | Stash current changes. |
|
||||||
|
|
||||||
```Ini, TOML
|
### Lazygit Branches Panel
|
||||||
theme = Adwaita Dark
|
|
||||||
font-size = 18
|
|
||||||
background-opacity = 0.85
|
|
||||||
background-blur-radius = 20
|
|
||||||
```
|
|
||||||
|
|
||||||
### Installation
|
| Action | Keybinding | Description |
|
||||||
|
| :--- | :--- | :--- |
|
||||||
|
| **Checkout Branch** | `Space` | Switch to the highlighted branch. |
|
||||||
|
| **New Branch** | `n` | Create a new branch off the currently selected one. |
|
||||||
|
| **Delete Branch** | `d` | Delete the highlighted branch. |
|
||||||
|
|
||||||
#### 1. Prepare Configuration Directory
|
### Lazygit Remotes, Push & Pull
|
||||||
Depending on whether you have an existing setup, follow the appropriate step below:
|
|
||||||
|
|
||||||
**For a Fresh Install:**
|
| Action | Keybinding | Description |
|
||||||
If you have never configured Neovim, create the configuration folder:
|
| :--- | :--- | :--- |
|
||||||
```bash
|
| **Pull** | `p` | Fetch and pull changes from the remote branch. |
|
||||||
mkdir ~/.config/nvim
|
| **Push** | `P` | Push current commits to the remote branch. |
|
||||||
```
|
| **Force Push** | `F` | Safe force push (`--force-with-lease`). |
|
||||||
|
|
||||||
**For an Existing Setup:**
|
|
||||||
If you have configured Neovim already, create a backup folder:
|
|
||||||
```bash
|
|
||||||
mv ~/.config/nvim ~/.config/nvim.bak
|
|
||||||
mkdir ~/.config/nvim
|
|
||||||
```
|
|
||||||
|
|
||||||
#### 2. Clone the Repository
|
|
||||||
Clone the Mzansi Vim configuration into your config folder:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cd ~/.config/nvim
|
|
||||||
git clone https://git.mzansi-innovation-hub.co.za/yaso_meth/mzansi_vim.git .
|
|
||||||
```
|
|
||||||
|
|
||||||
#### 3. Initialize
|
|
||||||
Simply launch Neovim:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
nvim
|
|
||||||
```
|
|
||||||
|
|
||||||
## Additional information
|
## Additional information
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||||
"LuaSnip": { "branch": "master", "commit": "0abc8f390b278c3b4aabc4c004ac8a088b65cf24" },
|
"LuaSnip": { "branch": "master", "commit": "0abc8f390b278c3b4aabc4c004ac8a088b65cf24" },
|
||||||
"ansi.nvim": { "branch": "main", "commit": "95de464c315ecbe9d7ca3d9a203ef85def0cf6aa" },
|
"ansi.nvim": { "branch": "main", "commit": "195b64c3da1c22c2e95648dcbdc6ed075d507064" },
|
||||||
"bigfile.nvim": { "branch": "main", "commit": "33eb067e3d7029ac77e081cfe7c45361887a311a" },
|
"bigfile.nvim": { "branch": "main", "commit": "33eb067e3d7029ac77e081cfe7c45361887a311a" },
|
||||||
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
||||||
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
|
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
|
||||||
|
|
@ -13,23 +13,23 @@
|
||||||
"flutter-tools.nvim": { "branch": "main", "commit": "7d1acfd139215e02d2784733af69a61aaebe06e8" },
|
"flutter-tools.nvim": { "branch": "main", "commit": "7d1acfd139215e02d2784733af69a61aaebe06e8" },
|
||||||
"harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" },
|
"harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||||
|
"lazygit.nvim": { "branch": "main", "commit": "a04ad0dbc725134edbee3a5eea29290976695357" },
|
||||||
"log-highlight.nvim": { "branch": "main", "commit": "b2e00cfd41ca94338265a595f3f3f423d9f9322e" },
|
"log-highlight.nvim": { "branch": "main", "commit": "b2e00cfd41ca94338265a595f3f3f423d9f9322e" },
|
||||||
"lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" },
|
"lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "21c5b3ebeaa0412e28096bb0701434c51c1fbf76" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "47059d71b42d74b0a1e9f61c1d99d301039c3b5b" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" },
|
"mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" },
|
||||||
"mini.ai": { "branch": "main", "commit": "d73c36349aa7b0bab5f77ad71701a1d42211a1df" },
|
"mini.ai": { "branch": "main", "commit": "d73c36349aa7b0bab5f77ad71701a1d42211a1df" },
|
||||||
"noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" },
|
"noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" },
|
||||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||||
"nvim-autopairs": { "branch": "master", "commit": "7b9923abad60b903ece7c52940e1321d39eccc79" },
|
"nvim-autopairs": { "branch": "master", "commit": "7b9923abad60b903ece7c52940e1321d39eccc79" },
|
||||||
"nvim-cmp": { "branch": "main", "commit": "a1d504892f2bc56c2e79b65c6faded2fd21f3eca" },
|
"nvim-cmp": { "branch": "main", "commit": "a1d504892f2bc56c2e79b65c6faded2fd21f3eca" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "bfcc0171a43f22afa61d927ffe9fcb6cb85dc99e" },
|
"nvim-lspconfig": { "branch": "master", "commit": "292f44408498103c47996ff5c18fd366293840d8" },
|
||||||
"nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" },
|
"nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" },
|
||||||
"nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" },
|
"nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "dfbfaa967a6f7ec50789bead7ef87e336c1fa63c" },
|
"nvim-web-devicons": { "branch": "master", "commit": "dad71387de386a946b123079d0e53f23028f3abd" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
|
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
|
||||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "b25b749b9db64d375d782094e2b9dce53ad53a40" },
|
"telescope-fzf-native.nvim": { "branch": "main", "commit": "b25b749b9db64d375d782094e2b9dce53ad53a40" },
|
||||||
"telescope.nvim": { "branch": "master", "commit": "5255aa27c422de944791318024167ad5d40aad20" },
|
"telescope.nvim": { "branch": "master", "commit": "5255aa27c422de944791318024167ad5d40aad20" },
|
||||||
"tokyonight.nvim": { "branch": "main", "commit": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6" },
|
"tokyonight.nvim": { "branch": "main", "commit": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6" },
|
||||||
"vim-fugitive": { "branch": "master", "commit": "3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0" },
|
"yazi.nvim": { "branch": "main", "commit": "2314e0eb074996acc30183e3e9dfbfefd82f24aa" }
|
||||||
"yazi.nvim": { "branch": "main", "commit": "4b167eeafcf84cc78a9d9cd4b1f945533e0cc5b9" }
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,4 @@
|
||||||
return {
|
return {
|
||||||
{
|
|
||||||
-- Git Plugin
|
|
||||||
'tpope/vim-fugitive',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"numToStr/Comment.nvim",
|
|
||||||
config = function()
|
|
||||||
require("Comment").setup()
|
|
||||||
vim.keymap.set("n", "<C-/>", "gcc", { remap = true, desc = "Toggle comment" })
|
|
||||||
vim.keymap.set("v", "<C-/>", "gc", { remap = true, desc = "Toggle comment" })
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
'windwp/nvim-autopairs',
|
'windwp/nvim-autopairs',
|
||||||
event = "InsertEnter",
|
event = "InsertEnter",
|
||||||
|
|
@ -4,7 +4,7 @@ return {
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
opts = {
|
opts = {
|
||||||
-- Fallback size if the function doesn't intercept it
|
-- Fallback size if the function doesn't intercept it
|
||||||
filesize = 2,
|
filesize = 1,
|
||||||
-- Use a detection function to unconditionally catch generated files
|
-- Use a detection function to unconditionally catch generated files
|
||||||
pattern = function(bufnr, _)
|
pattern = function(bufnr, _)
|
||||||
local buf_name = vim.api.nvim_buf_get_name(bufnr)
|
local buf_name = vim.api.nvim_buf_get_name(bufnr)
|
||||||
|
|
|
||||||
10
lua/plugins/comments.lua
Normal file
10
lua/plugins/comments.lua
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"numToStr/Comment.nvim",
|
||||||
|
config = function()
|
||||||
|
require("Comment").setup()
|
||||||
|
vim.keymap.set("n", "<C-/>", "gcc", { remap = true, desc = "Toggle comment" })
|
||||||
|
vim.keymap.set("v", "<C-/>", "gc", { remap = true, desc = "Toggle comment" })
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -39,6 +39,7 @@ return {
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
{ icon = " ", desc = " Harpoon Search ", key = "fl", action = "Telescope harpoon marks" },
|
{ icon = " ", desc = " Harpoon Search ", key = "fl", action = "Telescope harpoon marks" },
|
||||||
|
{ icon = " ", desc = " Lazy Git ", key = "lg", action = "LazyGit" },
|
||||||
{ icon = " ", desc = " Lazy Manager ", key = "z", action = "Lazy" },
|
{ icon = " ", desc = " Lazy Manager ", key = "z", action = "Lazy" },
|
||||||
{ icon = " ", desc = " Help Tags ", key = "fh", action = "Telescope help_tags" },
|
{ icon = " ", desc = " Help Tags ", key = "fh", action = "Telescope help_tags" },
|
||||||
{ icon = " ", desc = " Quit ", key = "q", action = "qa" },
|
{ icon = " ", desc = " Quit ", key = "q", action = "qa" },
|
||||||
|
|
|
||||||
|
|
@ -92,8 +92,12 @@ return {
|
||||||
user_command("FEmulators", "FlutterEmulators", {})
|
user_command("FEmulators", "FlutterEmulators", {})
|
||||||
user_command("FLogs", "FlutterLogToggle", {})
|
user_command("FLogs", "FlutterLogToggle", {})
|
||||||
user_command("FLogsClear", "FlutterLogClear", {})
|
user_command("FLogsClear", "FlutterLogClear", {})
|
||||||
|
user_command("FPubGet", "FlutterPubGet", {})
|
||||||
|
user_command("FDevToolsStart", "FlutterDevTools", {})
|
||||||
|
user_command("FDevToolsOpen", "FlutterOpenDevTools", {})
|
||||||
user_command("FBuild", "split | term dart run build_runner build", {})
|
user_command("FBuild", "split | term dart run build_runner build", {})
|
||||||
user_command("FWatch", "split | term dart run build_runner watch", {})
|
user_command("FWatch", "split | term dart run build_runner watch", {})
|
||||||
|
user_command("FClean", "split | term flutter clean", {})
|
||||||
-- Target-specific Run Command
|
-- Target-specific Run Command
|
||||||
user_command("FRunT", function(opts)
|
user_command("FRunT", function(opts)
|
||||||
vim.cmd("FlutterRun --web-port 1995 --target=" .. opts.args)
|
vim.cmd("FlutterRun --web-port 1995 --target=" .. opts.args)
|
||||||
|
|
|
||||||
20
lua/plugins/lazygit.lua
Normal file
20
lua/plugins/lazygit.lua
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
return {
|
||||||
|
"kdheepak/lazygit.nvim",
|
||||||
|
lazy = true,
|
||||||
|
cmd = {
|
||||||
|
"LazyGit",
|
||||||
|
"LazyGitConfig",
|
||||||
|
"LazyGitCurrentFile",
|
||||||
|
"LazyGitFilter",
|
||||||
|
"LazyGitFilterCurrentFile",
|
||||||
|
},
|
||||||
|
-- optional for floating window border decoration
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
},
|
||||||
|
-- setting the keybinding for LazyGit with 'keys' is recommended in
|
||||||
|
-- order to load the plugin when the command is run for the first time
|
||||||
|
keys = {
|
||||||
|
{ "<leader>lg", "<cmd>LazyGit<cr>", desc = "LazyGit" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -129,7 +129,7 @@ return {
|
||||||
{ name = "luasnip", keyword_length = 2 },
|
{ name = "luasnip", keyword_length = 2 },
|
||||||
{
|
{
|
||||||
name = "buffer",
|
name = "buffer",
|
||||||
keyword_length = 3,
|
keyword_length = 2,
|
||||||
-- Limit indexing to only the active visible buffer to stop lag on Enter
|
-- Limit indexing to only the active visible buffer to stop lag on Enter
|
||||||
option = {
|
option = {
|
||||||
get_bufnrs = function()
|
get_bufnrs = function()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue