Compare commits

...

24 Commits
v2.5 ... v2.0

Author SHA1 Message Date
siduck
44a24e2fe5 update nvterm repo author 2024-03-19 06:27:33 +05:30
Pablo Rodriguez
1a98a451ea
fix: Better approach to check if the system is Windows before setting PATH (#2690)
* Better approach to check if the system is Windows

Now the check for Windows doesn't depend on luv's os_uname() function, which may have a different result if neovim was built on different compilers (MSVC, MinGW, etc).

* remove un-needed parenthesis

---------

Co-authored-by: Sidhanth Rathod <siduck@tutanota.com>
2024-03-10 20:03:32 +05:30
siduck
ccf6bc397f rm reference for example_config in bootstrap 2024-03-10 08:55:15 +05:30
siduck
13cce81d99 disable semantic tokens in on_init & expose on_init 2024-03-05 07:53:19 +05:30
siduck
8fe6a6560e rm treesitter tag & fix #2697 2024-02-29 08:47:12 +05:30
Eduardo Bray
0dcd8a91b6
Remove Telescope unsupported layout_config key results_width (#2694) 2024-02-26 13:26:38 +05:30
siduck
e9f6957b99 add some vim* tsparsers in treesitter config 2024-02-26 05:35:58 +05:30
siduck
8aec881517 reload editorconfig on User FilePost event only if enabled #2672 2024-02-17 06:31:11 +05:30
siduck
f17e83010f fix editorConfig indent opts not applying on certain fts #2633 2024-01-28 21:40:04 +05:30
siduck
282a23f446 lock nvim-treesitter to stable version
there has been a breaking change with nvimtreesitter https://github.com/nvim-treesitter/nvim-treesitter/pull/5895 which needs renaming many of the hlgroups,its already done in the v3.0 branch of base46, cant directly merge to v2.0 so for a while you all will have to use the 0.9.2 version
2024-01-19 22:25:26 +05:30
siduck
c80f3f0501 Avoid disabling lsp formatting capabilities
this was used so we could use null-ls as default formatter but as its dead i have replaced it with conform in the example_config. check a321ba986d
2024-01-06 21:00:58 +05:30
Zohir Benghalem
c2ec317b1b
remove unnecessary lines (#2586) 2024-01-02 21:15:03 +05:30
Grigorii Khvatskii
2fedda14ed
Add support for non-interactive bootstrapping (#2528)
https://github.com/NvChad/NvChad/pull/2528#issuecomment-1834599074

---------

Co-authored-by: Sidhanth Rathod <siduck@tutanota.com>
2024-01-02 17:12:34 +05:30
siduck
e121bde8d8 check for empty/nil mason ensure_installed table #2580 2023-12-27 19:49:31 +05:30
siduck
9bb7dcbaf4 remove telescope fzf extension #2571 2023-12-24 16:31:08 +05:30
Vitor Boschi da Silva
c8777040fb
[feat] Make gitsigns init function async (#2538)
* [feat] Make gitsigns init function async

This function is running git and also initializing a shell, which can be
a relatively slow operation. By leveraging the jobs api, we run the
command in background, reducing the time it takes for the buffer to be
available to the user. It also uses the list format for the job, which
allow us to bypass the shell entirely.

* performance: use uv.cwd() instead of fn.expand 

benchmarked luv's cwd and it seems to be 20x faster than the expand function

---------

Co-authored-by: Sidhanth Rathod <siduck@tutanota.com>
2023-12-08 20:51:09 +05:30
Gean Marroquin
9d37797e6f
remove Search, IncSearch and CurSearch highlights from cmp windows (#2490) 2023-11-13 09:57:03 +05:30
莊加旭 (Max Chuang)
ff99797242
fix typo (#2483) 2023-11-08 16:06:16 +05:30
Panos Sakkos
a8413849cf
Ignore .DS_Store files (#2463)
Ignores macos .DS_Store files
2023-10-27 06:03:43 +05:30
TheFedaikin
fd10af115e
feat(mappings): make <esc> a cmd to remove flickering (#2456) 2023-10-22 18:22:38 +05:30
umlx5h
c56f1242df
Add CTRL-w key to whichkey lazyloading (#2446) 2023-10-16 20:06:34 +05:30
KorigamiK
250a960698
Fix unreachable mappings for the lsp (#2443) 2023-10-16 17:02:31 +05:30
siduck
13e9b0f458 rm outdated link from readme 2023-10-02 13:50:56 +05:30
Sidhanth Rathod
195fe4ae72
Rm outdated info in readme 2023-09-28 11:33:45 +05:30
10 changed files with 57 additions and 69 deletions

5
.github/README.md vendored
View File

@ -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.
[![kofi](https://img.shields.io/badge/Ko--fi-F16061?style=for-the-badge&logo=ko-fi&logoColor=white)](https://ko-fi.com/siduck)
[![paypal](https://img.shields.io/badge/PayPal-00457C?style=for-the-badge&logo=paypal&logoColor=white)](https://paypal.me/siduck76)
[![paypal](https://img.shields.io/badge/PayPal-00457C?style=for-the-badge&logo=paypal&logoColor=white)](https://paypal.me/siduck13)
[![buymeacoffee](https://img.shields.io/badge/Buy_Me_A_Coffee-FFDD00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black)](https://www.buymeacoffee.com/siduck)
[![patreon](https://img.shields.io/badge/Patreon-F96854?style=for-the-badge&logo=patreon&logoColor=white)](https://www.patreon.com/siduck)

1
.gitignore vendored
View File

@ -7,3 +7,4 @@ coc-settings.json
.luarc.json
lazy-lock.json
after
**/.DS_Store

View File

@ -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,21 +40,13 @@ 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): "
-- use very minimal chadrc
fn.mkdir(path, "p")
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")
local file = io.open(path .. "/chadrc.lua", "w")
if file then
file:write "---@type ChadrcConfig\nlocal M = {}\n\nM.ui = { theme = 'onedark' }\n\nreturn M"
file:close()
end
local file = io.open(path .. "/chadrc.lua", "w")
if file then
file:write "---@type ChadrcConfig\nlocal M = {}\n\nM.ui = { theme = 'onedark' }\n\nreturn M"
file:close()
end
end
end

View File

@ -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

View File

@ -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,

View File

@ -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 = {

View File

@ -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,

View File

@ -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

View File

@ -1,5 +1,5 @@
local options = {
ensure_installed = { "lua" },
ensure_installed = { "lua", "vim", "vimdoc" },
highlight = {
enable = true,

View File

@ -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()
vim.cmd("MasonInstall " .. table.concat(opts.ensure_installed, " "))
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,