16 Commits
Author SHA1 Message Date
siduck 44a24e2fe5 update nvterm repo author 2024-03-19 06:27:33 +05:30
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 BrayandGitHub 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 https://github.com/NvChad/example_config/commit/a321ba986da839dc82eec52d072f1c16737d63b8
2024-01-06 21:00:58 +05:30
Zohir BenghalemandGitHub c2ec317b1b remove unnecessary lines (#2586) 2024-01-02 21:15:03 +05:30
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
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
6 changed files with 49 additions and 61 deletions
-8
View File
@@ -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
+27 -1
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
+4 -4
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,
+1 -10
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
+1 -1
View File
@@ -1,5 +1,5 @@
local options = {
ensure_installed = { "lua" },
ensure_installed = { "lua", "vim", "vimdoc" },
highlight = {
enable = true,
+9 -30
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()
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"