Skip to content

Commit

Permalink
Merge pull request #9 from appelgriebsch/feature/lazyextra-extensions
Browse files Browse the repository at this point in the history
use LazyExtra extension feature
  • Loading branch information
appelgriebsch authored Oct 13, 2023
2 parents 2056e45 + 9edb611 commit 6f02603
Show file tree
Hide file tree
Showing 24 changed files with 450 additions and 404 deletions.
31 changes: 2 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,8 @@ A [Neovim](https://neovim.io) setup based on [LazyVim](https://github.com/LazyVi
1. Install [Neovim] version 0.8 or higher on your machine
2. Remove or backup your existing configuration files in `~/.config/nvim`
3. Clone the git repo `git clone https://github.com/appelgriebsch/Nv ~/.config/nvim`
4. Configure `Nv` in `init.lua` file according to your needs - default options:
```lua
nv = {
colorscheme = "onelight", -- colorscheme setting for either onedark.nvim or github-theme
codeium_support = false, -- enable codeium extension
copilot_support = false, -- enable copilot extension
coverage_support = true, -- enable coverage extension
dap_support = true, -- enable dap extension
lang = {
clangd = false, -- enable clangd and cmake extension
docker = true, -- enable docker extension
elixir = false, -- enable elixir extension
go = false, -- enable go extension
java = false, -- enable java extension
nodejs = true, -- enable nodejs bundle (typescript, css, html, json)
omnisharp = false, -- enable omnisharp extension
python = true, -- enable python extension
ruby = false, -- enable ruby extension
rust = true, -- enable rust extension
terraform = false, -- enable terraform extension
tex = false, -- enable tex extension
typescript = false, -- enable typescript extension
yaml = true, -- enable yaml extension
},
rest_support = true, -- enable rest.nvim extension
test_support = true -- enable test extension
},
```
5. Run `nvim` from a terminal
4. Run `nvim` from a terminal
5. Use the `LazyExtras` option from within Neovim to enable optional plugins

## Show case

Expand Down
37 changes: 1 addition & 36 deletions init.lua
Original file line number Diff line number Diff line change
@@ -1,37 +1,2 @@
-- bootstrap lazy.nvim, LazyVim and your plugins
require("config.lazy")({
debug = false,
defaults = {
lazy = true,
-- cond = false,
},
nv = {
colorscheme = "onelight", -- colorscheme setting for either onedark.nvim or github-theme
codeium_support = false, -- enable codeium extension
copilot_support = false, -- enable copilot extension
coverage_support = true, -- enable coverage extension
dap_support = true, -- enable dap extension
lang = {
clangd = false, -- enable clangd and cmake extension
docker = true, -- enable docker extension
elixir = false, -- enable elixir extension
go = false, -- enable go extension
java = false, -- enable java extension
nodejs = true, -- enable nodejs bundle (typescript, css, html, json)
omnisharp = false, -- enable omnisharp extension
python = true, -- enable python extension
ruby = false, -- enable ruby extension
rust = true, -- enable rust extension
terraform = false, -- enable terraform extension
tex = false, -- enable tex extension
yaml = true, -- enable yaml extension
},
rest_support = true, -- enable rest.nvim extension
test_support = true -- enable test extension
},
performance = {
cache = {
enabled = true,
},
},
})
require("config.lazy")
43 changes: 14 additions & 29 deletions lazy-lock.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,25 @@
{
"LazyVim": { "branch": "main", "commit": "763c0fd9f296ec31119c0e7109b9b73d15553fff" },
"LazyVim": { "branch": "main", "commit": "ea4174d46016dd191de48c03bdf23462483f9f6a" },
"LuaSnip": { "branch": "master", "commit": "0df29db3543837f8b41597f2640397c5ec792b7b" },
"SchemaStore.nvim": { "branch": "main", "commit": "854b38820036d81c5e6af1cae8797776ae5df56a" },
"aerial.nvim": { "branch": "master", "commit": "da3041fd56c605dc1a07e6f8089312ff0a63da84" },
"aerial.nvim": { "branch": "master", "commit": "9ef83d9a7a4ac471d14e608da50b8d91459cae10" },
"bufdelete.nvim": { "branch": "master", "commit": "07d1f8ba79dec59d42b975a4df1c732b2e4e37b4" },
"bufferline.nvim": { "branch": "main", "commit": "357cc8f8eeb64702e6fcf2995e3b9becee99a5d3" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-npm": { "branch": "main", "commit": "2337f109f51a09297596dd6b538b70ccba92b4e4" },
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"conform.nvim": { "branch": "master", "commit": "4db76a68b47aa6e9777e4da4aed16f0fff74920e" },
"crates.nvim": { "branch": "main", "commit": "58bf989736765cae41fa5d0971027efeca033301" },
"conform.nvim": { "branch": "master", "commit": "f883e901587c335277fc86cd12867513f85914d7" },
"darklight.nvim": { "branch": "main", "commit": "d6ab8f3b2921dcdc4591961f89c34b467387f2eb" },
"dashboard-nvim": { "branch": "master", "commit": "8721edccead31c07c2cda0bc5ac75b0491b5adcd" },
"diffview.nvim": { "branch": "main", "commit": "d38c1b5266850f77f75e006bcc26213684e1e141" },
"dressing.nvim": { "branch": "master", "commit": "1f2d1206a03bd3add8aedf6251e4534611de577f" },
"edgy.nvim": { "branch": "main", "commit": "4a4bab427e31eb37678bae3e478f166aae9deff3" },
"edgy.nvim": { "branch": "main", "commit": "48c9928a04b16dcbceb5d03ac6264b45a1e35bde" },
"flash.nvim": { "branch": "main", "commit": "6d76c5dee65181ab55cbdfb0760260e800d643f4" },
"friendly-snippets": { "branch": "main", "commit": "43727c2ff84240e55d4069ec3e6158d74cb534b6" },
"git-blame.nvim": { "branch": "master", "commit": "e4dafc79cc7dcf4eec0547dbc6f3f3821b2f2b14" },
"git-conflict.nvim": { "branch": "main", "commit": "896261933afe2fddf6fb043d9cd4d88301b151a9" },
"github-nvim-theme": { "branch": "main", "commit": "48f95f763e1a98e508260a20e448c3ff2d91213a" },
"gitsigns.nvim": { "branch": "main", "commit": "ff01d34daaed72f271a8ffa088a7e839a60c640f" },
"indent-blankline.nvim": { "branch": "master", "commit": "0fe34b4c1b926e106d105d3ae88ef6cbf6743572" },
"lazy.nvim": { "branch": "main", "commit": "33c447b96e1cb1a5a2be87982d5d32bb5054079d" },
"lazy.nvim": { "branch": "main", "commit": "276e572f645430bcfd6fd25faa301ea9077f6ab1" },
"lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "397273083f988c1a17acf3816947cd198338e700" },
"mason-nvim-dap.nvim": { "branch": "main", "commit": "6148b51db945b55b3b725da39eaea6441e59dff8" },
Expand All @@ -38,49 +34,38 @@
"neoconf.nvim": { "branch": "main", "commit": "393d37abd9d82adcac627309a41758ae8e140d9e" },
"neodev.nvim": { "branch": "main", "commit": "a4b6e7ca11ff5be2264d5c169fcedd97d8699ec4" },
"neotest": { "branch": "master", "commit": "1e67a504d03def3a6a1125d934cb511680f72555" },
"neotest-python": { "branch": "master", "commit": "81d2265efac717bb567bc15cc652ae10801286b3" },
"neotest-rust": { "branch": "main", "commit": "03e036a310379f132d4e39387e9076396132ce3f" },
"noice.nvim": { "branch": "main", "commit": "fcd01710ff6918d4d3ef90c8e36f3addacba13bf" },
"noice.nvim": { "branch": "main", "commit": "b990101f508b29470bfa16cdf3c08f040d85b435" },
"nui.nvim": { "branch": "main", "commit": "c0c8e347ceac53030f5c1ece1c5a5b6a17a25b32" },
"nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" },
"nvim-coverage": { "branch": "main", "commit": "fd6f94781c94958d1c26353d0d43a82ea5572b31" },
"nvim-dap": { "branch": "master", "commit": "92dc531eea2c9a3ef504a5c8ac0decd1fa59a6a3" },
"nvim-dap-python": { "branch": "master", "commit": "37b4cba02e337a95cb62ad1609b3d1dccb2e5d42" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "57f1dbd0458dd84a286b27768c142e1567f3ce3b" },
"nvim-jqx": { "branch": "master", "commit": "11b1d0368e5b23b9c356da8e5f70bb5827f27f62" },
"nvim-lint": { "branch": "master", "commit": "0f54481d7537a6872f7bb021575366657e123474" },
"nvim-lspconfig": { "branch": "master", "commit": "cab7233cd6a89ec952dfd40c4b74341b1165830e" },
"nvim-lspconfig": { "branch": "master", "commit": "bb8e3dfbe10d80c294bb609c4bb4bba3ecdfbfe2" },
"nvim-notify": { "branch": "master", "commit": "e4a2022f4fec2d5ebc79afa612f96d8b11c627b3" },
"nvim-scrollview": { "branch": "main", "commit": "e8befc94ea66194700495d2f71419ba112634b0b" },
"nvim-spectre": { "branch": "master", "commit": "696cff781a4a7ecc91549736835e2acbd00fe859" },
"nvim-treesitter": { "branch": "master", "commit": "49f7194e4c4d3c9ed891b0968798c062e8ac5a3d" },
"nvim-treesitter": { "branch": "master", "commit": "168972a0d53170767e49d44f678ca721a2472560" },
"nvim-treesitter-context": { "branch": "master", "commit": "4cf64264c049c55f256550ad247b606f3e53bc77" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "76c7a89b41de77a4f83fb77fa072c5ad7605fe3b" },
"nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "7241635869b7a8115893ffa67bab3907756caf4f" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "92e688f013c69f90c9bbd596019ec10235bc51de" },
"nvim-web-devicons": { "branch": "master", "commit": "a1e6268779411048a87f767a27380089362a0ce2" },
"one-small-step-for-vimkind": { "branch": "main", "commit": "edbb34ee779049f2071dc7becff0bbf51c865906" },
"onedarkpro.nvim": { "branch": "main", "commit": "7c02b4eeb310173ef6d741e60200d72b76923eae" },
"package-info.nvim": { "branch": "master", "commit": "4d98c8cc90d970d87c472c04bf7ca712336cc753" },
"persistence.nvim": { "branch": "main", "commit": "4b8051c01f696d8849a5cb8afa9767be8db16e40" },
"persistence.nvim": { "branch": "main", "commit": "9730a073fd8270e91729d666bcef6a5abc007f02" },
"plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" },
"project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" },
"rest.nvim": { "branch": "main", "commit": "5bcaa1012ea8efd6093c69d2a4c67fbde760d043" },
"rust-tools.nvim": { "branch": "master", "commit": "0cc8adab23117783a0292a0c8a2fbed1005dc645" },
"scope.nvim": { "branch": "main", "commit": "01ce40fe7434fba9a122c01b4734479b3860609a" },
"sqlite.lua": { "branch": "master", "commit": "b7e28c8463254c46a8e61c52d27d6a2040492fc3" },
"telescope-dap.nvim": { "branch": "master", "commit": "4e2d5efb92062f0b865fe59b200b5ed7793833bf" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" },
"telescope-undo.nvim": { "branch": "main", "commit": "3dec002ea3e7952071d26fbb5d01e2038a58a554" },
"telescope.nvim": { "branch": "master", "commit": "74ce793a60759e3db0d265174f137fb627430355" },
"tidy.nvim": { "branch": "main", "commit": "86eab24e807ed2957d26ca43b2b76b92d0fbf8f4" },
"todo-comments.nvim": { "branch": "main", "commit": "3094ead8edfa9040de2421deddec55d3762f64d1" },
"tokyonight.nvim": { "branch": "main", "commit": "dce0ab49ae751f4f3617ab42d6f20c72369c7cb1" },
"trouble.nvim": { "branch": "main", "commit": "02219b557d4726a789be58c5d6bd6e139c46a9fe" },
"venv-selector.nvim": { "branch": "main", "commit": "6ef90a217299500edfd86a322b9a195fb1b07013" },
"vim-illuminate": { "branch": "master", "commit": "3bd2ab64b5d63b29e05691e624927e5ebbf0fb86" },
"vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" },
"which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" },
"yanky.nvim": { "branch": "main", "commit": "cc3fc03c780a14f189290edcf1c47dc1306626d4" },
"zen-mode.nvim": { "branch": "main", "commit": "cb73b8bd0ef9d765b942db09dc762c603a89ae44" }
}
"which-key.nvim": { "branch": "main", "commit": "6962dae3565369363b59dd51fb206051555fcb4d" },
"yanky.nvim": { "branch": "main", "commit": "cc3fc03c780a14f189290edcf1c47dc1306626d4" }
}
24 changes: 24 additions & 0 deletions lazyvim.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"extras": [
"lazyvim.plugins.extras.coding.yanky",
"lazyvim.plugins.extras.dap.core",
"lazyvim.plugins.extras.dap.nlua",
"lazyvim.plugins.extras.editor.aerial",
"lazyvim.plugins.extras.test.core",
"lazyvim.plugins.extras.ui.edgy",
"lazyvim.plugins.extras.ui.mini-animate",
"lazyvim.plugins.extras.util.project",
"plugins.extras.editor.bufdelete",
"plugins.extras.editor.git-blame",
"plugins.extras.editor.git-conflict",
"plugins.extras.editor.scope",
"plugins.extras.editor.tidy",
"plugins.extras.editor.undo-mode",
"plugins.extras.test.coverage",
"plugins.extras.ui.onedarkpro-theme"
],
"news": {
"NEWS.md": "2123"
},
"version": 2
}
26 changes: 0 additions & 26 deletions lua/config/autocmds.lua
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
-- Autocmds are automatically loaded on the VeryLazy event
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua

-- Fixes Autocomment
vim.api.nvim_create_autocmd("BufEnter", {
pattern = "*",
command = "set fo-=c fo-=r fo-=o",
})

-- resize splits if window got resized
vim.api.nvim_create_autocmd({ "VimResized" }, {
callback = function()
vim.cmd("tabdo wincmd =")
end,
})

-- close some filetypes with <q>
vim.api.nvim_create_autocmd("FileType", {
pattern = {
Expand All @@ -25,16 +12,3 @@ vim.api.nvim_create_autocmd("FileType", {
vim.keymap.set("n", "q", "<cmd>close<cr>", { buffer = event.buf, silent = true })
end,
})

-- close some filetypes with <q>
vim.api.nvim_create_autocmd("FileType", {
pattern = {
"dap-terminal",
},
callback = function(event)
vim.keymap.set("n", "q", "<cmd>bdelete!<cr>", { buffer = event.buf, silent = true })
end,
})

-- show dashboard when new tab page is opened
vim.api.nvim_create_autocmd('TabNewEntered', { command = 'Dashboard' })
133 changes: 34 additions & 99 deletions lua/config/lazy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,105 +7,40 @@ if not vim.loop.fs_stat(lazypath) then
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)

---@param opts LazyConfig
return function(opts)
opts = vim.tbl_deep_extend("force", {
spec = {
{
-- import LazyVim plugins
"LazyVim/LazyVim",
import = "lazyvim.plugins",
opts = {
colorscheme = function()
local theme = ""
if string.match(opts.nv.colorscheme, "github") ~= nil then
theme = "github"
else
if string.match(opts.nv.colorscheme, "one[dark|light]") ~= nil then
theme = "onedark"
end
end
local has_theme, nvim_theme = pcall(require, "plugins.extras.theme." .. theme)
if has_theme then
nvim_theme.setup(opts.nv.colorscheme)
else
require("tokyonight").load() -- fallback to tokyo night if not otherwise specified
end
end,
},
},
-- lazyvim codeium extension modules
{ import = "lazyvim.plugins.extras.coding.codeium", enabled = opts.nv.codeium_support },
-- lazyvim copilot extension modules
{ import = "lazyvim.plugins.extras.coding.copilot", enabled = opts.nv.copilot_support },
-- lazyvim yanky extension modules
{ import = "lazyvim.plugins.extras.coding.yanky" },
-- lazyvim dap core extension modules
{ import = "lazyvim.plugins.extras.dap.core", enabled = opts.nv.dap_support },
-- debugger specific extension modules
{ import = "lazyvim.plugins.extras.dap.nlua", enabled = opts.nv.dap_support },
-- core language specific extension modules
{ import = "lazyvim.plugins.extras.lang.clangd", enabled = opts.nv.lang.clangd },
{ import = "lazyvim.plugins.extras.lang.cmake", enabled = opts.nv.lang.clangd },
{ import = "lazyvim.plugins.extras.lang.docker", enabled = opts.nv.lang.docker },
{ import = "lazyvim.plugins.extras.lang.elixir", enabled = opts.nv.lang.elixir },
{ import = "lazyvim.plugins.extras.lang.go", enabled = opts.nv.lang.go },
{ import = "lazyvim.plugins.extras.lang.java", enabled = opts.nv.lang.java },
{ import = "lazyvim.plugins.extras.lang.omnisharp", enabled = opts.nv.lang.omnisharp },
{ import = "lazyvim.plugins.extras.lang.python", enabled = opts.nv.lang.python },
{ import = "lazyvim.plugins.extras.lang.ruby", enabled = opts.nv.lang.ruby },
{ import = "lazyvim.plugins.extras.lang.rust", enabled = opts.nv.lang.rust },
{ import = "lazyvim.plugins.extras.lang.terraform", enabled = opts.nv.lang.terraform },
{ import = "lazyvim.plugins.extras.lang.tex", enabled = opts.nv.lang.tex },
{ import = "lazyvim.plugins.extras.lang.yaml", enabled = opts.nv.lang.yaml },
-- lazyvim test core extension modules
{ import = "lazyvim.plugins.extras.test.core", enabled = opts.nv.test_support },
-- lazyvim UI extension modules
{ import = "lazyvim.plugins.extras.ui.edgy" },
{ import = "lazyvim.plugins.extras.ui.mini-animate" },
-- lazyvim aerial extension modules │
{ import = "lazyvim.plugins.extras.editor.aerial" },
-- lazyvim project extension modules
{ import = "lazyvim.plugins.extras.util.project" },
-- import/override with your plugins
{ import = "plugins" },
-- custom language specific extension modules
{ import = "plugins.extras.lang.nodejs", enabled = opts.nv.lang.nodejs },
-- lazyvim coverage extension modules
{ import = "plugins.extras.test.coverage", enabled = opts.nv.coverage_support },
-- lazyvim REST extension modules
{ import = "plugins.extras.util.rest", enabled = opts.nv.rest_support },
},
defaults = {
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
lazy = false,
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
-- have outdated releases, which may break your Neovim install.
version = false, -- always use the latest git commit
-- version = "*", -- try installing the latest stable version for plugins that support semver
require("lazy").setup({
spec = {
-- add LazyVim and import its plugins
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
-- import/override with your plugins
{ import = "plugins" },
},
defaults = {
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
lazy = false,
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
-- have outdated releases, which may break your Neovim install.
version = false, -- always use the latest git commit
-- version = "*", -- try installing the latest stable version for plugins that support semver
},
install = { colorscheme = { "tokyonight", "habamax" } },
checker = { enabled = true }, -- automatically check for plugin updates
performance = {
cache = {
enabled = true,
},
install = { colorscheme = { "tokyonight", "habamax" } },
checker = { enabled = true }, -- automatically check for plugin updates
performance = {
cache = {
enabled = true,
-- disable_events = {},
},
rtp = {
-- disable some rtp plugins
disabled_plugins = {
"gzip",
-- "matchit",
-- "matchparen",
-- "netrwPlugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
rtp = {
-- disable some rtp plugins
disabled_plugins = {
"gzip",
-- "matchit",
-- "matchparen",
-- "netrwPlugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
}, opts or {})
require("lazy").setup(opts)
end
},
})
Loading

0 comments on commit 6f02603

Please sign in to comment.