added nvim

This commit is contained in:
Stefen Auris 2023-02-16 15:30:51 -05:00
parent b4cea704b1
commit ceb2b07353
9 changed files with 195 additions and 0 deletions

View file

@ -0,0 +1,21 @@
---@type ChadrcConfig
local M = {}
-- Path to overriding theme and highlights files
local highlights = require "custom.highlights"
M.ui = {
theme_toggle = { "onedark", "one_light" },
theme = "onedark",
hl_override = highlights.override,
hl_add = highlights.add,
transparency = false,
}
M.plugins = require "custom.plugins"
-- check core.mappings for table structure
M.mappings = require "custom.mappings"
return M

View file

@ -0,0 +1,22 @@
-- To find any highlight groups: "<cmd> Telescope highlights"
-- Each highlight group can take a table with variables fg, bg, bold, italic, etc
-- base30 variable names can also be used as colors
local M = {}
---@type HLTable
M.override = {
CursorLine = {
bg = "black2",
},
Comment = {
italic = true,
},
}
---@type HLTable
M.add = {
NvimTreeOpenedFolderName = { fg = "green", bold = true },
}
return M

View file

@ -0,0 +1,7 @@
local autocmd = vim.api.nvim_create_autocmd
-- Auto resize panes when resizing nvim window
-- autocmd("VimResized", {
-- pattern = "*",
-- command = "tabdo wincmd =",
-- })

View file

@ -0,0 +1,12 @@
---@type MappingsConfig
local M = {}
M.general = {
n = {
[";"] = { ":", "enter command mode", opts = { nowait = true } },
},
}
-- more keybinds!
return M

View file

@ -0,0 +1,49 @@
local overrides = require "custom.plugins.overrides"
---@type {[PluginName]: NvPluginConfig|false}
local plugins = {
-- ["goolord/alpha-nvim"] = { disable = false } -- enables dashboard
-- Override plugin definition options
["neovim/nvim-lspconfig"] = {
config = function()
require "plugins.configs.lspconfig"
require "custom.plugins.lspconfig"
end,
},
-- overrde plugin configs
["nvim-treesitter/nvim-treesitter"] = {
override_options = overrides.treesitter,
},
["williamboman/mason.nvim"] = {
override_options = overrides.mason,
},
["nvim-tree/nvim-tree.lua"] = {
override_options = overrides.nvimtree,
},
-- Install a plugin
["max397574/better-escape.nvim"] = {
event = "InsertEnter",
config = function()
require("better_escape").setup()
end,
},
-- code formatting, linting etc
["jose-elias-alvarez/null-ls.nvim"] = {
after = "nvim-lspconfig",
config = function()
require "custom.plugins.null-ls"
end,
},
-- remove plugin
-- ["hrsh7th/cmp-path"] = false,
}
return plugins

View file

@ -0,0 +1,13 @@
local on_attach = require("plugins.configs.lspconfig").on_attach
local capabilities = require("plugins.configs.lspconfig").capabilities
local lspconfig = require "lspconfig"
local servers = { "html", "cssls", "tsserver", "clangd" }
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = on_attach,
capabilities = capabilities,
}
end

View file

@ -0,0 +1,25 @@
local present, null_ls = pcall(require, "null-ls")
if not present then
return
end
local b = null_ls.builtins
local sources = {
-- webdev stuff
b.formatting.deno_fmt, -- choosed deno for ts/js files cuz its very fast!
b.formatting.prettier.with { filetypes = { "html", "markdown", "css" } }, -- so prettier works only on these filetypes
-- Lua
b.formatting.stylua,
-- cpp
b.formatting.clang_format,
}
null_ls.setup {
debug = true,
sources = sources,
}

View file

@ -0,0 +1,44 @@
local M = {}
M.treesitter = {
ensure_installed = {
"vim",
"lua",
"html",
"css",
"javascript",
"c",
},
}
M.mason = {
ensure_installed = {
-- lua stuff
"lua-language-server",
"stylua",
-- web dev stuff
"css-lsp",
"html-lsp",
"typescript-language-server",
"deno",
},
}
-- git support in nvimtree
M.nvimtree = {
git = {
enable = true,
},
renderer = {
highlight_git = true,
icons = {
show = {
git = true,
},
},
},
}
return M