Migrating some doom emacs to nvchad

This commit is contained in:
Emmet 2024-09-14 20:31:57 -05:00
parent f975867a81
commit 29eacd05bb
12 changed files with 353 additions and 3 deletions

View file

@ -0,0 +1,17 @@
-- This file needs to have same structure as nvconfig.lua
-- https://github.com/NvChad/ui/blob/v2.5/lua/nvconfig.lua
-- Please read that file to know all available options :(
---@type ChadrcConfig
local M = {}
M.base46 = {
theme = "stylix",
-- hl_override = {
-- Comment = { italic = true },
-- ["@comment"] = { italic = true },
-- },
}
return M

View file

@ -0,0 +1,15 @@
local options = {
formatters_by_ft = {
lua = { "stylua" },
-- css = { "prettier" },
-- html = { "prettier" },
},
-- format_on_save = {
-- -- These options will be passed to conform.format()
-- timeout_ms = 500,
-- lsp_fallback = true,
-- },
}
return options

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",
},
},
},
}

View file

@ -0,0 +1,24 @@
-- load defaults i.e lua_lsp
require("nvchad.configs.lspconfig").defaults()
local lspconfig = require "lspconfig"
-- EXAMPLE
local servers = { "html", "cssls" }
local nvlsp = require "nvchad.configs.lspconfig"
-- lsps with default config
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = nvlsp.on_attach,
on_init = nvlsp.on_init,
capabilities = nvlsp.capabilities,
}
end
-- configuring single server, example: typescript
-- lspconfig.ts_ls.setup {
-- on_attach = nvlsp.on_attach,
-- on_init = nvlsp.on_init,
-- capabilities = nvlsp.capabilities,
-- }

View file

@ -0,0 +1,26 @@
require "nvchad.mappings"
-- add yours here
local map = vim.keymap.set
local builtin = require("telescope.builtin")
local utils = require("telescope.utils")
local change_scale_factor = function(delta)
vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * delta
end
vim.keymap.set("n", "<C-=>", function()
change_scale_factor(1.25)
end)
vim.keymap.set("n", "<C-->", function()
change_scale_factor(1/1.25)
end)
map("n", ";", ":", { desc = "CMD enter command mode" })
map({"n", "v", "i"}, "<A-x>", ":", { desc = "CMD enter command mode" })
map("n", "<leader>.", "<cmd>Telescope find_files<cr>", { desc = "telescope find files" })
map("n", "<leader>gg", "<cmd>Neogit<cr>", { desc = "Neogit status buffer" })
map("n", "<leader>pp", "<cmd>Telescope workspaces<cr>", { desc = "telescope workspaces" })
map("i", "jk", "<ESC>")
-- map({ "n", "i", "v" }, "<C-s>", "<cmd> w <cr>")

View file

@ -0,0 +1,6 @@
require "nvchad.options"
-- add yours here!
-- local o = vim.o
-- o.cursorlineopt ='both' -- to enable cursorline!

View file

@ -0,0 +1,42 @@
return {
{
"stevearc/conform.nvim",
-- event = 'BufWritePre', -- uncomment for format on save
opts = require "configs.conform",
},
-- These are some examples, uncomment them if you want to see them work!
{
"neovim/nvim-lspconfig",
config = function()
require "configs.lspconfig"
end,
},
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
"vim", "lua", "vimdoc",
"html", "css"
},
},
},
{ 'nvim-telescope/telescope-fzf-native.nvim', build = 'make', lazy = false, },
{ 'nvim-telescope/telescope-project.nvim', lazy = false, },
{ 'natecraddock/workspaces.nvim', lazy = false, },
{
"NeogitOrg/neogit",
lazy = false,
dependencies = {
"nvim-lua/plenary.nvim", -- required
"sindrets/diffview.nvim", -- optional - Diff integration
-- Only one of these is needed.
"nvim-telescope/telescope.nvim", -- optional
},
config = true
},
}

View file

@ -0,0 +1,70 @@
local M = {}
M.base_30 = {
white = "#{{base07-hex}}",
darker_black = "#{{base00-hex}}",
black = "#{{base00-hex}}", -- nvim bg
black2 = "#{{base01-hex}}",
one_bg = "#{{base01-hex}}",
one_bg2 = "#{{base02-hex}}",
one_bg3 = "#{{base03-hex}}",
grey = "#{{base04-hex}}",
grey_fg = "#{{base04-hex}}",
grey_fg2 = "#{{base05-hex}}",
light_grey = "#{{base06-hex}}",
red = "#{{base08-hex}}",
baby_pink = "#{{base08-hex}}",
pink = "#{{base08-hex}}",
line = "#{{base02-hex}}", -- for lines like vertsplit
green = "#{{base0B-hex}}",
vibrant_green = "#{{base0B-hex}}",
blue = "#{{base0D-hex}}",
nord_blue = "#{{base0D-hex}}",
yellow = "#{{base0A-hex}}",
sun = "#{{base0A-hex}}",
purple = "#{{base0E-hex}}",
dark_purple = "#{{base0E-hex}}",
teal = "#{{base0C-hex}}",
orange = "#{{base09-hex}}",
cyan = "#{{base0C-hex}}",
statusline_bg = "#{{base02-hex}}",
lightbg = "#{{base03-hex}}",
pmenu_bg = "#{{base0D-hex}}",
folder_bg = "#{{base05-hex}}",
}
M.base_16 = {
base00 = "#{{base00-hex}}",
base01 = "#{{base01-hex}}",
base02 = "#{{base02-hex}}",
base03 = "#{{base03-hex}}",
base04 = "#{{base04-hex}}",
base05 = "#{{base05-hex}}",
base06 = "#{{base06-hex}}",
base07 = "#{{base07-hex}}",
base08 = "#{{base08-hex}}",
base09 = "#{{base09-hex}}",
base0A = "#{{base0A-hex}}",
base0B = "#{{base0B-hex}}",
base0C = "#{{base0C-hex}}",
base0D = "#{{base0D-hex}}",
base0E = "#{{base0E-hex}}",
base0F = "#{{base0F-hex}}",
}
M.polish_hl = {
treesitter = {
luaTSField = { fg = M.base_16.base0D },
["@tag.delimiter"] = { fg = M.base_30.cyan },
["@function"] = { fg = M.base_30.orange },
["@variable.parameter"] = { fg = M.base_16.base0F },
["@constructor"] = { fg = M.base_16.base0A },
["@tag.attribute"] = { fg = M.base_30.orange },
},
}
M = require("base46").override_theme(M, "stylix")
M.type = "{{polarity}}"
return M