Compare commits
26 Commits
66bc01d9b6
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 1e761356fe | |||
| c777ce8d74 | |||
| 3eb2ce870d | |||
| 286c9c8953 | |||
| ccf1054eee | |||
| 5e8c8e7af2 | |||
| d43365ca73 | |||
| ed557e6819 | |||
| 627027dd8a | |||
| 85c5782bc3 | |||
| f03d942a91 | |||
| af683e7c4e | |||
| 69bcb280b3 | |||
| 9c64b69498 | |||
| 7cd84ab8d3 | |||
| ccca420391 | |||
| b506c69df8 | |||
| 056e677599 | |||
| 5f0eabf629 | |||
| 3adc822ccf | |||
| a7a6e907ec | |||
| 9b20b6703e | |||
| fe6230225e | |||
| 7a4be838d4 | |||
| fc34e7ffb9 | |||
| 5c4f564ad7 |
54
README.md
54
README.md
@@ -1,6 +1,6 @@
|
|||||||
# Mzansi Vim: The No-Fuss Neovim Kickstart 🇿🇦
|
# Mzansi Vim: The No-Fuss Neovim Kickstart 🇿🇦
|
||||||
|
|
||||||
<img src='assets/demo.png' height='300' alt='MzansiVim Dashboard'>
|
<img src='assets/MzansiVim.png' height='300' alt='MzansiVim Dashboard'>
|
||||||
|
|
||||||
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`.
|
||||||
|
|
||||||
@@ -18,19 +18,7 @@ A pre-configured, performance-oriented Neovim setup designed to get you from zer
|
|||||||
|
|
||||||
The **Leader Key** is set to `Space`.
|
The **Leader Key** is set to `Space`.
|
||||||
|
|
||||||
**Note:** Dashboard keybindings are active only on the startup screen and do not require the leader key prefix.
|
**Note:** Dashboard keybindings are active only on the dashboard screen and do not require the leader key prefix.
|
||||||
|
|
||||||
### Dashboard
|
|
||||||
| Action | Keybinding | Description |
|
|
||||||
| :--- | :--- | :--- |
|
|
||||||
| **File Explorer** | `cd` | Open Netrw directly from the dashboard. |
|
|
||||||
| **Find Files** | `ff` | Fuzzy find files via Telescope. |
|
|
||||||
| **Live Grep** | `fg` | Search across all files via Telescope. |
|
|
||||||
| **Harpoon Menu** | `e` | Open the Harpoon quick menu. |
|
|
||||||
| **Harpoon Search** | `fl` | Search Harpoon marks via Telescope. |
|
|
||||||
| **Lazy Manager** | `z` | Open the Lazy plugin manager. |
|
|
||||||
| **Help Tags** | `fh` | Search Neovim help tags via Telescope. |
|
|
||||||
| **Quit** | `q` | Quit Neovim. |
|
|
||||||
|
|
||||||
### Dashboard
|
### Dashboard
|
||||||
| Action | Keybinding | Description |
|
| Action | Keybinding | Description |
|
||||||
@@ -48,6 +36,7 @@ The **Leader Key** is set to `Space`.
|
|||||||
### Navigation & Searching
|
### Navigation & Searching
|
||||||
| Action | Keybinding | Description |
|
| Action | Keybinding | Description |
|
||||||
| :--- | :--- | :--- |
|
| :--- | :--- | :--- |
|
||||||
|
| **Dashboard** | `<leader>;` | Open the MzansiVim Dasboard. |
|
||||||
| **File Explorer** | `<leader>cd` | Open the built-in Netrw explorer. |
|
| **File Explorer** | `<leader>cd` | Open the built-in Netrw explorer. |
|
||||||
| **Find Files** | `<leader>ff` | Fuzzy find files in your project. |
|
| **Find Files** | `<leader>ff` | Fuzzy find files in your project. |
|
||||||
| **Live Grep** | `<leader>fg` | Search for specific text across all files. |
|
| **Live Grep** | `<leader>fg` | Search for specific text across all files. |
|
||||||
@@ -66,9 +55,33 @@ The **Leader Key** is set to `Space`.
|
|||||||
| :--- | :--- | :--- |
|
| :--- | :--- | :--- |
|
||||||
| **Hover Docs** | `K` | Display documentation for the symbol under cursor. |
|
| **Hover Docs** | `K` | Display documentation for the symbol under cursor. |
|
||||||
| **Go to Definition**| `gd` | Jump to the source code of a function/variable. |
|
| **Go to Definition**| `gd` | Jump to the source code of a function/variable. |
|
||||||
|
| **Code Actions** | `<leader>ca` | Show available fixes or refactors. |
|
||||||
|
| **Align File** | `<leader>af` | Auto align file. |
|
||||||
| **References** | `gr` | List all places where a symbol is used. |
|
| **References** | `gr` | List all places where a symbol is used. |
|
||||||
| **Rename** | `<leader>rn` | Rename all occurrences of the symbol. |
|
| **Rename** | `<leader>rn` | Rename all occurrences of the symbol. |
|
||||||
| **Code Actions** | `<leader>ca` | Show available fixes or refactors. |
|
|
||||||
|
### Diagnostics (Errors & Warnings)
|
||||||
|
| Action | Keybinding | Description |
|
||||||
|
| :--- | :--- | :--- |
|
||||||
|
| **Show Error** | `<leader>e` | Open a floating window with the full error under cursor. |
|
||||||
|
| **Next Error** | `]d` | Jump to the next diagnostic in the file. |
|
||||||
|
| **Previous Error** | `[d` | Jump to the previous diagnostic in the file. |
|
||||||
|
| **Error List** | `<leader>el` | Load all diagnostics into the quickfix list. |
|
||||||
|
| **Close Quickfix** | `:q <Enter>` | Close the quickfix window while active. |
|
||||||
|
|
||||||
|
### Window Management
|
||||||
|
| Action | Keybinding | Description |
|
||||||
|
| :--- | :--- | :--- |
|
||||||
|
| **Cycle Windows** | `Ctrl + w + w` | Cycle focus between open windows (e.g. quickfix ↔ code). |
|
||||||
|
| **Move Down** | `Ctrl + w + j` | Move focus to the window below. |
|
||||||
|
| **Move Up** | `Ctrl + w + k` | Move focus to the window above. |
|
||||||
|
| **Jump & Stay** | `Ctrl + w + Enter` | Open quickfix entry in a split, keeping quickfix focused. |
|
||||||
|
|
||||||
|
### Commenting
|
||||||
|
| Action | Keybinding | Description |
|
||||||
|
| :--- | :--- | :--- |
|
||||||
|
| **Toggle Comment** | `Ctrl + /` | Comment or uncomment the current line (normal mode). |
|
||||||
|
| **Toggle Comment** | `Ctrl + /` | Comment or uncomment the selection (visual mode). |
|
||||||
|
|
||||||
### Editor Essentials
|
### Editor Essentials
|
||||||
| Action | Keybinding | Description |
|
| Action | Keybinding | Description |
|
||||||
@@ -83,9 +96,9 @@ To ensure all plugins (LSP, Tree-sitter, and Telescope) function correctly, plea
|
|||||||
|
|
||||||
* **Neovim** (v0.10+ recommended)
|
* **Neovim** (v0.10+ recommended)
|
||||||
* **Git** (For cloning the repo and managing plugins)
|
* **Git** (For cloning the repo and managing plugins)
|
||||||
* **Tree-sitter & Tree-sitter-cli** (For syntax highlighting)
|
* **Tree-sitter-cli** (For syntax highlighting)
|
||||||
* **Ripgrep** (Required for Telescope live grep)
|
* **Ripgrep** (Required for Telescope live grep)
|
||||||
* **Node.js & npm** (Required for various LSP servers like `html` and `eslint`)
|
* **Node & NPM** (Required for various LSP servers like `html` and `eslint`)
|
||||||
* **Go** (Required for certain internal tools)
|
* **Go** (Required for certain internal tools)
|
||||||
|
|
||||||
For the best results, we recommend you install and use the Ghostty terminal with the following configuration:
|
For the best results, we recommend you install and use the Ghostty terminal with the following configuration:
|
||||||
@@ -105,13 +118,14 @@ Depending on whether you have an existing setup, follow the appropriate step bel
|
|||||||
**For a Fresh Install:**
|
**For a Fresh Install:**
|
||||||
If you have never configured Neovim, create the configuration folder:
|
If you have never configured Neovim, create the configuration folder:
|
||||||
```bash
|
```bash
|
||||||
mkdir -p ~/.config/nvim
|
mkdir ~/.config/nvim
|
||||||
```
|
```
|
||||||
|
|
||||||
**For an Existing Setup:**
|
**For an Existing Setup:**
|
||||||
If you have never configured Neovim, create the configuration folder:
|
If you have configured Neovim already, create a backup folder:
|
||||||
```bash
|
```bash
|
||||||
mv ~/.config/nvim ~/.config/nvim.bak
|
mv ~/.config/nvim ~/.config/nvim.bak
|
||||||
|
mkdir ~/.config/nvim
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 2. Clone the Repository
|
#### 2. Clone the Repository
|
||||||
@@ -119,7 +133,7 @@ Clone the Mzansi Vim configuration into your config folder:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd ~/.config/nvim
|
cd ~/.config/nvim
|
||||||
git clone https://git.mzansi-innovation-hub.co.za/yaso_meth/mzansi_vim.git
|
git clone https://git.mzansi-innovation-hub.co.za/yaso_meth/mzansi_vim.git .
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 3. Initialize
|
#### 3. Initialize
|
||||||
|
|||||||
BIN
assets/.DS_Store
vendored
Normal file
BIN
assets/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
assets/MzansiVim.png
Normal file
BIN
assets/MzansiVim.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 786 KiB |
BIN
assets/demo.png
BIN
assets/demo.png
Binary file not shown.
|
Before Width: | Height: | Size: 682 KiB |
@@ -1,22 +1,25 @@
|
|||||||
{
|
{
|
||||||
|
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||||
"LuaSnip": { "branch": "master", "commit": "dae4f5aaa3574bd0c2b9dd20fb9542a02c10471c" },
|
"LuaSnip": { "branch": "master", "commit": "dae4f5aaa3574bd0c2b9dd20fb9542a02c10471c" },
|
||||||
"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" },
|
||||||
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
|
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
|
||||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||||
|
"dashboard-nvim": { "branch": "master", "commit": "0775e567b6c0be96d01a61795f7b64c1758262f6" },
|
||||||
"dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
|
"dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
|
||||||
"flutter-tools.nvim": { "branch": "main", "commit": "677cc07c16e8b89999108d2ebeefcfc5f539b73c" },
|
"flutter-tools.nvim": { "branch": "main", "commit": "677cc07c16e8b89999108d2ebeefcfc5f539b73c" },
|
||||||
"harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" },
|
"harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||||
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
|
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "a676ab7282da8d651e175118bcf54483ca11e46d" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "a979821a975897b88493843301950c456a725982" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" },
|
"mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" },
|
||||||
|
"mini.ai": { "branch": "main", "commit": "bfb26d9072670c3aaefab0f53024b2f3729c8083" },
|
||||||
|
"nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" },
|
||||||
"nvim-cmp": { "branch": "main", "commit": "da88697d7f45d16852c6b2769dc52387d1ddc45f" },
|
"nvim-cmp": { "branch": "main", "commit": "da88697d7f45d16852c6b2769dc52387d1ddc45f" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "dc2f86d2b66a6e01a98c37cdadd3be3e90f8ab9a" },
|
"nvim-lspconfig": { "branch": "master", "commit": "841c6d4139aedb8a3f2baf30cef5327371385b93" },
|
||||||
"nvim-treesitter": { "branch": "main", "commit": "2cc172c28e5550e00e6beead4599b1469469c1c7" },
|
"nvim-treesitter": { "branch": "main", "commit": "53f6ce29df5841ce26e5a9f06fb371088b8d8031" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "d7462543c9e366c0d196c7f67a945eaaf5d99414" },
|
"nvim-web-devicons": { "branch": "master", "commit": "d7462543c9e366c0d196c7f67a945eaaf5d99414" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||||
"snacks.nvim": { "branch": "main", "commit": "a049339328e2599ad6e85a69fa034ac501e921b2" },
|
|
||||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
|
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
|
||||||
"telescope.nvim": { "branch": "master", "commit": "3333a52ff548ba0a68af6d8da1e54f9cd96e9179" },
|
"telescope.nvim": { "branch": "master", "commit": "3333a52ff548ba0a68af6d8da1e54f9cd96e9179" },
|
||||||
"tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" },
|
"tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" },
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
return {
|
return {
|
||||||
'nvimdev/dashboard-nvim',
|
'nvimdev/dashboard-nvim',
|
||||||
event = 'VimEnter',
|
event = 'VimEnter',
|
||||||
opts = function()
|
opts = function()
|
||||||
local logo = [[
|
local logo = [[
|
||||||
███╗ ███╗███████╗ █████╗ ███╗ ██╗███████╗██╗██╗ ██╗██╗███╗ ███╗
|
███╗ ███╗███████╗ █████╗ ███╗ ██╗███████╗██╗██╗ ██╗██╗███╗ ███╗
|
||||||
████╗ ████║╚══███╔╝██╔══██╗████╗ ██║██╔════╝██║██║ ██║██║████╗ ████║
|
████╗ ████║╚══███╔╝██╔══██╗████╗ ██║██╔════╝██║██║ ██║██║████╗ ████║
|
||||||
██╔████╔██║ ███╔╝ ███████║██╔██╗ ██║███████╗██║██║ ██║██║██╔████╔██║
|
██╔████╔██║ ███╔╝ ███████║██╔██╗ ██║███████╗██║██║ ██║██║██╔████╔██║
|
||||||
@@ -11,32 +11,37 @@ return {
|
|||||||
╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
|
╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
|
||||||
]]
|
]]
|
||||||
|
|
||||||
logo = string.rep("\n", 8) .. logo .. "\n\n"
|
logo = string.rep("\n", 3) .. logo .. "\n\n"
|
||||||
|
|
||||||
local opts = {
|
local opts = {
|
||||||
theme = "doom",
|
theme = "doom",
|
||||||
config = {
|
config = {
|
||||||
header = vim.split(logo, "\n"),
|
header = vim.split(logo, "\n"),
|
||||||
center = {
|
center = {
|
||||||
-- Aligned to Mzansi Vim Essential Keybindings
|
-- Aligned to Mzansi Vim Essential Keybindings
|
||||||
{ icon = " ", desc = " File Explorer ", key = "cd", action = "Explore" },
|
{ icon = " ", desc = " File Explorer ", key = "cd", action = "Explore" },
|
||||||
{ icon = " ", desc = " Find Files ", key = "ff", action = "Telescope find_files" },
|
{ icon = " ", desc = " Find Files ", key = "ff", action = "Telescope find_files" },
|
||||||
{ icon = " ", desc = " Live Grep ", key = "fg", action = "Telescope live_grep" },
|
{ icon = " ", desc = " Live Grep ", key = "fg", action = "Telescope live_grep" },
|
||||||
{ icon = " ", desc = " Harpoon Menu ", key = "e", action = function()
|
{
|
||||||
local harpoon = require("harpoon")
|
icon = " ",
|
||||||
harpoon.ui:toggle_quick_menu(harpoon:list())
|
desc = " Harpoon Menu ",
|
||||||
end},
|
key = "e",
|
||||||
{ icon = " ", desc = " Harpoon Search ", key = "fl", action = "Telescope harpoon marks" },
|
action = function()
|
||||||
{ icon = " ", desc = " Lazy Manager ", key = "z", action = "Lazy" },
|
local harpoon = require("harpoon")
|
||||||
{ icon = " ", desc = " Help Tags ", key = "fh", action = "Telescope help_tags" },
|
harpoon.ui:toggle_quick_menu(harpoon:list())
|
||||||
{ icon = " ", desc = " Quit ", key = "q", action = "qa" },
|
end
|
||||||
},
|
},
|
||||||
-- footer = { vim.fn.strftime("%Y-%m-%d %H:%M:%S") .. " • Mzansi Vim Kickstart" },
|
{ icon = " ", desc = " Harpoon Search ", key = "fl", action = "Telescope harpoon marks" },
|
||||||
footer = { "Let's Keep Working Hard Mzansi" },
|
{ icon = " ", desc = " Lazy Manager ", key = "z", action = "Lazy" },
|
||||||
},
|
{ icon = " ", desc = " Help Tags ", key = "fh", action = "Telescope help_tags" },
|
||||||
}
|
{ icon = " ", desc = " Quit ", key = "q", action = "qa" },
|
||||||
|
},
|
||||||
|
-- footer = { vim.fn.strftime("%Y-%m-%d %H:%M:%S") .. " • Mzansi Vim Kickstart" },
|
||||||
|
footer = { "Let's Keep Working Hard Mzansi" },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
return opts
|
return opts
|
||||||
end,
|
end,
|
||||||
dependencies = { { 'nvim-tree/nvim-web-devicons' } }
|
dependencies = { { 'nvim-tree/nvim-web-devicons' } }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ return {
|
|||||||
|
|
||||||
local mason_lspconfig = require("mason-lspconfig")
|
local mason_lspconfig = require("mason-lspconfig")
|
||||||
-- We no longer need: local lspconfig = require("lspconfig")
|
-- We no longer need: local lspconfig = require("lspconfig")
|
||||||
|
|
||||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
|
|
||||||
local servers = {
|
local servers = {
|
||||||
@@ -51,70 +50,103 @@ return {
|
|||||||
vim.lsp.enable(server_name)
|
vim.lsp.enable(server_name)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Diagnostic display config
|
||||||
|
vim.diagnostic.config({
|
||||||
|
virtual_text = true, -- show error inline at end of line
|
||||||
|
signs = true,
|
||||||
|
underline = true,
|
||||||
|
update_in_insert = false, -- only update after leaving insert mode
|
||||||
|
float = {
|
||||||
|
border = "rounded",
|
||||||
|
source = true, -- shows which LSP reported the error
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
-- Keybindings (unchanged)
|
-- Keybindings (unchanged)
|
||||||
vim.api.nvim_create_autocmd("LspAttach", {
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
callback = function(ev)
|
callback = function(ev)
|
||||||
local opts = { buffer = ev.buf }
|
local opts = { buffer = ev.buf }
|
||||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
|
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
|
||||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
|
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
|
||||||
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
|
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
|
||||||
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
|
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
|
||||||
vim.keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts)
|
vim.keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts)
|
||||||
end,
|
-- Diagnostic keymaps
|
||||||
|
vim.keymap.set("n", "<leader>e", vim.diagnostic.open_float, opts) -- show error under cursor
|
||||||
|
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) -- jump to previous error
|
||||||
|
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts) -- jump to next error
|
||||||
|
vim.keymap.set("n", "<leader>el", vim.diagnostic.setloclist, opts) -- all errors in quickfix list
|
||||||
|
vim.keymap.set("n", "<leader>af", vim.lsp.buf.format, { desc = "Format file" }) -- manual format
|
||||||
|
|
||||||
|
-- Format on save
|
||||||
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
|
buffer = ev.buf,
|
||||||
|
callback = function()
|
||||||
|
vim.lsp.buf.format({ async = false })
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nvim-flutter/flutter-tools.nvim",
|
"nvim-flutter/flutter-tools.nvim",
|
||||||
lazy = false, -- Load on startup to ensure it handles dartls correctly
|
lazy = false, -- Load on startup to ensure it handles dartls correctly
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
"stevearc/dressing.nvim", -- Optional but highly recommended for better UI
|
"stevearc/dressing.nvim", -- Optional but highly recommended for better UI
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
require("flutter-tools").setup({
|
|
||||||
lsp = {
|
|
||||||
-- Pass your existing capabilities to the flutter-tools LSP config
|
|
||||||
capabilities = require("cmp_nvim_lsp").default_capabilities(),
|
|
||||||
-- You can add specific dartls settings here if needed
|
|
||||||
settings = {
|
|
||||||
showTodos = true,
|
|
||||||
completeFunctionCalls = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
{
|
config = function()
|
||||||
"hrsh7th/nvim-cmp",
|
require("flutter-tools").setup({
|
||||||
dependencies = {
|
lsp = {
|
||||||
|
-- Pass your existing capabilities to the flutter-tools LSP config
|
||||||
|
capabilities = require("cmp_nvim_lsp").default_capabilities(),
|
||||||
|
-- You can add specific dartls settings here if needed
|
||||||
|
settings = {
|
||||||
|
showTodos = true,
|
||||||
|
completeFunctionCalls = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
dependencies = {
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
"hrsh7th/cmp-buffer",
|
"hrsh7th/cmp-buffer",
|
||||||
"hrsh7th/cmp-path",
|
"hrsh7th/cmp-path",
|
||||||
"L3MON4D3/LuaSnip", -- Snippet engine is usually required by cmp configs
|
"L3MON4D3/LuaSnip", -- Snippet engine is usually required by cmp configs
|
||||||
"saadparwaiz1/cmp_luasnip",
|
"saadparwaiz1/cmp_luasnip",
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local cmp = require("cmp")
|
local cmp = require("cmp")
|
||||||
cmp.setup({
|
cmp.setup({
|
||||||
snippet = {
|
snippet = {
|
||||||
expand = function(args)
|
expand = function(args)
|
||||||
require("luasnip").lsp_expand(args.body)
|
require("luasnip").lsp_expand(args.body)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
mapping = cmp.mapping.preset.insert({
|
mapping = cmp.mapping.preset.insert({
|
||||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||||
["<C-Space>"] = cmp.mapping.complete(),
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||||
}),
|
["<Tab>"] = cmp.mapping(function(fallback) -- add this
|
||||||
sources = cmp.config.sources({
|
if cmp.visible() then
|
||||||
{ name = "nvim_lsp" },
|
cmp.confirm({ select = true })
|
||||||
{ name = "luasnip" },
|
else
|
||||||
}, {
|
fallback()
|
||||||
{ name = "buffer" },
|
end
|
||||||
}),
|
end, { "i", "s" }),
|
||||||
|
}),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = "nvim_lsp" },
|
||||||
|
{ name = "luasnip" },
|
||||||
|
}, {
|
||||||
|
{ name = "buffer" },
|
||||||
|
}),
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
9
lua/plugins/mini-ai.lua
Normal file
9
lua/plugins/mini-ai.lua
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
return {
|
||||||
|
"echasnovski/mini.ai",
|
||||||
|
version = "*",
|
||||||
|
config = function()
|
||||||
|
require("mini.ai").setup({
|
||||||
|
search_method = "next",
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
@@ -1,6 +1,20 @@
|
|||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
-- Git Plugin
|
-- Git Plugin
|
||||||
'tpope/vim-fugitive',
|
'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',
|
||||||
|
event = "InsertEnter",
|
||||||
|
config = true
|
||||||
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,31 +1,31 @@
|
|||||||
return {
|
return {
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
build = ":TSUpdate",
|
build = ":TSUpdate",
|
||||||
config = function()
|
config = function()
|
||||||
require("nvim-treesitter").setup({
|
require("nvim-treesitter").setup({
|
||||||
install_dir = vim.fn.stdpath("data") .. "/site",
|
install_dir = vim.fn.stdpath("data") .. "/site",
|
||||||
highlight = { enable = true },
|
highlight = { enable = true },
|
||||||
indent = { enable = true },
|
indent = { enable = true },
|
||||||
autotag = { enable = true },
|
autotag = { enable = true },
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"lua",
|
"lua",
|
||||||
"vim",
|
"vim",
|
||||||
"vimdoc",
|
"vimdoc",
|
||||||
"query",
|
"query",
|
||||||
"dart",
|
"dart",
|
||||||
"python",
|
"python",
|
||||||
"dockerfile",
|
"dockerfile",
|
||||||
"yaml",
|
"yaml",
|
||||||
"bash",
|
"bash",
|
||||||
"json",
|
"json",
|
||||||
"html",
|
"html",
|
||||||
"css",
|
"css",
|
||||||
"javascript",
|
"javascript",
|
||||||
"sql",
|
"sql",
|
||||||
"markdown",
|
"markdown",
|
||||||
"markdown_inline",
|
"markdown_inline",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user