rewrite configuration, migrate to lazy.nvim

This commit is contained in:
♥ Minnie ♥ 2023-10-10 19:04:12 +08:00
parent 618cd6a9a4
commit ac44add81c
11 changed files with 380 additions and 342 deletions

View file

@ -1,86 +1,31 @@
--
-- Vim Options
-- Bootstrap lazy.nvim
--
-- Disable vim's built in file explorer
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- {{{ General Configuration
vim.opt.termguicolors = true -- set termguicolors to enable highlight groups
vim.opt.number = true -- print line numbers
vim.opt.showmode = false -- if in insert, replace or visual mode put a message on the last line
vim.opt.swapfile = false -- disable swap file
vim.opt.clipboard = 'unnamedplus' -- use the system clipboard as the default register
-- }}}
-- {{{ Spaces & Tabs
vim.opt.tabstop = 2 -- number of visual spaces per TAB
vim.opt.softtabstop = 2 -- number of spaces in tab when editing
vim.opt.shiftwidth = 2 -- number of spaces to use for autoindent
vim.opt.expandtab = true -- tabs are space
vim.opt.autoindent = true
vim.opt.copyindent = true -- copy indent from the previous line
-- }}}
-- {{{ Keybinds
vim.g.mapleader = ' '
local opts = { noremap = true, silent = true }
local map = vim.api.nvim_set_keymap
map('n', '<leader>t', ':NvimTreeToggle<cr>', opts)
-- }}}
--
-- Gruvbox Material
--
-- For dark version
vim.opt.background = 'dark'
-- Set contrast
vim.g.gruvbox_material_background = 'hard'
-- For better performance
vim.g.gruvbox_material_better_performance = 0
-- To disable italic in `Comment`, set this option to `1`
vim.g.gruvbox_material_disable_italic_comment = 1
-- To enable bold in function name just like the original gruvbox, set this option to `1`
vim.g.gruvbox_material_enable_bold = 0
-- To enable italic in this color scheme, set this option to `1`
vim.g.gruvbox_material_enable_italic = 1
-- Set the colorscheme
vim.cmd [[colorscheme gruvbox-material]]
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable', -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
--
-- Load and run our libraries
-- Load our configurations
--
-- load defaults
require('nvim-tree').setup()
require('Comment').setup()
require('gitsigns').setup()
-- user
require('user.lspconfig')
require('user.nvim-cmp')
require('user.lualine')
-- user.config
require('user.config.server_configurations')
require('configs.options')
-- Enable syntax highlighting
require('nvim-treesitter.configs').setup {
highlight = {
enable = true,
}
}
--
-- Load our plugin specs
--
require('lazy').setup('plugins')