1 Commits
Author SHA1 Message Date
Legrems 3fe9fda7cd Merge remote-tracking branch 'nvchad/v2.0' into p53 2023-11-21 13:16:37 +01:00
16 changed files with 61 additions and 462 deletions
-2
View File
@@ -18,6 +18,4 @@ end
dofile(vim.g.base46_cache .. "defaults")
vim.opt.rtp:prepend(lazypath)
vim.api.nvim_command "packadd cfilter"
vim.api.nvim_command "packadd justify"
require "plugins"
+14 -6
View File
@@ -40,13 +40,21 @@ M.gen_chadrc_template = function()
local path = fn.stdpath "config" .. "/lua/custom"
if fn.isdirectory(path) ~= 1 then
-- use very minimal chadrc
fn.mkdir(path, "p")
local input = fn.input "Do you want to install example custom config? (y/N): "
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()
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
end
end
end
+1 -27
View File
@@ -59,7 +59,7 @@ for _, provider in ipairs { "node", "perl", "python3", "ruby" } do
end
-- add binaries installed by mason.nvim to path
local is_windows = vim.fn.has("win32") ~= 0
local is_windows = vim.loop.os_uname().sysname == "Windows_NT"
vim.env.PATH = vim.fn.stdpath "data" .. "/mason/bin" .. (is_windows and ";" or ":") .. vim.env.PATH
-------------------------------------- autocmds ------------------------------------------
@@ -110,32 +110,6 @@ 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
+8 -44
View File
@@ -18,7 +18,6 @@ M.general = {
n = {
["<leader>n"] = { ":noh <CR>", "Clear highlights" },
["<leader>rr"] = { ":source $MYVIMRC<CR>", "Reload config file" },
["<Esc>"] = { "<cmd> noh <CR>", "Clear highlights" },
-- switch between windows
["<C-h>"] = { "<C-w>h", "Window left" },
["<C-l>"] = { "<C-w>l", "Window right" },
@@ -62,13 +61,6 @@ 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 = {
@@ -78,8 +70,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" },
-- ["<"] = { "<gv", "Indent line" },
-- [">"] = { ">gv", "Indent line" },
},
x = {
@@ -104,18 +96,11 @@ M.customstuffs = {
["<C-t>"] = { "<cmd> TagbarToggle<CR>", "Show tagbar" },
["<leader>ra"] = { "<cmd> call VrcQuery()<CR>", "Call REST endpoint" },
["<leader>dl"] = { "0d$", "Delete line from start" },
["<leader>gpu"] = { "<cmd> Git pull<CR>", "Git pull" },
["<leader>gpf"] = { ":Git push ", "Git push with option" },
["<leader>gmm"] = { "<cmd> Git merge master<CR>", "Git merge master" },
["<leader>gmi"] = { ":Git merge ", "Git merge ..." },
["<leader>ga"] = { ":Git commit -a --amend --no-edit --no-verify", "Git commit -a --amend --no-edit --no-verify" },
["<leader>gp"] = { "<cmd> Git pull<CR>", "Git pull" },
["<leader>gnb"] = { ":Git checkout -b ", "Checkout to a new branch" },
["<leader>gri"] = { ":Git rebase -i HEAD~", "Git rebase interactive from HEAD" },
["<leader>grm"] = { ":Git rebase -i master", "Git rebase interactive from master" },
["<leader>grr"] = { ":Git rebase -i ", "Git rebase interactive from <select>" },
-- ["<leader>mkd"] = { "<cmd>lua vim.api.nvim_create_user_command('PeekOpen', require('peek').open, {})<CR>", "Open markdown preview" },
-- ["<leader>mkc"] = { "<cmd>lua vim.api.nvim_create_user_command('PeekClose', require('peek').close, {})<CR>", "Open markdown preview" },
["<leader>mkd"] = { "<cmd>lua vim.api.nvim_create_user_command('PeekOpen', require('peek').open, {})<CR>", "Open markdown preview" },
["<leader>mkc"] = { "<cmd>lua vim.api.nvim_create_user_command('PeekClose', require('peek').close, {})<CR>", "Open markdown preview" },
["n"] = { "nzz", "Next + auto center" },
["N"] = { "Nzz", "Previous + auto center" },
@@ -129,14 +114,7 @@ M.customstuffs = {
-- Mappings: TODO
-- "trim(system('git branch --show-current 2>/dev/null'))"
-- ["<leader>ct"] = { ":call append(line('.') - 1, repeat(' ', indent('.')) . '# TODO-' . trim(system('git branch --show-current 2>/dev/null')) . ': ' . input('Comment >'))<CR>", "Add TODO comment + add to quickfix list" },
["<leader>ct"] = { ":call append(line('.') - 1, repeat(' ', indent('.')) . '# TODO: ' . input('Comment >'))<CR>", "Add TODO comment + add to quickfix list" },
["<leader>ww"] = { ":lua require('nvim-window').pick()<CR>", "Pick window to goto" },
["<leader>wm"] = { ":WinShift<CR>", "Enter move window mode" },
["<leader>ws"] = { ":WinShift swap<CR>", "Swap window, with selection" },
["<leader>gg"] = { ":LazyGit<CR>", "Open lazygit" },
["<leader>tt"] = { ":call append(line('.') - 1, repeat(' ', indent('.')) . '# TODO-' . trim(system('git branch --show-current 2>/dev/null')) . ': ' . input('Comment >'))<CR>", "Add TODO comment + add to quickfix list" },
},
v = {
["n"] = { "nzz", "Next + auto center" },
@@ -354,15 +332,9 @@ M.telescope = {
["<C-b>"] = { "<cmd> Telescope buffers <CR>", "Find buffers" },
["<leader>fg"] = { "<cmd> lua require('telescope.builtin').live_grep({default_text=vim.fn.getreg('/')}) <CR>", "Live grep with actual search value as prefix" },
["<leader>gf"] = { "<cmd> lua require('telescope.builtin').find_files({default_text=vim.fn.getreg('/')}) <CR>", "Live grep with actual search value as prefix" },
["<leader>ac"] = { ":execute 'vimgrep' input('Pattern >', getreg('/')) '**/*' <CR>", "add search term files in quickfix list" },
-- ["<leader>qr"] = { ":execute 'cdo' '%s/' . input('Search term >', getreg('/')) . '/' . input('Replace by >', getreg('')) . '/g | update' <CR>", "Replace pattern in all quickfix list" },
["<leader>qr"] = { ":cdo '%s/' . input('Search term >', getreg('/')) . '/' . input('Replace by >', '') . '/g | update' <CR>", "Replace pattern in all quickfix list" },
["<leader>br"] = { ":execute '%s/' . input('Search term >', getreg('/')) . '/' . input('Replace by >', '') . '/g | update' <CR>", "Replace pattern in current buffer" },
["<leader>ql"] = { "<cmd> Telescope quickfix <CR>", "Show quickfix list" },
["<leader>qn"] = { ":cnext<CR>", "Jump to next in quickfix list" },
["<leader>qp"] = { ":cprevious<CR>", "Jump to previous in quickfix list" },
["<leader>qc"] = { "<cmd> Telescope quickfix <CR>", "Show quickfix list" },
["<leader>qr"] = { ":execute 'cdo' '%s/' . input('Search term >', getreg('/')) . '/' . input('Replace by >', getreg('')) . '/g | update' <CR>", "Replace pattern in all quickfix list" },
["<leader>ll"] = { "<cmd> Telescope loclist <CR>", "Show loclist list" },
["<leader>ln"] = { ":lnext<CR>", "Jump to next in loclist" },
@@ -372,8 +344,6 @@ M.telescope = {
["<leader>fo"] = { "<cmd> Telescope oldfiles <CR>", "Find oldfiles" },
["<leader>fz"] = { "<cmd> Telescope current_buffer_fuzzy_find <CR>", "Find in current buffer" },
["<leader>wl"] = { "<cmd> Telescope workspaces <CR>", "Find workspaces" },
-- git
--- Commits
["<leader>gc"] = { "<cmd> lua require('custom.telescope').my_git_commits()<CR>", "Custom Git commits" },
@@ -396,12 +366,6 @@ M.telescope = {
-- History
["<leader>ch"] = { "<cmd> Telescope command_history <CR>", "telescope commands history" },
["<leader>/"] = { "<cmd> Telescope search_history <CR>", "telescope search history" },
-- Diaglist: LSP diagnostics in quick/loc list
["<leader>dw"] = { "<cmd>lua require('diaglist').open_all_diagnostics()<CR>", "Open all open buffers diagnostics in quickfix list" },
["<leader>d0"] = { "<cmd>lua require('diaglist').open_buffer_diagnostics()<CR>", "Open current buffer diagnostics in loclist list" },
["<leader>;"] = { "<cmd> Telescope <CR>", "Open Telescope" },
},
}
+2 -2
View File
@@ -5,8 +5,8 @@ local M = {}
local highlights = require "custom.highlights"
M.ui = {
theme = "onedark",
theme_toggle = { "onedark", "monekai" },
theme = "gatekeeper",
theme_toggle = { "gatekeeper", "monekai" },
hl_override = highlights.override,
hl_add = highlights.add,
+1 -1
View File
@@ -4,7 +4,7 @@ local capabilities = require("plugins.configs.lspconfig").capabilities
local lspconfig = require "lspconfig"
-- if you just want default config for the servers then put them in a table
local servers = { "html", "cssls", "tsserver", "clangd", "salt_ls" }
local servers = { "html", "cssls", "tsserver", "clangd" }
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
-9
View File
@@ -19,15 +19,6 @@ M.treesitter = {
-- "python"
-- },
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<C-space>",
node_incremental = "<C-space>",
scope_incremental = false,
node_decremental = "<bs>",
},
},
}
M.mason = {
-1
View File
@@ -2,7 +2,6 @@
local previewers = require('telescope.previewers')
local builtin = require('telescope.builtin')
local E = {}
local delta = previewers.new_termopen_previewer {
-35
View File
@@ -1,35 +0,0 @@
local Hydra = require("hydra")
Hydra({
name = "Change / Resize Window",
mode = { "n" },
body = "<leader>t",
config = {
-- color = "pink",
},
heads = {
-- move between windows
{ "<C-h>", "<C-w>h", { desc="Noot nooty" } },
{ "<C-j>", "<C-w>j" },
{ "<C-k>", "<C-w>k" },
{ "<C-l>", "<C-w>l" },
-- resizing window
{ "H", "<C-w>3<" },
{ "L", "<C-w>3>" },
{ "K", "<C-w>2+" },
{ "J", "<C-w>2-" },
-- equalize window sizes
{ "e", "<C-w>=" },
-- close active window
{ "Q", ":q<cr>" },
{ "<C-q>", ":q<cr>" },
-- exit this Hydra
{ "q", nil, { exit = true, nowait = true } },
{ ";", nil, { exit = true, nowait = true } },
{ "<Esc>", nil, { exit = true, nowait = true } },
},
})
+4 -4
View File
@@ -5,16 +5,17 @@ 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
@@ -41,7 +42,6 @@ M.capabilities.textDocument.completion.completionItem = {
}
require("lspconfig").lua_ls.setup {
on_init = M.on_init,
on_attach = M.on_attach,
capabilities = M.capabilities,
-46
View File
@@ -1,46 +0,0 @@
local M = {
lsp = {
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
},
},
-- you can enable a preset for easier configuration
presets = {
bottom_search = true, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = false, -- add a border to hover docs and signature help
},
views = {
cmdline_popup = {
-- border = {
-- style = "none",
-- padding = { 2, 3 },
-- },
-- position = {
-- row = "85%",
-- col = "50%",
-- },
size = {
width = 120,
height = "auto",
},
},
popupmenu = {
-- relative = "editor",
-- position = {
-- row = 25,
-- col = "50%",
-- },
size = {
width = 120,
-- height = 10,
}
}
},
}
return M
+1 -2
View File
@@ -40,8 +40,7 @@ require('lspconfig').ruff_lsp.setup {
init_options = {
settings = {
-- Any extra CLI arguments for `ruff` go here.
args = {"--ignore", "E741"},
args = {},
}
}
}
+1 -1
View File
@@ -168,7 +168,7 @@ local options = {
}
},
extensions_list = { "themes", "terms", "fzf", "macrothis" },
extensions_list = { "themes", "terms", "fzf" },
extensions = {
fzf = {
fuzzy = true,
+1 -1
View File
@@ -1,5 +1,5 @@
local options = {
ensure_installed = { "lua", "vim", "vimdoc" },
ensure_installed = { "lua" },
highlight = {
enable = true,
@@ -1,133 +0,0 @@
local M = {}
M.textobjects = {
select = {
enable = true,
-- Automatically jump forward to textobj, similar to targets.vim
lookahead = true,
keymaps = {
-- You can use the capture groups defined in textobjects.scm
["a="] = { query = "@assignment.outer", desc = "Select outer part of an assignment" },
["i="] = { query = "@assignment.inner", desc = "Select inner part of an assignment" },
["l="] = { query = "@assignment.lhs", desc = "Select left hand side of an assignment" },
["r="] = { query = "@assignment.rhs", desc = "Select right hand side of an assignment" },
["aa"] = { query = "@parameter.outer", desc = "Select outer part of a parameter/argument" },
["ia"] = { query = "@parameter.inner", desc = "Select inner part of a parameter/argument" },
["ai"] = { query = "@conditional.outer", desc = "Select outer part of a conditional" },
["ii"] = { query = "@conditional.inner", desc = "Select inner part of a conditional" },
["al"] = { query = "@loop.outer", desc = "Select outer part of a loop" },
["il"] = { query = "@loop.inner", desc = "Select inner part of a loop" },
["af"] = { query = "@call.outer", desc = "Select outer part of a function call" },
["if"] = { query = "@call.inner", desc = "Select inner part of a function call" },
["am"] = { query = "@function.outer", desc = "Select outer part of a function def" },
["im"] = { query = "@function.inner", desc = "Select inner part of a function def" },
["ak"] = { query = "@class.outer", desc = "Select outer part of a class" },
["ik"] = { query = "@class.inner", desc = "Select inner part of a class" },
["ac"] = { query = "@comment.outer", desc = "Select outer part of a comment" },
["ic"] = { query = "@comment.inner", desc = "Select inner part of a comment" },
},
},
move = {
enable = true,
-- Whether to set jumps in the jumplist
set_jumps = true,
goto_next_start = {
["]a"] = { query = "@parameter.outer", desc = "Goto next start outer parameter" },
["]i"] = { query = "@conditional.outer", desc = "Goto next start outer conditional" },
["]l"] = { query = "@loop.outer", desc = "Goto next start outer loop" },
["]f"] = { query = "@call.outer", desc = "Goto next start outer call" },
["]m"] = { query = "@function.outer", desc = "Goto next start outer function" },
["]k"] = { query = "@class.outer", desc = "Goto next start outer class" },
["]c"] = { query = "@comment.outer", desc = "Goto next start outer comment" },
},
goto_next_end = {
["]A"] = { query = "@parameter.outer", desc = "Goto next end outer parameter" },
["]I"] = { query = "@conditional.outer", desc = "Goto next end outer conditional" },
["]L"] = { query = "@loop.outer", desc = "Goto next end outer loop" },
["]F"] = { query = "@call.outer", desc = "Goto next end outer call" },
["]M"] = { query = "@function.outer", desc = "Goto next end outer function" },
["]K"] = { query = "@class.outer", desc = "Goto next end outer class" },
["]C"] = { query = "@comment.outer", desc = "Goto next end outer comment" },
},
goto_previous_start = {
["[a"] = { query = "@parameter.outer", desc = "Goto previous start outer parameter" },
["[i"] = { query = "@conditional.outer", desc = "Goto previous start outer conditional" },
["[l"] = { query = "@loop.outer", desc = "Goto previous start outer loop" },
["[f"] = { query = "@call.outer", desc = "Goto previous start outer call" },
["[m"] = { query = "@function.outer", desc = "Goto previous start outer function" },
["[k"] = { query = "@class.outer", desc = "Goto previous start outer class" },
["[c"] = { query = "@comment.outer", desc = "Goto previous start outer comment" },
},
goto_previous_end = {
["[A"] = { query = "@parameter.outer", desc = "Goto previous end outer parameter" },
["[I"] = { query = "@conditional.outer", desc = "Goto previous end outer conditional" },
["[L"] = { query = "@loop.outer", desc = "Goto previous end outer loop" },
["[F"] = { query = "@call.outer", desc = "Goto previous end outer call" },
["[M"] = { query = "@function.outer", desc = "Goto previous end outer function" },
["[K"] = { query = "@class.outer", desc = "Goto previous end outer class" },
["[C"] = { query = "@comment.outer", desc = "Goto previous end outer comment" },
},
},
swap = {
enable = true,
swap_next = {
["<leader>na"] = { query = "@parameter.inner", desc = "Swap with next inner parameter" },
["<leader>ni"] = { query = "@conditional.outer", desc = "Swap with next outer conditional" },
["<leader>nl"] = { query = "@loop.outer", desc = "Swap with next outer loop" },
["<leader>nf"] = { query = "@call.outer", desc = "Swap with next outer call" },
["<leader>nm"] = { query = "@function.outer", desc = "Swap with next outer function" },
["<leader>nk"] = { query = "@class.outer", desc = "Swap with next outer class" },
["<leader>nc"] = { query = "@comment.outer", desc = "Swap with next outer comment" },
["<leader>nA"] = { query = "@parameter.outer", desc = "Swap with next outer parameter" },
["<leader>nI"] = { query = "@conditional.inner", desc = "Swap with next inner conditional" },
["<leader>nL"] = { query = "@loop.inner", desc = "Swap with next inner loop" },
["<leader>nF"] = { query = "@call.inner", desc = "Swap with next inner call" },
["<leader>nM"] = { query = "@function.inner", desc = "Swap with next inner function" },
["<leader>nK"] = { query = "@class.inner", desc = "Swap with next inner class" },
["<leader>nC"] = { query = "@comment.inner", desc = "Swap with next inner comment" },
},
swap_previous = {
["<leader>pa"] = { query = "@parameter.inner", desc = "Swap with previous inner parameter" },
["<leader>pi"] = { query = "@conditional.outer", desc = "Swap with previous outer conditional" },
["<leader>pl"] = { query = "@loop.outer", desc = "Swap with previous outer loop" },
["<leader>pf"] = { query = "@call.outer", desc = "Swap with previous outer call" },
["<leader>pm"] = { query = "@function.outer", desc = "Swap with previous outer function" },
["<leader>pk"] = { query = "@class.outer", desc = "Swap with previous outer class" },
["<leader>pc"] = { query = "@comment.outer", desc = "Swap with previous outer comment" },
["<leader>pA"] = { query = "@parameter.outer", desc = "Swap with previous outer parameter" },
["<leader>pI"] = { query = "@conditional.inner", desc = "Swap with previous inner conditional" },
["<leader>pL"] = { query = "@loop.inner", desc = "Swap with previous inner loop" },
["<leader>pF"] = { query = "@call.inner", desc = "Swap with previous inner call" },
["<leader>pM"] = { query = "@function.inner", desc = "Swap with previous inner function" },
["<leader>pK"] = { query = "@class.inner", desc = "Swap with previous inner class" },
["<leader>pC"] = { query = "@comment.inner", desc = "Swap with previous inner comment" },
},
}
}
-- local ts_repeat_move = require "nvim-treesitter.textobjects.repeatable_move"
-- Repeat movement with ; and ,
-- vim.keymap.set({"n", "x", "o"}, ",", ts_repeat_move.repeat_last_move_next)
-- vim.keymap.set({"n", "x", "o"}, ",", ts_repeat_move.repeat_last_move_previous)
-- Optionnally, make builtin f, F, t, T also repeatable with ; and ,
-- vim.keymap.set({"n", "x", "o"}, "f", ts_repeat_move.builtin_f)
-- vim.keymap.set({"n", "x", "o"}, "F", ts_repeat_move.builtin_F)
-- vim.keymap.set({"n", "x", "o"}, "t", ts_repeat_move.builtin_t)
-- vim.keymap.set({"n", "x", "o"}, "T", ts_repeat_move.builtin_T)
return M
+28 -148
View File
@@ -45,7 +45,7 @@ local default_plugins = {
},
{
"zbirenbaum/nvterm",
"NvChad/nvterm",
init = function()
require("core.utils").load_mappings "nvterm"
end,
@@ -57,7 +57,9 @@ local default_plugins = {
{
"NvChad/nvim-colorizer.lua",
event = "User FilePost",
init = function()
require("core.utils").lazy_load "nvim-colorizer.lua"
end,
config = function(_, opts)
require("colorizer").setup(opts)
@@ -85,7 +87,6 @@ local default_plugins = {
init = function()
require("core.utils").lazy_load "indent-blankline.nvim"
end,
event = "User FilePost",
opts = function()
return require("plugins.configs.others").blankline
end,
@@ -98,7 +99,9 @@ local default_plugins = {
{
"nvim-treesitter/nvim-treesitter",
event = { "BufReadPost", "BufNewFile" },
init = function()
require("core.utils").lazy_load "nvim-treesitter"
end,
cmd = { "TSInstall", "TSBufEnable", "TSBufDisable", "TSModuleInfo" },
build = ":TSUpdate",
opts = function()
@@ -110,20 +113,25 @@ local default_plugins = {
end,
},
{
"nvim-treesitter/nvim-treesitter-textobjects",
lazy = false,
config = function()
require("nvim-treesitter.configs").setup(
require("plugins.configs.treesitter_textobjects")
)
end,
},
-- git stuff
{
"lewis6991/gitsigns.nvim",
event = "User FilePost",
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,
opts = function()
return require("plugins.configs.others").gitsigns
end,
@@ -146,9 +154,7 @@ 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
vim.cmd("MasonInstall " .. table.concat(opts.ensure_installed, " "))
end, {})
vim.g.mason_binaries_list = opts.ensure_installed
@@ -157,7 +163,9 @@ local default_plugins = {
{
"neovim/nvim-lspconfig",
event = "User FilePost",
init = function()
require("core.utils").lazy_load "nvim-lspconfig"
end,
config = function()
require "plugins.configs.lspconfig"
end,
@@ -229,107 +237,6 @@ local default_plugins = {
end,
},
-- Save and load macro / register
{
"desdic/macrothis.nvim",
opts = {},
keys = {
{ "<Leader>kkd", function() require('macrothis').delete() end, desc = "Delete" },
{ "<Leader>kke", function() require('macrothis').edit() end, desc = "Edit" },
{ "<Leader>kkl", function() require('macrothis').load() end, desc = "Load" },
{ "<Leader>kkn", function() require('macrothis').rename() end, desc = "Rename" },
{ "<Leader>kkq", function() require('macrothis').quickfix() end, desc = "Run macro on all files in quickfix" },
{ "<Leader>kkr", function() require('macrothis').run() end, desc = "Run macro" },
{ "<Leader>kks", function() require('macrothis').save() end, desc = "Save" },
{ "<Leader>kkx", function() require('macrothis').register() end, desc = "Edit register" },
{ "<Leader>kkp", function() require('macrothis').copy_register_printable() end, desc = "Copy register as printable" },
{ "<Leader>kkm", function() require('macrothis').copy_macro_printable() end, desc = "Copy macro as printable" },
}
},
{
"onsails/diaglist.nvim",
lazy=false,
debug=false,
},
{
"anuvyklack/hydra.nvim",
lazy=false,
},
{
"gioele/vim-autoswap",
lazy=false,
},
{
"natecraddock/workspaces.nvim",
lazy=false,
config = function()
require("workspaces").setup({
hooks = {
open = {"Telescope find_files"},
}
})
end,
},
{
"mangelozzi/rgflow.nvim",
lazy=false,
config = function()
require("rgflow").setup({
-- Set the default rip grep flags and options for when running a search via
-- RgFlow. Once changed via the UI, the previous search flags are used for
-- each subsequent search (until Neovim restarts).
cmd_flags = "--smart-case --fixed-strings --ignore --max-columns 200",
-- Mappings to trigger RgFlow functions
default_trigger_mappings = true,
-- These mappings are only active when the RgFlow UI (panel) is open
default_ui_mappings = true,
-- QuickFix window only mapping
default_quickfix_mappings = true,
})
end,
},
{
"yorickpeterse/nvim-window",
lazy=false,
config = function()
require('nvim-window').setup({
normal_hl = 'Normal',
hint_hl = 'Bold',
border = 'single'
})
end,
},
{
"sindrets/winshift.nvim",
lazy=false,
},
{
"kdheepak/lazygit.nvim",
lazy=false,
config = function()
require("lazy").setup({
{
"kdheepak/lazygit.nvim",
-- optional for floating window border decoration
dependencies = {
"nvim-lua/plenary.nvim",
},
},
})
end,
},
-- file managing , picker etc
{
"nvim-tree/nvim-tree.lua",
@@ -348,7 +255,7 @@ local default_plugins = {
{
"nvim-telescope/telescope.nvim",
dependencies = { "nvim-treesitter/nvim-treesitter" },
dependencies = { "nvim-treesitter/nvim-treesitter", { "nvim-telescope/telescope-fzf-native.nvim", build = "make" } },
cmd = "Telescope",
init = function()
require("core.utils").load_mappings "telescope"
@@ -371,7 +278,6 @@ local default_plugins = {
-- Only load whichkey after all the gui
{
"folke/which-key.nvim",
lazy=false,
keys = { "<leader>", "<c-r>", "<c-w>", '"', "'", "`", "c", "v", "g" },
init = function()
require("core.utils").load_mappings "whichkey"
@@ -382,32 +288,6 @@ local default_plugins = {
require("which-key").setup(opts)
end,
},
{
"ThePrimeagen/harpoon",
branch = "harpoon2",
dependencies = { "nvim-lua/plenary.nvim" }
},
{
"folke/noice.nvim",
event = "VeryLazy",
opts = function()
return require "plugins.configs.noice"
end,
dependencies = {
"MunifTanjim/nui.nvim",
-- "rcarriga/nvim-notify",
},
},
{
"folke/todo-comments.nvim",
lazy=false,
dependencies = { "nvim-lua/plenary.nvim" },
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
}
}
}
local config = require("core.utils").load_config()