mirror of
https://github.com/NvChad/NvChad.git
synced 2025-06-22 00:00:05 -04:00
Compare commits
24 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
44a24e2fe5 | ||
|
1a98a451ea | ||
|
ccf6bc397f | ||
|
13cce81d99 | ||
|
8fe6a6560e | ||
|
0dcd8a91b6 | ||
|
e9f6957b99 | ||
|
8aec881517 | ||
|
f17e83010f | ||
|
282a23f446 | ||
|
c80f3f0501 | ||
|
c2ec317b1b | ||
|
2fedda14ed | ||
|
e121bde8d8 | ||
|
9bb7dcbaf4 | ||
|
c8777040fb | ||
|
9d37797e6f | ||
|
ff99797242 | ||
|
a8413849cf | ||
|
fd10af115e | ||
|
c56f1242df | ||
|
250a960698 | ||
|
13e9b0f458 | ||
|
195fe4ae72 |
5
.github/README.md
vendored
5
.github/README.md
vendored
@ -88,8 +88,7 @@ A fuzzy file finder, picker, sorter, previewer and much more:
|
||||
|
||||
- Many beautiful themes, theme toggler by our [base46 plugin](https://github.com/NvChad/base46)
|
||||
- Inbuilt terminal toggling & management with [Nvterm](https://github.com/NvChad/nvterm)
|
||||
- NvChad updater, hide & unhide terminal buffers with [NvChad extensions](https://github.com/NvChad/extensions)
|
||||
- Lightweight & performant ui plugin with [NvChad UI](https://github.com/NvChad/ui) It provides statusline modules, tabufline ( tabs + buffer manager) , beautiful cheatsheets and much more!
|
||||
- Lightweight & performant ui plugin with [NvChad UI](https://github.com/NvChad/ui) It provides statusline modules, tabufline ( tabs + buffer manager) , beautiful cheatsheets, NvChad updater, hide & unhide terminal buffers, theme switcher and much more!
|
||||
- File navigation with [nvim-tree.lua](https://github.com/kyazdani42/nvim-tree.lua)
|
||||
- Beautiful and configurable icons with [nvim-web-devicons](https://github.com/kyazdani42/nvim-web-devicons)
|
||||
- Git diffs and more with [gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim)
|
||||
@ -113,7 +112,7 @@ A fuzzy file finder, picker, sorter, previewer and much more:
|
||||
If you like NvChad and would like to support & appreciate it via donation then I'll gladly accept it.
|
||||
|
||||
[](https://ko-fi.com/siduck)
|
||||
[](https://paypal.me/siduck76)
|
||||
[](https://paypal.me/siduck13)
|
||||
[](https://www.buymeacoffee.com/siduck)
|
||||
[](https://www.patreon.com/siduck)
|
||||
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -7,3 +7,4 @@ coc-settings.json
|
||||
.luarc.json
|
||||
lazy-lock.json
|
||||
after
|
||||
**/.DS_Store
|
||||
|
@ -32,7 +32,7 @@ M.lazy = function(install_path)
|
||||
-- install plugins
|
||||
require "plugins"
|
||||
|
||||
-- mason packages & show post_boostrap screen
|
||||
-- mason packages & show post_bootstrap screen
|
||||
require "nvchad.post_install"()
|
||||
end
|
||||
|
||||
@ -40,13 +40,6 @@ M.gen_chadrc_template = function()
|
||||
local path = fn.stdpath "config" .. "/lua/custom"
|
||||
|
||||
if fn.isdirectory(path) ~= 1 then
|
||||
local input = fn.input "Do you want to install example custom config? (y/N): "
|
||||
|
||||
if input:lower() == "y" then
|
||||
M.echo "Cloning example custom config repo..."
|
||||
shell_call { "git", "clone", "--depth", "1", "https://github.com/NvChad/example_config", path }
|
||||
fn.delete(path .. "/.git", "rf")
|
||||
else
|
||||
-- use very minimal chadrc
|
||||
fn.mkdir(path, "p")
|
||||
|
||||
@ -56,7 +49,6 @@ M.gen_chadrc_template = function()
|
||||
file:close()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
@ -57,7 +57,7 @@ for _, provider in ipairs { "node", "perl", "python3", "ruby" } do
|
||||
end
|
||||
|
||||
-- add binaries installed by mason.nvim to path
|
||||
local is_windows = vim.loop.os_uname().sysname == "Windows_NT"
|
||||
local is_windows = vim.fn.has("win32") ~= 0
|
||||
vim.env.PATH = vim.fn.stdpath "data" .. "/mason/bin" .. (is_windows and ";" or ":") .. vim.env.PATH
|
||||
|
||||
-------------------------------------- autocmds ------------------------------------------
|
||||
@ -107,6 +107,32 @@ autocmd("BufWritePost", {
|
||||
end,
|
||||
})
|
||||
|
||||
-- user event that loads after UIEnter + only if file buf is there
|
||||
vim.api.nvim_create_autocmd({ "UIEnter", "BufReadPost", "BufNewFile" }, {
|
||||
group = vim.api.nvim_create_augroup("NvFilePost", { clear = true }),
|
||||
callback = function(args)
|
||||
local file = vim.api.nvim_buf_get_name(args.buf)
|
||||
local buftype = vim.api.nvim_buf_get_option(args.buf, "buftype")
|
||||
|
||||
if not vim.g.ui_entered and args.event == "UIEnter" then
|
||||
vim.g.ui_entered = true
|
||||
end
|
||||
|
||||
if file ~= "" and buftype ~= "nofile" and vim.g.ui_entered then
|
||||
vim.api.nvim_exec_autocmds("User", { pattern = "FilePost", modeline = false })
|
||||
vim.api.nvim_del_augroup_by_name "NvFilePost"
|
||||
|
||||
vim.schedule(function()
|
||||
vim.api.nvim_exec_autocmds("FileType", {})
|
||||
|
||||
if vim.g.editorconfig then
|
||||
require("editorconfig").config(args.buf)
|
||||
end
|
||||
end, 0)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-------------------------------------- commands ------------------------------------------
|
||||
local new_cmd = vim.api.nvim_create_user_command
|
||||
|
||||
|
@ -16,7 +16,7 @@ M.general = {
|
||||
},
|
||||
|
||||
n = {
|
||||
["<Esc>"] = { ":noh <CR>", "Clear highlights" },
|
||||
["<Esc>"] = { "<cmd> noh <CR>", "Clear highlights" },
|
||||
-- switch between windows
|
||||
["<C-h>"] = { "<C-w>h", "Window left" },
|
||||
["<C-l>"] = { "<C-w>l", "Window right" },
|
||||
@ -193,7 +193,7 @@ M.lspconfig = {
|
||||
"LSP references",
|
||||
},
|
||||
|
||||
["<leader>f"] = {
|
||||
["<leader>lf"] = {
|
||||
function()
|
||||
vim.diagnostic.open_float { border = "rounded" }
|
||||
end,
|
||||
|
@ -52,7 +52,7 @@ local options = {
|
||||
window = {
|
||||
completion = {
|
||||
side_padding = (cmp_style ~= "atom" and cmp_style ~= "atom_colored") and 1 or 0,
|
||||
winhighlight = "Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel",
|
||||
winhighlight = "Normal:CmpPmenu,CursorLine:CmpSel,Search:None",
|
||||
scrollbar = false,
|
||||
},
|
||||
documentation = {
|
||||
|
@ -5,17 +5,16 @@ local M = {}
|
||||
local utils = require "core.utils"
|
||||
|
||||
-- export on_attach & capabilities for custom lspconfigs
|
||||
|
||||
M.on_attach = function(client, bufnr)
|
||||
client.server_capabilities.documentFormattingProvider = false
|
||||
client.server_capabilities.documentRangeFormattingProvider = false
|
||||
|
||||
utils.load_mappings("lspconfig", { buffer = bufnr })
|
||||
|
||||
if client.server_capabilities.signatureHelpProvider then
|
||||
require("nvchad.signature").setup(client)
|
||||
end
|
||||
end
|
||||
|
||||
-- disable semantic tokens
|
||||
M.on_init = function(client, _)
|
||||
if not utils.load_config().ui.lsp_semantic_tokens and client.supports_method "textDocument/semanticTokens" then
|
||||
client.server_capabilities.semanticTokensProvider = nil
|
||||
end
|
||||
@ -42,6 +41,7 @@ M.capabilities.textDocument.completion.completionItem = {
|
||||
}
|
||||
|
||||
require("lspconfig").lua_ls.setup {
|
||||
on_init = M.on_init,
|
||||
on_attach = M.on_attach,
|
||||
capabilities = M.capabilities,
|
||||
|
||||
|
@ -21,7 +21,6 @@ local options = {
|
||||
horizontal = {
|
||||
prompt_position = "top",
|
||||
preview_width = 0.55,
|
||||
results_width = 0.8,
|
||||
},
|
||||
vertical = {
|
||||
mirror = false,
|
||||
@ -49,15 +48,7 @@ local options = {
|
||||
},
|
||||
},
|
||||
|
||||
extensions_list = { "themes", "terms", "fzf" },
|
||||
extensions = {
|
||||
fzf = {
|
||||
fuzzy = true,
|
||||
override_generic_sorter = true,
|
||||
override_file_sorter = true,
|
||||
case_mode = "smart_case",
|
||||
},
|
||||
},
|
||||
extensions_list = { "themes", "terms" },
|
||||
}
|
||||
|
||||
return options
|
||||
|
@ -1,5 +1,5 @@
|
||||
local options = {
|
||||
ensure_installed = { "lua" },
|
||||
ensure_installed = { "lua", "vim", "vimdoc" },
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
|
@ -19,7 +19,7 @@ local default_plugins = {
|
||||
},
|
||||
|
||||
{
|
||||
"NvChad/nvterm",
|
||||
"zbirenbaum/nvterm",
|
||||
init = function()
|
||||
require("core.utils").load_mappings "nvterm"
|
||||
end,
|
||||
@ -31,9 +31,7 @@ local default_plugins = {
|
||||
|
||||
{
|
||||
"NvChad/nvim-colorizer.lua",
|
||||
init = function()
|
||||
require("core.utils").lazy_load "nvim-colorizer.lua"
|
||||
end,
|
||||
event = "User FilePost",
|
||||
config = function(_, opts)
|
||||
require("colorizer").setup(opts)
|
||||
|
||||
@ -58,9 +56,7 @@ local default_plugins = {
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
version = "2.20.7",
|
||||
init = function()
|
||||
require("core.utils").lazy_load "indent-blankline.nvim"
|
||||
end,
|
||||
event = "User FilePost",
|
||||
opts = function()
|
||||
return require("plugins.configs.others").blankline
|
||||
end,
|
||||
@ -73,9 +69,7 @@ local default_plugins = {
|
||||
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
init = function()
|
||||
require("core.utils").lazy_load "nvim-treesitter"
|
||||
end,
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
cmd = { "TSInstall", "TSBufEnable", "TSBufDisable", "TSModuleInfo" },
|
||||
build = ":TSUpdate",
|
||||
opts = function()
|
||||
@ -90,22 +84,7 @@ local default_plugins = {
|
||||
-- git stuff
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
ft = { "gitcommit", "diff" },
|
||||
init = function()
|
||||
-- load gitsigns only when a git file is opened
|
||||
vim.api.nvim_create_autocmd({ "BufRead" }, {
|
||||
group = vim.api.nvim_create_augroup("GitSignsLazyLoad", { clear = true }),
|
||||
callback = function()
|
||||
vim.fn.system("git -C " .. '"' .. vim.fn.expand "%:p:h" .. '"' .. " rev-parse")
|
||||
if vim.v.shell_error == 0 then
|
||||
vim.api.nvim_del_augroup_by_name "GitSignsLazyLoad"
|
||||
vim.schedule(function()
|
||||
require("lazy").load { plugins = { "gitsigns.nvim" } }
|
||||
end)
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
event = "User FilePost",
|
||||
opts = function()
|
||||
return require("plugins.configs.others").gitsigns
|
||||
end,
|
||||
@ -128,7 +107,9 @@ local default_plugins = {
|
||||
|
||||
-- custom nvchad cmd to install all mason binaries listed
|
||||
vim.api.nvim_create_user_command("MasonInstallAll", function()
|
||||
if opts.ensure_installed and #opts.ensure_installed > 0 then
|
||||
vim.cmd("MasonInstall " .. table.concat(opts.ensure_installed, " "))
|
||||
end
|
||||
end, {})
|
||||
|
||||
vim.g.mason_binaries_list = opts.ensure_installed
|
||||
@ -137,9 +118,7 @@ local default_plugins = {
|
||||
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
init = function()
|
||||
require("core.utils").lazy_load "nvim-lspconfig"
|
||||
end,
|
||||
event = "User FilePost",
|
||||
config = function()
|
||||
require "plugins.configs.lspconfig"
|
||||
end,
|
||||
@ -229,7 +208,7 @@ local default_plugins = {
|
||||
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter", { "nvim-telescope/telescope-fzf-native.nvim", build = "make" } },
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
||||
cmd = "Telescope",
|
||||
init = function()
|
||||
require("core.utils").load_mappings "telescope"
|
||||
@ -252,7 +231,7 @@ local default_plugins = {
|
||||
-- Only load whichkey after all the gui
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
keys = { "<leader>", "<c-r>", '"', "'", "`", "c", "v", "g" },
|
||||
keys = { "<leader>", "<c-r>", "<c-w>", '"', "'", "`", "c", "v", "g" },
|
||||
init = function()
|
||||
require("core.utils").load_mappings "whichkey"
|
||||
end,
|
||||
|
Loading…
x
Reference in New Issue
Block a user