65 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
Gean MarroquinandGitHub 9d37797e6f remove Search, IncSearch and CurSearch highlights from cmp windows (#2490) 2023-11-13 09:57:03 +05:30
莊加旭 (Max Chuang)andGitHub ff99797242 fix typo (#2483) 2023-11-08 16:06:16 +05:30
Panos SakkosandGitHub a8413849cf Ignore .DS_Store files (#2463)
Ignores macos .DS_Store files
2023-10-27 06:03:43 +05:30
TheFedaikinandGitHub fd10af115e feat(mappings): make <esc> a cmd to remove flickering (#2456) 2023-10-22 18:22:38 +05:30
umlx5handGitHub c56f1242df Add CTRL-w key to whichkey lazyloading (#2446) 2023-10-16 20:06:34 +05:30
KorigamiKandGitHub 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 RathodandGitHub 195fe4ae72 Rm outdated info in readme 2023-09-28 11:33:45 +05:30
Al BerezandGitHub 3091ea5835 Keep visual selection when indent (#2382)
When user indent visually selected text with `>>` or `<<` this change will keep visual selection.
2023-09-16 11:48:10 +05:30
siduck 215aa2bb2f Revert "rm useless luasnip calls"
This reverts commit de85977316.
2023-09-11 14:47:45 +05:30
Zohir BenghalemandGitHub 617dca4dc1 add fzf telescope extension to improve sorting performance (#2371)
* add fzf telescope extension to improve sorting performance

* add fzf config tbl to the default tlsc config
2023-09-09 06:43:28 +05:30
siduck de85977316 rm useless luasnip calls 2023-09-08 06:11:49 +05:30
siduck 456ae88fad include MasonUpdate cmd for mason.nvim lazyloading
https://github.com/NvChad/ui/commit/5344b81e5e30edd930072cccd4ccbf6e88756a86 , so we dont need to specifically load mason in updater
2023-09-07 21:32:07 +05:30
camel_caseandGitHub a69e8dc591 feat(lsp): add visual mode code actions (#2353) 2023-09-02 17:00:02 +05:30
Diogo SilvaandGitHub a9bc954d02 refactor: gen chadrc template (#2349) 2023-08-31 05:58:07 +05:30
siduck 3f1e6d71d4 make whichkey lazyloadable by its cmd | fix #2342 2023-08-27 11:28:56 +05:30
PaulandGitHub 9c013a6aac updated lazygit keys for which-key plugin (#2331) 2023-08-24 16:26:22 +05:30
siduck d3d9aa251a rm config func from UI plugin spec
cuz the code will be loaded in the plugin/init.lua file of UI repo
2023-08-10 11:09:25 +05:30
siduck 46a61073a8 clean up 2023-08-09 20:29:50 +05:30
siduck 8ea74bc23b update some module paths 2023-08-09 20:22:46 +05:30
siduck 487ca44566 update icon paths 2023-08-09 08:51:40 +05:30
PaulandGitHub 05f581918a feat: added .ignore file (#2271)
Added .ignore file. So telescope doesn't ignore the custom folder.
2023-08-09 05:50:53 +05:30
siduck 6766acefec dont disable editor config with lazy_nvim 2023-08-06 21:52:08 +05:30
siduck 0e27cb4b44 dont reload tabufline if its disabled #2236 2023-07-26 09:58:01 +05:30
siduck 682b023fb3 make tabufline reloadable 2023-07-26 06:56:56 +05:30
A.S.KandGitHub f18488d41c feat: ignore after folder (#2228) 2023-07-24 10:01:21 +05:30
NandGitHub 720d71b546 Update README.md (#2194)
Corrected typos and improved grammar
2023-07-09 05:09:33 +05:30
siduck 08f3deb901 temporarily revert blankline to stable version #2189 2023-07-07 05:05:50 +05:30
James WrightandGitHub 3500e7388d Catch errors from shell calls (#2188) 2023-07-06 22:12:33 +05:30
MandGitHub 83aac1ecc0 fix: wildcard pattern usage in fs_realpath (#2152) 2023-07-02 16:22:52 +05:30
siduck 10b668d98a make formatting mapping <leader>fm as general mapping #2167
so its available even if an actual lsp isnt attached to the buffer
2023-06-29 05:18:18 +05:30
georgejeanandGitHub 286c951d7b fix: make key mapping's description to lazy load Comment.nvim coherent with the defaults (#2148) 2023-06-24 06:49:07 +05:30
georgejeanandGitHub 4aa283119a Fix too long descriptions for Comment.nvim's key mapping and add g key to trigger which-key (#2145) 2023-06-23 04:59:57 +05:30
georgejeanandGitHub 212bb9a66f Improved keys property for Comment.vim (#2144) 2023-06-22 22:16:20 +05:30
11c839f870 Defaulting to not installing custom config in --headless mode (#2132)
* Defaulting to not installing custom config in --headless mode

* Update bootstrap.lua

---------

Co-authored-by: siduck <siduck@tutanota.com>
2023-06-18 18:21:36 +05:30
Simone FidanzaandGitHub d3433e3c55 feat: ignore syntax folder (#2124) 2023-06-16 14:44:50 +05:30
siduck 8ba64ff369 custom config reload: support symlinks https://github.com/NvChad/base46/issues/177
huge thanks to @lucario387 for helping me
2023-06-15 10:11:43 +05:30
e3bb39106e Fix default mappings not load if chadrc.lua does not exist (#2037)
* Fix default mappings not load if chadrc.lua does not exist

The regression was introduced by dab9171e64

Fix #1961 #2025

* clean up!

---------

Co-authored-by: siduck <siduck@tutanota.com>
2023-06-15 08:03:01 +05:30
anesandSidhanth Rathod a18d92dfa6 Update README.md 2023-06-14 05:43:00 +05:30
siduck d73d155287 disable semantic tokens only if the LSP supports it 2023-06-11 19:52:47 +05:30
Sidhanth RathodandGitHub 27992efc1c Merge pull request #2031 from TirtharajPramanik/patch-1
update mason  binaries path in vim.env ( fixes rust_analyzyer bin not found )
2023-06-10 13:15:14 +05:30
Sidhanth RathodandGitHub 1d26f9dc50 Merge pull request #2097 from azuwis/telescope
telescope: Explicitly depend on nvim-treesitter
2023-06-10 08:54:52 +05:30
Zhong Jianxin c2a0bb1684 telescope: Explicitly depend on nvim-treesitter
Fix Telescope syntax highlighting is not working until open a file
https://github.com/NvChad/NvChad/issues/2084
2023-06-08 09:42:21 +08:00
c3c349c830 Change cmp to insert completion instead of replacing the current word (#2083)
I find this annoying and if we want to actually delete the word we can simply just dw in vim

Co-authored-by: andré Jesus <andréjesusdebrito@gmail.com>
2023-06-08 05:21:39 +05:30
siduck f8a489ea1a include editor config in lazy disabled_plugins list 2023-06-01 22:07:27 +05:30
georgejeanandGitHub d72d935b35 Fix deprecated highlight config for gitsigns (#2078) 2023-06-01 21:39:14 +05:30
Martin BraunandGitHub 9c10201ef3 Fix Comment.nvim not lazyloading from visual mode (#2067) 2023-05-29 19:32:33 +05:30
Fiete BörnerandGitHub 582dff9458 allow to override default config of comment.nvim (#2045) 2023-05-23 08:44:14 +05:30
Tirtharaj PramanikandGitHub 914f9a400e Update init.lua
Putting `.../mason/bin/` in the beginning of `vim.env.PATH`
2023-05-17 02:14:15 +05:30
14 changed files with 140 additions and 114 deletions
+4 -5
View File
@@ -15,7 +15,7 @@
<div align="center">
[![Neovim Minimum Version](https://img.shields.io/badge/Neovim-0.8.3-blueviolet.svg?style=flat-square&logo=Neovim&color=90E59A&logoColor=white)](https://github.com/neovim/neovim)
[![Neovim Minimum Version](https://img.shields.io/badge/Neovim-0.9.0-blueviolet.svg?style=flat-square&logo=Neovim&color=90E59A&logoColor=white)](https://github.com/neovim/neovim)
[![GitHub Issues](https://img.shields.io/github/issues/NvChad/NvChad.svg?style=flat-square&label=Issues&color=d77982)](https://github.com/NvChad/NvChad/issues)
[![Discord](https://img.shields.io/discord/869557815780470834?color=738adb&label=Discord&logo=discord&logoColor=white&style=flat-square)](https://discord.gg/gADmkJb9Fb)
[![Matrix](https://img.shields.io/badge/Matrix-40aa8b.svg?style=flat-square&logo=Matrix&logoColor=white)](https://matrix.to/#/#nvchad:matrix.org)
@@ -37,7 +37,7 @@
- Lazy loading is done 93% of the time meaning that plugins will not be loaded by default, they will be loaded only when required also at specific commands, events etc. This lowers the startuptime and it was like 0.07~ secs tested on an old pentium machine 1.4ghz + 4gb ram & HDD.
- NvChad isnt a framework! Its supposed to be used as a "base" config, so users could tweak the defaults well, can also remove the things they dont like in the default config and build their config on top of it. Users can tweak the entire default config while staying in their custom config (lua/custom dir). This is the control center of the user's config and gitignored so the users can stay update to-date with NvChad's latest config (main branch) while still controlling it with their chadrc (file that controls entire custom dir)
- NvChad isn't a framework! It's supposed to be used as a "base" config, so users can tweak the defaults well, and also remove the things they don't like in the default config and build their config on top of it. Users can tweak the entire default config while staying in their custom config (lua/custom dir). This is the control center of the user's config and gitignored so the users can stay up-to-date with NvChad's latest config (main branch) while still controlling it with their chadrc (file that controls entire custom dir).
## Theme Showcase
@@ -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)
+3
View File
@@ -2,6 +2,9 @@ plugin
custom
spell
ftplugin
syntax
coc-settings.json
.luarc.json
lazy-lock.json
after
**/.DS_Store
+1
View File
@@ -0,0 +1 @@
!/lua/custom/
+17 -17
View File
@@ -1,18 +1,24 @@
local M = {}
local fn = vim.fn
M.echo = function(str)
vim.cmd "redraw"
vim.api.nvim_echo({ { str, "Bold" } }, true, {})
end
local function shell_call(args)
local output = fn.system(args)
assert(vim.v.shell_error == 0, "External call failed with error code: " .. vim.v.shell_error .. "\n" .. output)
end
M.lazy = function(install_path)
------------- base46 ---------------
local lazy_path = vim.fn.stdpath "data" .. "/lazy/base46"
local lazy_path = fn.stdpath "data" .. "/lazy/base46"
M.echo " Compiling base46 theme to bytecode ..."
local base46_repo = "https://github.com/NvChad/base46"
vim.fn.system { "git", "clone", "--depth", "1", "-b", "v2.0", base46_repo, lazy_path }
shell_call { "git", "clone", "--depth", "1", "-b", "v2.0", base46_repo, lazy_path }
vim.opt.rtp:prepend(lazy_path)
require("base46").compile()
@@ -20,32 +26,26 @@ M.lazy = function(install_path)
--------- lazy.nvim ---------------
M.echo " Installing lazy.nvim & plugins ..."
local repo = "https://github.com/folke/lazy.nvim.git"
vim.fn.system { "git", "clone", "--filter=blob:none", "--branch=stable", repo, install_path }
shell_call { "git", "clone", "--filter=blob:none", "--branch=stable", repo, install_path }
vim.opt.rtp:prepend(install_path)
-- install plugins
require "plugins"
-- mason packages & show post_boostrap screen
require "nvchad.post_bootstrap"()
-- mason packages & show post_bootstrap screen
require "nvchad.post_install"()
end
M.gen_chadrc_template = function()
if not vim.api.nvim_get_runtime_file("lua/custom/chadrc.lua", false)[1] then
local path = vim.fn.stdpath "config" .. "/lua/custom/"
local input = vim.fn.input "Do you want to install example custom config? (y/N) : "
local path = fn.stdpath "config" .. "/lua/custom"
-- clone example_config repo
if input == "y" then
M.echo "cloning example custom config repo ..."
vim.fn.system { "git", "clone", "--depth", "1", "https://github.com/NvChad/example_config", path }
vim.fn.delete(path .. ".git", "rf")
else
if fn.isdirectory(path) ~= 1 then
-- use very minimal chadrc
vim.fn.mkdir(path, "p")
fn.mkdir(path, "p")
local file = io.open(path .. "chadrc.lua", "w")
file:write "---@type ChadrcConfig \n local M = {}\n M.ui = {theme = 'onedark'}\n return M"
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
+1 -1
View File
@@ -87,6 +87,6 @@ M.plugins = "" -- path i.e "custom.plugins", so make custom/plugins.lua file
M.lazy_nvim = require "plugins.configs.lazy_nvim" -- config for lazy.nvim startup options
M.mappings = {}
M.mappings = require "core.mappings"
return M
+41 -10
View File
@@ -57,8 +57,8 @@ 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"
vim.env.PATH = vim.env.PATH .. (is_windows and ";" or ":") .. vim.fn.stdpath "data" .. "/mason/bin"
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 ------------------------------------------
local autocmd = vim.api.nvim_create_autocmd
@@ -72,11 +72,10 @@ autocmd("FileType", {
})
-- reload some chadrc options on-save
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = vim.tbl_map(
vim.fs.normalize,
vim.fn.glob(vim.fn.stdpath "config" .. "/lua/custom/**/*.lua", true, true, true)
),
autocmd("BufWritePost", {
pattern = vim.tbl_map(function(path)
return vim.fs.normalize(vim.loop.fs_realpath(path))
end, vim.fn.glob(vim.fn.stdpath "config" .. "/lua/custom/**/*.lua", true, true, true)),
group = vim.api.nvim_create_augroup("ReloadNvChad", {}),
callback = function(opts)
@@ -94,17 +93,49 @@ vim.api.nvim_create_autocmd("BufWritePost", {
vim.g.transparency = config.ui.transparency
-- statusline
require("plenary.reload").reload_module("nvchad_ui.statusline." .. config.ui.statusline.theme)
vim.opt.statusline = "%!v:lua.require('nvchad_ui.statusline." .. config.ui.statusline.theme .. "').run()"
require("plenary.reload").reload_module("nvchad.statusline." .. config.ui.statusline.theme)
vim.opt.statusline = "%!v:lua.require('nvchad.statusline." .. config.ui.statusline.theme .. "').run()"
-- tabufline
if config.ui.tabufline.enabled then
require("plenary.reload").reload_module "nvchad.tabufline.modules"
vim.opt.tabline = "%!v:lua.require('nvchad.tabufline.modules').run()"
end
require("base46").load_all_highlights()
-- vim.cmd("redraw!")
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
new_cmd("NvChadUpdate", function()
require "nvchad.update"()
require "nvchad.updater"()
end, {})
+26 -15
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" },
@@ -45,6 +45,13 @@ M.general = {
-- new buffer
["<leader>b"] = { "<cmd> enew <CR>", "New buffer" },
["<leader>ch"] = { "<cmd> NvCheatsheet <CR>", "Mapping cheatsheet" },
["<leader>fm"] = {
function()
vim.lsp.buf.format { async = true }
end,
"LSP formatting",
},
},
t = {
@@ -54,6 +61,8 @@ M.general = {
v = {
["<Up>"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', "Move up", opts = { expr = true } },
["<Down>"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', "Move down", opts = { expr = true } },
["<"] = { "<gv", "Indent line" },
[">"] = { ">gv", "Indent line" },
},
x = {
@@ -72,14 +81,14 @@ M.tabufline = {
-- cycle through buffers
["<tab>"] = {
function()
require("nvchad_ui.tabufline").tabuflineNext()
require("nvchad.tabufline").tabuflineNext()
end,
"Goto next buffer",
},
["<S-tab>"] = {
function()
require("nvchad_ui.tabufline").tabuflinePrev()
require("nvchad.tabufline").tabuflinePrev()
end,
"Goto prev buffer",
},
@@ -87,7 +96,7 @@ M.tabufline = {
-- close buffer + hide terminal buffer
["<leader>x"] = {
function()
require("nvchad_ui.tabufline").close_buffer()
require("nvchad.tabufline").close_buffer()
end,
"Close buffer",
},
@@ -165,7 +174,7 @@ M.lspconfig = {
["<leader>ra"] = {
function()
require("nvchad_ui.renamer").open()
require("nvchad.renamer").open()
end,
"LSP rename",
},
@@ -184,7 +193,7 @@ M.lspconfig = {
"LSP references",
},
["<leader>f"] = {
["<leader>lf"] = {
function()
vim.diagnostic.open_float { border = "rounded" }
end,
@@ -193,14 +202,14 @@ M.lspconfig = {
["[d"] = {
function()
vim.diagnostic.goto_prev({ float = { border = "rounded" }})
vim.diagnostic.goto_prev { float = { border = "rounded" } }
end,
"Goto prev",
},
["]d"] = {
function()
vim.diagnostic.goto_next({ float = { border = "rounded" }})
vim.diagnostic.goto_next { float = { border = "rounded" } }
end,
"Goto next",
},
@@ -212,13 +221,6 @@ M.lspconfig = {
"Diagnostic setloclist",
},
["<leader>fm"] = {
function()
vim.lsp.buf.format { async = true }
end,
"LSP formatting",
},
["<leader>wa"] = {
function()
vim.lsp.buf.add_workspace_folder()
@@ -240,6 +242,15 @@ M.lspconfig = {
"List workspace folders",
},
},
v = {
["<leader>ca"] = {
function()
vim.lsp.buf.code_action()
end,
"LSP code action",
},
},
}
M.nvimtree = {
+2 -2
View File
@@ -8,11 +8,11 @@ M.load_config = function()
if chadrc_path then
local chadrc = dofile(chadrc_path)
config.mappings = M.remove_disabled_keys(chadrc.mappings, require "core.mappings")
config.mappings = M.remove_disabled_keys(chadrc.mappings, config.mappings)
config = merge_tb("force", config, chadrc)
config.mappings.disabled = nil
end
config.mappings.disabled = nil
return config
end
+4 -4
View File
@@ -15,7 +15,7 @@ local formatting_style = {
fields = field_arrangement[cmp_style] or { "abbr", "kind", "menu" },
format = function(_, item)
local icons = require("nvchad_ui.icons").lspkind
local icons = require "nvchad.icons.lspkind"
local icon = (cmp_ui.icons and icons[item.kind]) or ""
if cmp_style == "atom" or cmp_style == "atom_colored" then
@@ -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 = {
@@ -76,8 +76,8 @@ local options = {
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.close(),
["<CR>"] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select = false,
behavior = cmp.ConfirmBehavior.Insert,
select = true,
},
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
+8 -8
View File
@@ -1,22 +1,21 @@
dofile(vim.g.base46_cache .. "lsp")
require "nvchad_ui.lsp"
require "nvchad.lsp"
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_ui.signature").setup(client)
require("nvchad.signature").setup(client)
end
end
if not utils.load_config().ui.lsp_semantic_tokens then
-- 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
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,
@@ -54,7 +54,7 @@ require("lspconfig").lua_ls.setup {
library = {
[vim.fn.expand "$VIMRUNTIME/lua"] = true,
[vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true,
[vim.fn.stdpath "data" .. "/lazy/extensions/nvchad_types"] = true,
[vim.fn.stdpath "data" .. "/lazy/ui/nvchad_types"] = true,
[vim.fn.stdpath "data" .. "/lazy/lazy.nvim/lua/lazy"] = true,
},
maxPreload = 100000,
+6 -6
View File
@@ -51,12 +51,12 @@ end
M.gitsigns = {
signs = {
add = { hl = "DiffAdd", text = "", numhl = "GitSignsAddNr" },
change = { hl = "DiffChange", text = "", numhl = "GitSignsChangeNr" },
delete = { hl = "DiffDelete", text = "󰍵", numhl = "GitSignsDeleteNr" },
topdelete = { hl = "DiffDelete", text = "", numhl = "GitSignsDeleteNr" },
changedelete = { hl = "DiffChangeDelete", text = "~", numhl = "GitSignsChangeNr" },
untracked = { hl = "GitSignsAdd", text = "", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" },
add = { text = "" },
change = { text = "" },
delete = { text = "󰍵" },
topdelete = { text = "" },
changedelete = { text = "~" },
untracked = { text = "" },
},
on_attach = function(bufnr)
utils.load_mappings("gitsigns", { buffer = bufnr })
-1
View File
@@ -21,7 +21,6 @@ local options = {
horizontal = {
prompt_position = "top",
preview_width = 0.55,
results_width = 0.8,
},
vertical = {
mirror = false,
+1 -1
View File
@@ -1,5 +1,5 @@
local options = {
ensure_installed = { "lua" },
ensure_installed = { "lua", "vim", "vimdoc" },
highlight = {
enable = true,
+24 -42
View File
@@ -4,9 +4,6 @@ local default_plugins = {
"nvim-lua/plenary.nvim",
-- nvchad plugins
{ "NvChad/extensions", branch = "v2.0" },
{
"NvChad/base46",
branch = "v2.0",
@@ -19,13 +16,10 @@ local default_plugins = {
"NvChad/ui",
branch = "v2.0",
lazy = false,
config = function()
require "nvchad_ui"
end,
},
{
"NvChad/nvterm",
"zbirenbaum/nvterm",
init = function()
require("core.utils").load_mappings "nvterm"
end,
@@ -37,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)
@@ -53,7 +45,7 @@ local default_plugins = {
{
"nvim-tree/nvim-web-devicons",
opts = function()
return { override = require("nvchad_ui.icons").devicons }
return { override = require "nvchad.icons.devicons" }
end,
config = function(_, opts)
dofile(vim.g.base46_cache .. "devicons")
@@ -63,9 +55,8 @@ local default_plugins = {
{
"lukas-reineke/indent-blankline.nvim",
init = function()
require("core.utils").lazy_load "indent-blankline.nvim"
end,
version = "2.20.7",
event = "User FilePost",
opts = function()
return require("plugins.configs.others").blankline
end,
@@ -78,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()
@@ -95,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,
@@ -123,7 +97,7 @@ local default_plugins = {
-- lsp stuff
{
"williamboman/mason.nvim",
cmd = { "Mason", "MasonInstall", "MasonInstallAll", "MasonUninstall", "MasonUninstallAll", "MasonLog" },
cmd = { "Mason", "MasonInstall", "MasonInstallAll", "MasonUpdate" },
opts = function()
return require "plugins.configs.mason"
end,
@@ -133,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
@@ -142,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,
@@ -200,12 +174,19 @@ local default_plugins = {
{
"numToStr/Comment.nvim",
keys = { "gcc", "gbc" },
keys = {
{ "gcc", mode = "n", desc = "Comment toggle current line" },
{ "gc", mode = { "n", "o" }, desc = "Comment toggle linewise" },
{ "gc", mode = "x", desc = "Comment toggle linewise (visual)" },
{ "gbc", mode = "n", desc = "Comment toggle current block" },
{ "gb", mode = { "n", "o" }, desc = "Comment toggle blockwise" },
{ "gb", mode = "x", desc = "Comment toggle blockwise (visual)" },
},
init = function()
require("core.utils").load_mappings "comment"
end,
config = function()
require("Comment").setup()
config = function(_, opts)
require("Comment").setup(opts)
end,
},
@@ -222,12 +203,12 @@ local default_plugins = {
config = function(_, opts)
dofile(vim.g.base46_cache .. "nvimtree")
require("nvim-tree").setup(opts)
vim.g.nvimtree_side = opts.view.side
end,
},
{
"nvim-telescope/telescope.nvim",
dependencies = { "nvim-treesitter/nvim-treesitter" },
cmd = "Telescope",
init = function()
require("core.utils").load_mappings "telescope"
@@ -250,10 +231,11 @@ local default_plugins = {
-- Only load whichkey after all the gui
{
"folke/which-key.nvim",
keys = { "<leader>", '"', "'", "`", "c", "v" },
keys = { "<leader>", "<c-r>", "<c-w>", '"', "'", "`", "c", "v", "g" },
init = function()
require("core.utils").load_mappings "whichkey"
end,
cmd = "WhichKey",
config = function(_, opts)
dofile(vim.g.base46_cache .. "whichkey")
require("which-key").setup(opts)