refactor(init): fine tuned lazy.nvim setup and loading of options
This commit is contained in:
parent
ec10265eb7
commit
d8a6a44f70
15
init.lua
15
init.lua
|
@ -1,3 +1,16 @@
|
|||
require("config.opts")
|
||||
|
||||
--
|
||||
-- Initialize Neovim configuration
|
||||
-- ..............................................
|
||||
--
|
||||
-- Author: Sven Vogel
|
||||
-- Created: 01.11.2024
|
||||
-- Edited: 01.11.2024
|
||||
--
|
||||
-- ==============================================
|
||||
|
||||
-- Load plugin manager
|
||||
-- and plugins, additonally setup global options
|
||||
require("config.lazy")
|
||||
-- install custom keymaps
|
||||
require("config.keys")
|
||||
|
|
|
@ -1,4 +1,14 @@
|
|||
|
||||
--
|
||||
-- Global custom plugin agnostic keymaps
|
||||
-- ..............................................
|
||||
--
|
||||
-- Author: Sven Vogel
|
||||
-- Created: 01.11.2024
|
||||
-- Edited: 01.11.2024
|
||||
--
|
||||
-- ==============================================
|
||||
|
||||
local keymaps = {
|
||||
--
|
||||
-- Write buffer to disk
|
||||
|
@ -116,8 +126,22 @@ local keymaps = {
|
|||
end
|
||||
end,
|
||||
desc = "Close buffer"
|
||||
},
|
||||
--
|
||||
-- Tab (barbar) controls
|
||||
-- ..............................................
|
||||
{
|
||||
mode = { 'n', 'i' },
|
||||
keys = '<C-tab>',
|
||||
cmd = vim.cmd('BufferNext'),
|
||||
desc = "Switch to the next buffer"
|
||||
},
|
||||
{
|
||||
mode = { 'n', 'i' },
|
||||
keys = '<C-S-tab>',
|
||||
cmd = vim.cmd('BufferPrevious'),
|
||||
desc = "Switch to the previous buffer"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for _, keymap in pairs(keymaps) do
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
|
||||
--
|
||||
-- Bootstrap and start Lazy.nvim plugins
|
||||
-- manager.
|
||||
-- ..............................................
|
||||
--
|
||||
-- Author: Sven Vogel
|
||||
-- Created: 01.11.2024
|
||||
-- Edited: 01.11.2024
|
||||
--
|
||||
-- ==============================================
|
||||
|
||||
--
|
||||
-- Bootstrap Lazy.nvim package manager
|
||||
-- ..............................................
|
||||
|
||||
-- Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
|
@ -15,12 +31,23 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
|||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
--
|
||||
-- Early setup of Neovim and VIM options
|
||||
-- ..............................................
|
||||
|
||||
-- Make sure to setup `mapleader` and `maplocalleader` before
|
||||
-- loading lazy.nvim so that mappings are correct.
|
||||
-- This is also a good place to setup other settings (vim.opt)
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = "\\"
|
||||
|
||||
-- load options
|
||||
require("config.opts")
|
||||
|
||||
--
|
||||
-- Start Lazy.nvim
|
||||
-- ..............................................
|
||||
|
||||
-- Setup lazy.nvim
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
|
@ -32,4 +59,17 @@ require("lazy").setup({
|
|||
install = { colorscheme = { "habamax" } },
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = false },
|
||||
rtp = {
|
||||
disabled_plugins = {
|
||||
"gzip",
|
||||
"matchit",
|
||||
"matchparen",
|
||||
"netrw",
|
||||
"netrwplugin",
|
||||
"tarplugin",
|
||||
"tohtml",
|
||||
"tutor",
|
||||
"zipplugin",
|
||||
}
|
||||
},
|
||||
})
|
||||
|
|
|
@ -37,4 +37,7 @@ opt.smartindent = true
|
|||
-- VIM global options
|
||||
-- ..............................................
|
||||
|
||||
vim.g.loaded_netrwPlugin = 0 -- disable netrw, VIM's builtin file explorer
|
||||
-- disable netrw
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
|
|
Loading…
Reference in New Issue