Compare commits

...

66 Commits
v2.0 ... pt

Author SHA1 Message Date
baabb64d18 dont hide 2023-10-31 11:12:10 -04:00
a1703d00be merge with v2.0 2023-10-03 08:43:14 -04:00
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
Al Berez
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 Benghalem
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
5344b81e5e , so we dont need to specifically load mason in updater
2023-09-07 21:32:07 +05:30
camel_case
a69e8dc591
feat(lsp): add visual mode code actions (#2353) 2023-09-02 17:00:02 +05:30
Diogo Silva
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
Paul
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
Paul
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.K
f18488d41c
feat: ignore after folder (#2228) 2023-07-24 10:01:21 +05:30
N
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 Wright
3500e7388d
Catch errors from shell calls (#2188) 2023-07-06 22:12:33 +05:30
M
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
georgejean
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
georgejean
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
georgejean
212bb9a66f
Improved keys property for Comment.vim (#2144) 2023-06-22 22:16:20 +05:30
Max Chechel
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 Fidanza
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
Zhong Jianxin
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
anes
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 Rathod
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 Rathod
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
André Jesus
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
georgejean
d72d935b35
Fix deprecated highlight config for gitsigns (#2078) 2023-06-01 21:39:14 +05:30
Martin Braun
9c10201ef3
Fix Comment.nvim not lazyloading from visual mode (#2067) 2023-05-29 19:32:33 +05:30
Fiete Börner
582dff9458
allow to override default config of comment.nvim (#2045) 2023-05-23 08:44:14 +05:30
siduck
262a06776a change mapping for telescope marks 2023-05-18 18:15:51 +05:30
siduck
f6229b4b46 add mapping for telescope bookmarks (#2035) 2023-05-18 11:45:02 +05:30
siduck
1cb237fa78 rm outdated icons 2023-05-18 07:58:57 +05:30
siduck
c8a1aa2e2b use old dir icon for nvimtree
in nerdfonts v3.0 update this icon was removed! but they re-added it in v3.0.1, so everyone please update your font package :D
2023-05-18 05:35:36 +05:30
André Carneiro
a54e4e9272
chore: consistent border style when navigating diagnostics (#2033) 2023-05-18 05:31:36 +05:30
Tirtharaj Pramanik
914f9a400e
Update init.lua
Putting `.../mason/bin/` in the beginning of `vim.env.PATH`
2023-05-17 02:14:15 +05:30
Lexey Khom
699aeaa442
style(mappings): One style for descriptions (#2018)
* style(mappings.lua): Abbreviations in Upper case (like "LSP")

* style(mappings.lua): One description style - Sentence case

Only the first word of a sentence and proper nouns are capitalized,
with the rest of the words in lowercase.

* style(mappings.lua): Replase "_" to " " in descriptions
2023-05-13 15:28:50 +05:30
siduck
e1631629b9 disable LSPs inbuilt formatting by default | FIX (#2016)
We mostly use null-ls for the formatting but if our current lsp server supports formatting then the null-ls one wouldnt work and we would never get an error etc or prompt to use null-ls formatter which is scaryy!! so disabling the formatting on lsp server by default
2023-05-12 20:33:16 +05:30
4517485701 update glyphs to v2.0 2023-05-09 11:17:57 -04:00
841b45998e merge v2.0 2023-05-08 08:11:16 -04:00
6aef27028f add mapping for leader g d to do a diff, and dont add terminals 2023-04-25 15:02:27 -04:00
8a56de017a attempt to make hidden files findable in telescope 2023-04-07 19:59:09 -04:00
d0ea9296ac Merge branch 'v2.0' into pt 2023-04-06 12:09:06 -04:00
052c523466 make tabs 4 spaces 2023-04-06 12:08:24 -04:00
8a89abfc4f arrows move windows and JK move screen 2023-04-04 13:53:43 -04:00
f8e88fa96c Merge branch 'pt' of gitea.hptrow.me:pt/nvhcad into pt 2023-04-04 13:34:55 -04:00
2bc5b50420 ignore tmux logs 2023-04-04 13:33:20 -04:00
85add23ae3 .gitignore files while show as ghosted 2023-04-04 13:32:33 -04:00
02224ade77 Merge branch 'v2.0' of https://github.com/NvChad/NvChad into pt 2023-04-04 13:16:58 -04:00
9f97f2d4a1 Merge branch 'v2.0' of https://github.com/NvChad/NvChad into pt 2023-04-04 13:15:53 -04:00
df1af847b2 Merge branch 'v2.0' of https://github.com/NvChad/NvChad into pt 2023-04-02 02:06:22 -04:00
1c0a2345e0 show ignored diretories 2023-04-02 02:06:19 -04:00
15 changed files with 257 additions and 158 deletions

9
.github/README.md vendored
View File

@ -15,7 +15,7 @@
<div align="center"> <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) [![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) [![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) [![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. - 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 ## 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) - 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) - 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, NvChad updater, hide & unhide terminal buffers, theme switcher 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 and much more!
- File navigation with [nvim-tree.lua](https://github.com/kyazdani42/nvim-tree.lua) - 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) - 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) - 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. 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) [![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) [![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) [![patreon](https://img.shields.io/badge/Patreon-F96854?style=for-the-badge&logo=patreon&logoColor=white)](https://www.patreon.com/siduck)

2
.gitignore vendored
View File

@ -2,6 +2,8 @@ plugin
custom custom
spell spell
ftplugin ftplugin
syntax
coc-settings.json coc-settings.json
.luarc.json .luarc.json
lazy-lock.json lazy-lock.json
*.log

1
.ignore Normal file
View File

@ -0,0 +1 @@
!/lua/custom/

View File

@ -1,4 +1,5 @@
require "core" require "core"
vim.api.nvim_set_var('mapleader', ';')
local custom_init_path = vim.api.nvim_get_runtime_file("lua/custom/init.lua", false)[1] local custom_init_path = vim.api.nvim_get_runtime_file("lua/custom/init.lua", false)[1]
@ -19,3 +20,60 @@ end
dofile(vim.g.base46_cache .. "defaults") dofile(vim.g.base46_cache .. "defaults")
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
require "plugins" require "plugins"
-- Configure Telescope to scroll files with ctrl+j/k
local actions = require('telescope.actions')
local sorters = require('telescope.sorters')
require('telescope').setup {
defaults = {
mappings = {
i = {
["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous,
},
},
file_sorter = sorters.get_fzy_sorter,
file_ignore_patterns = { '.git/*', 'node_modules/*', 'vendor/*' },
generic_sorter = sorters.get_generic_fuzzy_sorter,
},
extensions = {
fzf = {
fuzzy = true,
override_generic_sorter = true,
override_file_sorter = true,
case_mode = "smart_case",
}
}
}
vim.api.nvim_set_keymap('n', '<leader>e', ':NvimTreeToggle<CR>', {noremap = true, silent = true})
-- Cycle through open buffers with leader+a
vim.api.nvim_set_keymap('n', '<leader>a', ':bprevious<CR>', {noremap = true, silent = true})
vim.api.nvim_set_keymap('n', '<leader>f', ':bnext<CR>', {noremap = true, silent = true})
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
-- move the whole page without moving the cursor
vim.api.nvim_set_keymap('n', 'J', '<C-e>', { noremap = true })
vim.api.nvim_set_keymap('n', 'K', '<C-y>', { noremap = true })
-- Resize windows
vim.api.nvim_set_keymap('n', '<Up>', '5<C-w>+', { silent = true })
vim.api.nvim_set_keymap('n', '<Down>', '5<C-w>-', { silent = true })
vim.api.nvim_set_keymap('n', '<Right>', '10<C-w>>', { silent = true })
vim.api.nvim_set_keymap('n', '<Left>', '10<C-w><', { silent = true })
-- Set the tab width to 4 spaces
vim.cmd('set tabstop=4')
vim.cmd('set shiftwidth=4')
vim.cmd('set expandtab')
vim.o.hidden = true
-- Git diffthis
vim.api.nvim_set_keymap('n', '<leader>gd', ':Gitsigns diffthis<CR>', {noremap = true, silent = true})

View File

@ -1,18 +1,24 @@
local M = {} local M = {}
local fn = vim.fn
M.echo = function(str) M.echo = function(str)
vim.cmd "redraw" vim.cmd "redraw"
vim.api.nvim_echo({ { str, "Bold" } }, true, {}) vim.api.nvim_echo({ { str, "Bold" } }, true, {})
end 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) M.lazy = function(install_path)
------------- base46 --------------- ------------- 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 ..." M.echo " Compiling base46 theme to bytecode ..."
local base46_repo = "https://github.com/NvChad/base46" 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) vim.opt.rtp:prepend(lazy_path)
require("base46").compile() require("base46").compile()
@ -20,33 +26,35 @@ M.lazy = function(install_path)
--------- lazy.nvim --------------- --------- lazy.nvim ---------------
M.echo " Installing lazy.nvim & plugins ..." M.echo " Installing lazy.nvim & plugins ..."
local repo = "https://github.com/folke/lazy.nvim.git" 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) vim.opt.rtp:prepend(install_path)
-- install plugins -- install plugins
require "plugins" require "plugins"
-- mason packages & show post_boostrap screen -- mason packages & show post_boostrap screen
require "nvchad.post_bootstrap"() require "nvchad.post_install"()
end end
M.gen_chadrc_template = function() M.gen_chadrc_template = function()
if not vim.api.nvim_get_runtime_file("lua/custom/chadrc.lua", false)[1] then local path = fn.stdpath "config" .. "/lua/custom"
local path = vim.fn.stdpath "config" .. "/lua/custom/"
local input = vim.fn.input "Do you want to install example custom config? (y/N) : "
-- clone example_config repo if fn.isdirectory(path) ~= 1 then
if input == "y" then local input = fn.input "Do you want to install example custom config? (y/N): "
M.echo "cloning example custom config repo ..."
vim.fn.system { "git", "clone", "--depth", "1", "https://github.com/NvChad/example_config", path } if input:lower() == "y" then
vim.fn.delete(path .. ".git", "rf") 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 else
-- use very minimal chadrc -- use very minimal chadrc
vim.fn.mkdir(path, "p") fn.mkdir(path, "p")
local file = io.open(path .. "chadrc.lua", "w") local file = io.open(path .. "/chadrc.lua", "w")
file:write "---@type ChadrcConfig \n local M = {}\n M.ui = {theme = 'onedark'}\n return M" if file then
file:close() file:write "---@type ChadrcConfig\nlocal M = {}\n\nM.ui = { theme = 'onedark' }\n\nreturn M"
file:close()
end
end end
end end
end end

View File

@ -64,9 +64,9 @@ M.ui = {
buttons = { buttons = {
{ " Find File", "Spc f f", "Telescope find_files" }, { " Find File", "Spc f f", "Telescope find_files" },
{ " Recent Files", "Spc f o", "Telescope oldfiles" }, { "󰈚 Recent Files", "Spc f o", "Telescope oldfiles" },
{ " Find Word", "Spc f w", "Telescope live_grep" }, { "󰈭 Find Word", "Spc f w", "Telescope live_grep" },
{ " Bookmarks", "Spc b m", "Telescope marks" }, { " Bookmarks", "Spc m a", "Telescope marks" },
{ " Themes", "Spc t h", "Telescope themes" }, { " Themes", "Spc t h", "Telescope themes" },
{ " Mappings", "Spc c h", "NvCheatsheet" }, { " Mappings", "Spc c h", "NvCheatsheet" },
}, },
@ -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.lazy_nvim = require "plugins.configs.lazy_nvim" -- config for lazy.nvim startup options
M.mappings = {} M.mappings = require "core.mappings"
return M return M

View File

@ -58,7 +58,7 @@ end
-- add binaries installed by mason.nvim to path -- add binaries installed by mason.nvim to path
local is_windows = vim.loop.os_uname().sysname == "Windows_NT" 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" vim.env.PATH = vim.fn.stdpath "data" .. "/mason/bin" .. (is_windows and ";" or ":") .. vim.env.PATH
-------------------------------------- autocmds ------------------------------------------ -------------------------------------- autocmds ------------------------------------------
local autocmd = vim.api.nvim_create_autocmd local autocmd = vim.api.nvim_create_autocmd
@ -72,11 +72,10 @@ autocmd("FileType", {
}) })
-- reload some chadrc options on-save -- reload some chadrc options on-save
vim.api.nvim_create_autocmd("BufWritePost", { autocmd("BufWritePost", {
pattern = vim.tbl_map( pattern = vim.tbl_map(function(path)
vim.fs.normalize, return vim.fs.normalize(vim.loop.fs_realpath(path))
vim.fn.glob(vim.fn.stdpath "config" .. "/lua/custom/**/*.lua", true, true, true) end, vim.fn.glob(vim.fn.stdpath "config" .. "/lua/custom/**/*.lua", true, true, true)),
),
group = vim.api.nvim_create_augroup("ReloadNvChad", {}), group = vim.api.nvim_create_augroup("ReloadNvChad", {}),
callback = function(opts) callback = function(opts)
@ -94,8 +93,14 @@ vim.api.nvim_create_autocmd("BufWritePost", {
vim.g.transparency = config.ui.transparency vim.g.transparency = config.ui.transparency
-- statusline -- statusline
require("plenary.reload").reload_module("nvchad_ui.statusline." .. config.ui.statusline.theme) require("plenary.reload").reload_module("nvchad.statusline." .. config.ui.statusline.theme)
vim.opt.statusline = "%!v:lua.require('nvchad_ui.statusline." .. config.ui.statusline.theme .. "').run()" 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() require("base46").load_all_highlights()
-- vim.cmd("redraw!") -- vim.cmd("redraw!")
@ -106,5 +111,5 @@ vim.api.nvim_create_autocmd("BufWritePost", {
local new_cmd = vim.api.nvim_create_user_command local new_cmd = vim.api.nvim_create_user_command
new_cmd("NvChadUpdate", function() new_cmd("NvChadUpdate", function()
require "nvchad.update"() require "nvchad.updater"()
end, {}) end, {})

View File

@ -5,63 +5,72 @@ local M = {}
M.general = { M.general = {
i = { i = {
-- go to beginning and end -- go to beginning and end
["<C-b>"] = { "<ESC>^i", "beginning of line" }, ["<C-b>"] = { "<ESC>^i", "Beginning of line" },
["<C-e>"] = { "<End>", "end of line" }, ["<C-e>"] = { "<End>", "End of line" },
-- navigate within insert mode -- navigate within insert mode
["<C-h>"] = { "<Left>", "move left" }, ["<C-h>"] = { "<Left>", "Move left" },
["<C-l>"] = { "<Right>", "move right" }, ["<C-l>"] = { "<Right>", "Move right" },
["<C-j>"] = { "<Down>", "move down" }, ["<C-j>"] = { "<Down>", "Move down" },
["<C-k>"] = { "<Up>", "move up" }, ["<C-k>"] = { "<Up>", "Move up" },
}, },
n = { n = {
["<Esc>"] = { ":noh <CR>", "clear highlights" }, ["<Esc>"] = { ":noh <CR>", "Clear highlights" },
-- switch between windows -- switch between windows
["<C-h>"] = { "<C-w>h", "window left" }, ["<C-h>"] = { "<C-w>h", "Window left" },
["<C-l>"] = { "<C-w>l", "window right" }, ["<C-l>"] = { "<C-w>l", "Window right" },
["<C-j>"] = { "<C-w>j", "window down" }, ["<C-j>"] = { "<C-w>j", "Window down" },
["<C-k>"] = { "<C-w>k", "window up" }, ["<C-k>"] = { "<C-w>k", "Window up" },
-- save -- save
["<C-s>"] = { "<cmd> w <CR>", "save file" }, ["<C-s>"] = { "<cmd> w <CR>", "Save file" },
-- Copy all -- Copy all
["<C-c>"] = { "<cmd> %y+ <CR>", "copy whole file" }, ["<C-c>"] = { "<cmd> %y+ <CR>", "Copy whole file" },
-- line numbers -- line numbers
["<leader>n"] = { "<cmd> set nu! <CR>", "toggle line number" }, ["<leader>n"] = { "<cmd> set nu! <CR>", "Toggle line number" },
["<leader>rn"] = { "<cmd> set rnu! <CR>", "toggle relative number" }, ["<leader>rn"] = { "<cmd> set rnu! <CR>", "Toggle relative number" },
-- Allow moving the cursor through wrapped lines with j, k, <Up> and <Down> -- Allow moving the cursor through wrapped lines with j, k, <Up> and <Down>
-- http://www.reddit.com/r/vim/comments/2k4cbr/problem_with_gj_and_gk/ -- http://www.reddit.com/r/vim/comments/2k4cbr/problem_with_gj_and_gk/
-- empty mode is same as using <cmd> :map -- empty mode is same as using <cmd> :map
-- also don't use g[j|k] when in operator pending mode, so it doesn't alter d, y or c behaviour -- also don't use g[j|k] when in operator pending mode, so it doesn't alter d, y or c behaviour
["j"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', "move down", opts = { expr = true } }, ["j"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', "Move down", opts = { expr = true } },
["k"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', "move up", opts = { expr = true } }, ["k"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', "Move up", opts = { expr = true } },
["<Up>"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', "move up", opts = { expr = true } }, ["<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 } }, ["<Down>"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', "Move down", opts = { expr = true } },
-- new buffer -- new buffer
["<leader>b"] = { "<cmd> enew <CR>", "new buffer" }, ["<leader>b"] = { "<cmd> enew <CR>", "New buffer" },
["<leader>ch"] = { "<cmd> NvCheatsheet <CR>", "Mapping cheatsheet" }, ["<leader>ch"] = { "<cmd> NvCheatsheet <CR>", "Mapping cheatsheet" },
["<leader>fm"] = {
function()
vim.lsp.buf.format { async = true }
end,
"LSP formatting",
},
}, },
t = { t = {
["<C-x>"] = { vim.api.nvim_replace_termcodes("<C-\\><C-N>", true, true, true), "escape terminal mode" }, ["<C-x>"] = { vim.api.nvim_replace_termcodes("<C-\\><C-N>", true, true, true), "Escape terminal mode" },
}, },
v = { v = {
["<Up>"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', "move up", opts = { expr = true } }, ["<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 } }, ["<Down>"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', "Move down", opts = { expr = true } },
["<"] = { "<gv", "Indent line" },
[">"] = { ">gv", "Indent line" },
}, },
x = { x = {
["j"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', "move down", opts = { expr = true } }, ["j"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', "Move down", opts = { expr = true } },
["k"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', "move up", opts = { expr = true } }, ["k"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', "Move up", opts = { expr = true } },
-- Don't copy the replaced text after pasting in visual mode -- Don't copy the replaced text after pasting in visual mode
-- https://vim.fandom.com/wiki/Replace_a_word_with_yanked_text#Alternative_mapping_for_paste -- https://vim.fandom.com/wiki/Replace_a_word_with_yanked_text#Alternative_mapping_for_paste
["p"] = { 'p:let @+=@0<CR>:let @"=@0<CR>', "dont copy replaced text", opts = { silent = true } }, ["p"] = { 'p:let @+=@0<CR>:let @"=@0<CR>', "Dont copy replaced text", opts = { silent = true } },
}, },
} }
@ -72,24 +81,24 @@ M.tabufline = {
-- cycle through buffers -- cycle through buffers
["<tab>"] = { ["<tab>"] = {
function() function()
require("nvchad_ui.tabufline").tabuflineNext() require("nvchad.tabufline").tabuflineNext()
end, end,
"goto next buffer", "Goto next buffer",
}, },
["<S-tab>"] = { ["<S-tab>"] = {
function() function()
require("nvchad_ui.tabufline").tabuflinePrev() require("nvchad.tabufline").tabuflinePrev()
end, end,
"goto prev buffer", "Goto prev buffer",
}, },
-- close buffer + hide terminal buffer -- close buffer + hide terminal buffer
["<leader>x"] = { ["<leader>x"] = {
function() function()
require("nvchad_ui.tabufline").close_buffer() require("nvchad.tabufline").close_buffer()
end, end,
"close buffer", "Close buffer",
}, },
}, },
} }
@ -103,14 +112,14 @@ M.comment = {
function() function()
require("Comment.api").toggle.linewise.current() require("Comment.api").toggle.linewise.current()
end, end,
"toggle comment", "Toggle comment",
}, },
}, },
v = { v = {
["<leader>/"] = { ["<leader>/"] = {
"<ESC><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<CR>", "<ESC><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<CR>",
"toggle comment", "Toggle comment",
}, },
}, },
} }
@ -125,119 +134,121 @@ M.lspconfig = {
function() function()
vim.lsp.buf.declaration() vim.lsp.buf.declaration()
end, end,
"lsp declaration", "LSP declaration",
}, },
["gd"] = { ["gd"] = {
function() function()
vim.lsp.buf.definition() vim.lsp.buf.definition()
end, end,
"lsp definition", "LSP definition",
}, },
["K"] = { ["K"] = {
function() function()
vim.lsp.buf.hover() vim.lsp.buf.hover()
end, end,
"lsp hover", "LSP hover",
}, },
["gi"] = { ["gi"] = {
function() function()
vim.lsp.buf.implementation() vim.lsp.buf.implementation()
end, end,
"lsp implementation", "LSP implementation",
}, },
["<leader>ls"] = { ["<leader>ls"] = {
function() function()
vim.lsp.buf.signature_help() vim.lsp.buf.signature_help()
end, end,
"lsp signature_help", "LSP signature help",
}, },
["<leader>D"] = { ["<leader>D"] = {
function() function()
vim.lsp.buf.type_definition() vim.lsp.buf.type_definition()
end, end,
"lsp definition type", "LSP definition type",
}, },
["<leader>ra"] = { ["<leader>ra"] = {
function() function()
require("nvchad_ui.renamer").open() require("nvchad.renamer").open()
end, end,
"lsp rename", "LSP rename",
}, },
["<leader>ca"] = { ["<leader>ca"] = {
function() function()
vim.lsp.buf.code_action() vim.lsp.buf.code_action()
end, end,
"lsp code_action", "LSP code action",
}, },
["gr"] = { ["gr"] = {
function() function()
vim.lsp.buf.references() vim.lsp.buf.references()
end, end,
"lsp references", "LSP references",
}, },
["<leader>f"] = { ["<leader>f"] = {
function() function()
vim.diagnostic.open_float { border = "rounded" } vim.diagnostic.open_float { border = "rounded" }
end, end,
"floating diagnostic", "Floating diagnostic",
}, },
["[d"] = { ["[d"] = {
function() function()
vim.diagnostic.goto_prev() vim.diagnostic.goto_prev { float = { border = "rounded" } }
end, end,
"goto prev", "Goto prev",
}, },
["]d"] = { ["]d"] = {
function() function()
vim.diagnostic.goto_next() vim.diagnostic.goto_next { float = { border = "rounded" } }
end, end,
"goto_next", "Goto next",
}, },
["<leader>q"] = { ["<leader>q"] = {
function() function()
vim.diagnostic.setloclist() vim.diagnostic.setloclist()
end, end,
"diagnostic setloclist", "Diagnostic setloclist",
},
["<leader>fm"] = {
function()
vim.lsp.buf.format { async = true }
end,
"lsp formatting",
}, },
["<leader>wa"] = { ["<leader>wa"] = {
function() function()
vim.lsp.buf.add_workspace_folder() vim.lsp.buf.add_workspace_folder()
end, end,
"add workspace folder", "Add workspace folder",
}, },
["<leader>wr"] = { ["<leader>wr"] = {
function() function()
vim.lsp.buf.remove_workspace_folder() vim.lsp.buf.remove_workspace_folder()
end, end,
"remove workspace folder", "Remove workspace folder",
}, },
["<leader>wl"] = { ["<leader>wl"] = {
function() function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders())) print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, end,
"list workspace folders", "List workspace folders",
},
},
v = {
["<leader>ca"] = {
function()
vim.lsp.buf.code_action()
end,
"LSP code action",
}, },
}, },
} }
@ -247,10 +258,10 @@ M.nvimtree = {
n = { n = {
-- toggle -- toggle
["<C-n>"] = { "<cmd> NvimTreeToggle <CR>", "toggle nvimtree" }, ["<C-n>"] = { "<cmd> NvimTreeToggle <CR>", "Toggle nvimtree" },
-- focus -- focus
["<leader>e"] = { "<cmd> NvimTreeFocus <CR>", "focus nvimtree" }, ["<leader>e"] = { "<cmd> NvimTreeFocus <CR>", "Focus nvimtree" },
}, },
} }
@ -259,23 +270,25 @@ M.telescope = {
n = { n = {
-- find -- find
["<leader>ff"] = { "<cmd> Telescope find_files <CR>", "find files" }, ["<leader>ff"] = { "<cmd> Telescope find_files <CR>", "Find files" },
["<leader>fa"] = { "<cmd> Telescope find_files follow=true no_ignore=true hidden=true <CR>", "find all" }, ["<leader>fa"] = { "<cmd> Telescope find_files follow=true no_ignore=true hidden=true <CR>", "Find all" },
["<leader>fw"] = { "<cmd> Telescope live_grep <CR>", "live grep" }, ["<leader>fw"] = { "<cmd> Telescope live_grep <CR>", "Live grep" },
["<leader>fb"] = { "<cmd> Telescope buffers <CR>", "find buffers" }, ["<leader>fb"] = { "<cmd> Telescope buffers <CR>", "Find buffers" },
["<leader>fh"] = { "<cmd> Telescope help_tags <CR>", "help page" }, ["<leader>fh"] = { "<cmd> Telescope help_tags <CR>", "Help page" },
["<leader>fo"] = { "<cmd> Telescope oldfiles <CR>", "find oldfiles" }, ["<leader>fo"] = { "<cmd> Telescope oldfiles <CR>", "Find oldfiles" },
["<leader>fz"] = { "<cmd> Telescope current_buffer_fuzzy_find <CR>", "find in current buffer" }, ["<leader>fz"] = { "<cmd> Telescope current_buffer_fuzzy_find <CR>", "Find in current buffer" },
-- git -- git
["<leader>cm"] = { "<cmd> Telescope git_commits <CR>", "git commits" }, ["<leader>cm"] = { "<cmd> Telescope git_commits <CR>", "Git commits" },
["<leader>gt"] = { "<cmd> Telescope git_status <CR>", "git status" }, ["<leader>gt"] = { "<cmd> Telescope git_status <CR>", "Git status" },
-- pick a hidden term -- pick a hidden term
["<leader>pt"] = { "<cmd> Telescope terms <CR>", "pick hidden term" }, ["<leader>pt"] = { "<cmd> Telescope terms <CR>", "Pick hidden term" },
-- theme switcher -- theme switcher
["<leader>th"] = { "<cmd> Telescope themes <CR>", "nvchad themes" }, ["<leader>th"] = { "<cmd> Telescope themes <CR>", "Nvchad themes" },
["<leader>ma"] = { "<cmd> Telescope marks <CR>", "telescope bookmarks" },
}, },
} }
@ -288,21 +301,21 @@ M.nvterm = {
function() function()
require("nvterm.terminal").toggle "float" require("nvterm.terminal").toggle "float"
end, end,
"toggle floating term", "Toggle floating term",
}, },
["<A-h>"] = { ["<A-h>"] = {
function() function()
require("nvterm.terminal").toggle "horizontal" require("nvterm.terminal").toggle "horizontal"
end, end,
"toggle horizontal term", "Toggle horizontal term",
}, },
["<A-v>"] = { ["<A-v>"] = {
function() function()
require("nvterm.terminal").toggle "vertical" require("nvterm.terminal").toggle "vertical"
end, end,
"toggle vertical term", "Toggle vertical term",
}, },
}, },
@ -312,21 +325,21 @@ M.nvterm = {
function() function()
require("nvterm.terminal").toggle "float" require("nvterm.terminal").toggle "float"
end, end,
"toggle floating term", "Toggle floating term",
}, },
["<A-h>"] = { ["<A-h>"] = {
function() function()
require("nvterm.terminal").toggle "horizontal" require("nvterm.terminal").toggle "horizontal"
end, end,
"toggle horizontal term", "Toggle horizontal term",
}, },
["<A-v>"] = { ["<A-v>"] = {
function() function()
require("nvterm.terminal").toggle "vertical" require("nvterm.terminal").toggle "vertical"
end, end,
"toggle vertical term", "Toggle vertical term",
}, },
-- new -- new
@ -334,14 +347,14 @@ M.nvterm = {
function() function()
require("nvterm.terminal").new "horizontal" require("nvterm.terminal").new "horizontal"
end, end,
"new horizontal term", "New horizontal term",
}, },
["<leader>v"] = { ["<leader>v"] = {
function() function()
require("nvterm.terminal").new "vertical" require("nvterm.terminal").new "vertical"
end, end,
"new vertical term", "New vertical term",
}, },
}, },
} }
@ -354,14 +367,14 @@ M.whichkey = {
function() function()
vim.cmd "WhichKey" vim.cmd "WhichKey"
end, end,
"which-key all keymaps", "Which-key all keymaps",
}, },
["<leader>wk"] = { ["<leader>wk"] = {
function() function()
local input = vim.fn.input "WhichKey: " local input = vim.fn.input "WhichKey: "
vim.cmd("WhichKey " .. input) vim.cmd("WhichKey " .. input)
end, end,
"which-key query lookup", "Which-key query lookup",
}, },
}, },
} }
@ -383,7 +396,7 @@ M.blankline = {
end end
end, end,
"Jump to current_context", "Jump to current context",
}, },
}, },
} }

View File

@ -8,11 +8,11 @@ M.load_config = function()
if chadrc_path then if chadrc_path then
local chadrc = dofile(chadrc_path) 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 = merge_tb("force", config, chadrc)
config.mappings.disabled = nil
end end
config.mappings.disabled = nil
return config return config
end end

View File

@ -15,7 +15,7 @@ local formatting_style = {
fields = field_arrangement[cmp_style] or { "abbr", "kind", "menu" }, fields = field_arrangement[cmp_style] or { "abbr", "kind", "menu" },
format = function(_, item) 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 "" local icon = (cmp_ui.icons and icons[item.kind]) or ""
if cmp_style == "atom" or cmp_style == "atom_colored" then if cmp_style == "atom" or cmp_style == "atom_colored" then
@ -76,8 +76,8 @@ local options = {
["<C-Space>"] = cmp.mapping.complete(), ["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.close(), ["<C-e>"] = cmp.mapping.close(),
["<CR>"] = cmp.mapping.confirm { ["<CR>"] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace, behavior = cmp.ConfirmBehavior.Insert,
select = false, select = true,
}, },
["<Tab>"] = cmp.mapping(function(fallback) ["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() then

View File

@ -1,5 +1,5 @@
dofile(vim.g.base46_cache .. "lsp") dofile(vim.g.base46_cache .. "lsp")
require "nvchad_ui.lsp" require "nvchad.lsp"
local M = {} local M = {}
local utils = require "core.utils" local utils = require "core.utils"
@ -7,13 +7,16 @@ local utils = require "core.utils"
-- export on_attach & capabilities for custom lspconfigs -- export on_attach & capabilities for custom lspconfigs
M.on_attach = function(client, bufnr) M.on_attach = function(client, bufnr)
client.server_capabilities.documentFormattingProvider = false
client.server_capabilities.documentRangeFormattingProvider = false
utils.load_mappings("lspconfig", { buffer = bufnr }) utils.load_mappings("lspconfig", { buffer = bufnr })
if client.server_capabilities.signatureHelpProvider then 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 if not utils.load_config().ui.lsp_semantic_tokens and client.supports_method "textDocument/semanticTokens" then
client.server_capabilities.semanticTokensProvider = nil client.server_capabilities.semanticTokensProvider = nil
end end
end end
@ -51,7 +54,7 @@ require("lspconfig").lua_ls.setup {
library = { library = {
[vim.fn.expand "$VIMRUNTIME/lua"] = true, [vim.fn.expand "$VIMRUNTIME/lua"] = true,
[vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = 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, [vim.fn.stdpath "data" .. "/lazy/lazy.nvim/lua/lazy"] = true,
}, },
maxPreload = 100000, maxPreload = 100000,

View File

@ -16,11 +16,12 @@ local options = {
adaptive_size = false, adaptive_size = false,
side = "left", side = "left",
width = 30, width = 30,
preserve_window_proportions = true, preserve_window_proportions = true
-- hide_root_folder = true,
}, },
git = { git = {
enable = false, enable = true,
ignore = true, ignore = false,
}, },
filesystem_watchers = { filesystem_watchers = {
enable = true, enable = true,
@ -31,10 +32,8 @@ local options = {
}, },
}, },
renderer = { renderer = {
root_folder_label = false, highlight_git = true,
highlight_git = false,
highlight_opened_files = "none", highlight_opened_files = "none",
indent_markers = { indent_markers = {
enable = false, enable = false,
}, },
@ -44,19 +43,19 @@ local options = {
file = true, file = true,
folder = true, folder = true,
folder_arrow = true, folder_arrow = true,
git = false, git = true,
}, },
glyphs = { glyphs = {
default = "󰈚", default = "",
symlink = "", symlink = "",
folder = { folder = {
default = "󰉋", default = "",
empty = "", empty = "",
empty_open = "", empty_open = "",
open = "", open = "",
symlink = "", symlink = "",
symlink_open = "", symlink_open = "",
arrow_open = "", arrow_open = "",
arrow_closed = "", arrow_closed = "",
}, },

View File

@ -51,12 +51,12 @@ end
M.gitsigns = { M.gitsigns = {
signs = { signs = {
add = { hl = "DiffAdd", text = "", numhl = "GitSignsAddNr" }, add = { text = "" },
change = { hl = "DiffChange", text = "", numhl = "GitSignsChangeNr" }, change = { text = "" },
delete = { hl = "DiffDelete", text = "󰍵", numhl = "GitSignsDeleteNr" }, delete = { text = "󰍵" },
topdelete = { hl = "DiffDelete", text = "", numhl = "GitSignsDeleteNr" }, topdelete = { text = "" },
changedelete = { hl = "DiffChangeDelete", text = "~", numhl = "GitSignsChangeNr" }, changedelete = { text = "~" },
untracked = { hl = "GitSignsAdd", text = "", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" }, untracked = { text = "" },
}, },
on_attach = function(bufnr) on_attach = function(bufnr)
utils.load_mappings("gitsigns", { buffer = bufnr }) utils.load_mappings("gitsigns", { buffer = bufnr })

View File

@ -49,7 +49,15 @@ local options = {
}, },
}, },
extensions_list = { "themes", "terms" }, extensions_list = { "themes", "terms", "fzf" },
extensions = {
fzf = {
fuzzy = true,
override_generic_sorter = true,
override_file_sorter = true,
case_mode = "smart_case",
},
},
} }
return options return options

View File

@ -4,9 +4,6 @@ local default_plugins = {
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
-- nvchad plugins
{ "NvChad/extensions", branch = "v2.0" },
{ {
"NvChad/base46", "NvChad/base46",
branch = "v2.0", branch = "v2.0",
@ -19,9 +16,6 @@ local default_plugins = {
"NvChad/ui", "NvChad/ui",
branch = "v2.0", branch = "v2.0",
lazy = false, lazy = false,
config = function()
require "nvchad_ui"
end,
}, },
{ {
@ -53,7 +47,7 @@ local default_plugins = {
{ {
"nvim-tree/nvim-web-devicons", "nvim-tree/nvim-web-devicons",
opts = function() opts = function()
return { override = require("nvchad_ui.icons").devicons } return { override = require "nvchad.icons.devicons" }
end, end,
config = function(_, opts) config = function(_, opts)
dofile(vim.g.base46_cache .. "devicons") dofile(vim.g.base46_cache .. "devicons")
@ -63,6 +57,7 @@ local default_plugins = {
{ {
"lukas-reineke/indent-blankline.nvim", "lukas-reineke/indent-blankline.nvim",
version = "2.20.7",
init = function() init = function()
require("core.utils").lazy_load "indent-blankline.nvim" require("core.utils").lazy_load "indent-blankline.nvim"
end, end,
@ -123,7 +118,7 @@ local default_plugins = {
-- lsp stuff -- lsp stuff
{ {
"williamboman/mason.nvim", "williamboman/mason.nvim",
cmd = { "Mason", "MasonInstall", "MasonInstallAll", "MasonUninstall", "MasonUninstallAll", "MasonLog" }, cmd = { "Mason", "MasonInstall", "MasonInstallAll", "MasonUpdate" },
opts = function() opts = function()
return require "plugins.configs.mason" return require "plugins.configs.mason"
end, end,
@ -200,12 +195,19 @@ local default_plugins = {
{ {
"numToStr/Comment.nvim", "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() init = function()
require("core.utils").load_mappings "comment" require("core.utils").load_mappings "comment"
end, end,
config = function() config = function(_, opts)
require("Comment").setup() require("Comment").setup(opts)
end, end,
}, },
@ -222,12 +224,12 @@ local default_plugins = {
config = function(_, opts) config = function(_, opts)
dofile(vim.g.base46_cache .. "nvimtree") dofile(vim.g.base46_cache .. "nvimtree")
require("nvim-tree").setup(opts) require("nvim-tree").setup(opts)
vim.g.nvimtree_side = opts.view.side
end, end,
}, },
{ {
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim",
dependencies = { "nvim-treesitter/nvim-treesitter", { "nvim-telescope/telescope-fzf-native.nvim", build = "make" } },
cmd = "Telescope", cmd = "Telescope",
init = function() init = function()
require("core.utils").load_mappings "telescope" require("core.utils").load_mappings "telescope"
@ -250,10 +252,11 @@ local default_plugins = {
-- Only load whichkey after all the gui -- Only load whichkey after all the gui
{ {
"folke/which-key.nvim", "folke/which-key.nvim",
keys = { "<leader>", '"', "'", "`", "c", "v" }, keys = { "<leader>", "<c-r>", '"', "'", "`", "c", "v", "g" },
init = function() init = function()
require("core.utils").load_mappings "whichkey" require("core.utils").load_mappings "whichkey"
end, end,
cmd = "WhichKey",
config = function(_, opts) config = function(_, opts)
dofile(vim.g.base46_cache .. "whichkey") dofile(vim.g.base46_cache .. "whichkey")
require("which-key").setup(opts) require("which-key").setup(opts)