add starter config files

This commit is contained in:
siduck 2024-03-09 21:33:44 +05:30
parent 45a1b2c9a8
commit aa13916e94
7 changed files with 133 additions and 0 deletions

39
init.lua Normal file
View File

@ -0,0 +1,39 @@
vim.g.base46_cache = vim.fn.stdpath "data" .. "/nvchad/base46/"
vim.g.mapleader = " "
-- bootstrap lazy and all plugins
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
local repo = "https://github.com/folke/lazy.nvim.git"
vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath }
end
vim.opt.rtp:prepend(lazypath)
local lazy_config = require "configs.lazy"
-- load plugins
require("lazy").setup({
{
"NvChad/NvChad",
lazy = false,
branch = "starter",
import = "nvchad.plugins",
config = function()
require "options"
end,
},
{ import = "plugins" },
}, lazy_config)
-- load theme
dofile(vim.g.base46_cache .. "defaults")
dofile(vim.g.base46_cache .. "statusline")
require "nvchad.autocmds"
vim.schedule(function()
require "mappings"
end)

7
lua/chadrc.lua Normal file
View File

@ -0,0 +1,7 @@
local M = {}
M.ui = {
theme = "onedark",
}
return M

9
lua/configs/conform.lua Normal file
View File

@ -0,0 +1,9 @@
local options = {
lsp_fallback = true,
formatters_by_ft = {
lua = { "stylua" },
},
}
require("conform").setup(options)

47
lua/configs/lazy.lua Normal file
View File

@ -0,0 +1,47 @@
return {
defaults = { lazy = true },
install = { colorscheme = { "nvchad" } },
ui = {
icons = {
ft = "",
lazy = "󰂠 ",
loaded = "",
not_loaded = "",
},
},
performance = {
rtp = {
disabled_plugins = {
"2html_plugin",
"tohtml",
"getscript",
"getscriptPlugin",
"gzip",
"logipat",
"netrw",
"netrwPlugin",
"netrwSettings",
"netrwFileHandlers",
"matchit",
"tar",
"tarPlugin",
"rrhelper",
"spellfile_plugin",
"vimball",
"vimballPlugin",
"zip",
"zipPlugin",
"tutor",
"rplugin",
"syntax",
"synmenu",
"optwin",
"compiler",
"bugreport",
"ftplugin",
},
},
},
}

13
lua/mappings.lua Normal file
View File

@ -0,0 +1,13 @@
require "nvchad.mappings"
-- add yours here
local map = vim.keymap.set
map("n", ";", ":", { desc = "CMD enter command mode" })
map("n", "<leader>fm", function()
require("conform").format()
end, { desc = "File Format with conform" })
map("i", "jk", "<ESC>", { desc = "Escape insert mode" })

3
lua/options.lua Normal file
View File

@ -0,0 +1,3 @@
require "nvchad.options"
-- add yours here!

15
lua/plugins/init.lua Normal file
View File

@ -0,0 +1,15 @@
return {
{
"stevearc/conform.nvim",
config = function()
require "configs.conform"
end,
},
{
"nvim-tree/nvim-tree.lua",
opts = {
git = { enable = true },
},
},
}