added nvim
This commit is contained in:
parent
b4cea704b1
commit
ceb2b07353
9 changed files with 195 additions and 0 deletions
21
config/.config/nvim/lua/custom/chadrc.lua
Normal file
21
config/.config/nvim/lua/custom/chadrc.lua
Normal 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
|
22
config/.config/nvim/lua/custom/highlights.lua
Normal file
22
config/.config/nvim/lua/custom/highlights.lua
Normal 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
|
7
config/.config/nvim/lua/custom/init.lua
Normal file
7
config/.config/nvim/lua/custom/init.lua
Normal 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 =",
|
||||
-- })
|
12
config/.config/nvim/lua/custom/mappings.lua
Normal file
12
config/.config/nvim/lua/custom/mappings.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
---@type MappingsConfig
|
||||
local M = {}
|
||||
|
||||
M.general = {
|
||||
n = {
|
||||
[";"] = { ":", "enter command mode", opts = { nowait = true } },
|
||||
},
|
||||
}
|
||||
|
||||
-- more keybinds!
|
||||
|
||||
return M
|
49
config/.config/nvim/lua/custom/plugins/init.lua
Normal file
49
config/.config/nvim/lua/custom/plugins/init.lua
Normal 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
|
13
config/.config/nvim/lua/custom/plugins/lspconfig.lua
Normal file
13
config/.config/nvim/lua/custom/plugins/lspconfig.lua
Normal 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
|
25
config/.config/nvim/lua/custom/plugins/null-ls.lua
Normal file
25
config/.config/nvim/lua/custom/plugins/null-ls.lua
Normal 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,
|
||||
}
|
44
config/.config/nvim/lua/custom/plugins/overrides.lua
Normal file
44
config/.config/nvim/lua/custom/plugins/overrides.lua
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue