From aa13916e9411df9e32dfa871116b82a6dcab274a Mon Sep 17 00:00:00 2001 From: siduck Date: Sat, 9 Mar 2024 21:33:44 +0530 Subject: [PATCH] add starter config files --- init.lua | 39 ++++++++++++++++++++++++++++++++++ lua/chadrc.lua | 7 ++++++ lua/configs/conform.lua | 9 ++++++++ lua/configs/lazy.lua | 47 +++++++++++++++++++++++++++++++++++++++++ lua/mappings.lua | 13 ++++++++++++ lua/options.lua | 3 +++ lua/plugins/init.lua | 15 +++++++++++++ 7 files changed, 133 insertions(+) create mode 100644 init.lua create mode 100644 lua/chadrc.lua create mode 100644 lua/configs/conform.lua create mode 100644 lua/configs/lazy.lua create mode 100644 lua/mappings.lua create mode 100644 lua/options.lua create mode 100644 lua/plugins/init.lua diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..79254e5 --- /dev/null +++ b/init.lua @@ -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) diff --git a/lua/chadrc.lua b/lua/chadrc.lua new file mode 100644 index 0000000..1009e74 --- /dev/null +++ b/lua/chadrc.lua @@ -0,0 +1,7 @@ +local M = {} + +M.ui = { + theme = "onedark", +} + +return M diff --git a/lua/configs/conform.lua b/lua/configs/conform.lua new file mode 100644 index 0000000..8660a60 --- /dev/null +++ b/lua/configs/conform.lua @@ -0,0 +1,9 @@ +local options = { + lsp_fallback = true, + + formatters_by_ft = { + lua = { "stylua" }, + }, +} + +require("conform").setup(options) diff --git a/lua/configs/lazy.lua b/lua/configs/lazy.lua new file mode 100644 index 0000000..cd170bd --- /dev/null +++ b/lua/configs/lazy.lua @@ -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", + }, + }, + }, +} diff --git a/lua/mappings.lua b/lua/mappings.lua new file mode 100644 index 0000000..61d10b6 --- /dev/null +++ b/lua/mappings.lua @@ -0,0 +1,13 @@ +require "nvchad.mappings" + +-- add yours here + +local map = vim.keymap.set + +map("n", ";", ":", { desc = "CMD enter command mode" }) + +map("n", "fm", function() + require("conform").format() +end, { desc = "File Format with conform" }) + +map("i", "jk", "", { desc = "Escape insert mode" }) diff --git a/lua/options.lua b/lua/options.lua new file mode 100644 index 0000000..566eb80 --- /dev/null +++ b/lua/options.lua @@ -0,0 +1,3 @@ +require "nvchad.options" + +-- add yours here! diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua new file mode 100644 index 0000000..8efbcdf --- /dev/null +++ b/lua/plugins/init.lua @@ -0,0 +1,15 @@ +return { + { + "stevearc/conform.nvim", + config = function() + require "configs.conform" + end, + }, + + { + "nvim-tree/nvim-tree.lua", + opts = { + git = { enable = true }, + }, + }, +}