Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
vishnu-prabu-17366 committed Dec 15, 2023
2 parents 2554d86 + 4a5721d commit a012acd
Show file tree
Hide file tree
Showing 15 changed files with 77 additions and 32 deletions.
2 changes: 1 addition & 1 deletion lua/astronvim/bootstrap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ astronvim.install.config = vim.fn.stdpath("config"):gsub("[^/\\]+$", "astronvim"
-- check if they are the same, protects against NVIM_APPNAME use for isolated install
if astronvim.install.home ~= astronvim.install.config then
vim.opt.rtp:append(astronvim.install.config)
--- supported astronvim user conifg folders
--- supported astronvim user config folders
table.insert(astronvim.supported_configs, astronvim.install.config)
end

Expand Down
1 change: 1 addition & 0 deletions lua/astronvim/mappings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ maps.n["k"] = { "v:count == 0 ? 'gk' : 'k'", expr = true, desc = "Move cursor up
maps.n["<leader>:"] = { "<cmd>FineCmdline<cr>", desc = "Fine Command Line" }
maps.n["<leader>s"] = { "<cmd>w<cr>", desc = "Save" }
maps.n["<leader>q"] = { "<cmd>confirm q<cr>", desc = "Quit" }
maps.n["<leader>Q"] = { "<cmd>confirm qall<cr>", desc = "Quit all" }
maps.n["<leader>n"] = { "<cmd>enew<cr>", desc = "New File" }
maps.n["<C-s>"] = { "<cmd>w!<cr>", desc = "Force write" }
maps.n["<C-q>"] = { "<cmd>qa!<cr>", desc = "Force quit" }
Expand Down
1 change: 1 addition & 0 deletions lua/astronvim/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ local options = astronvim.user_opts("options", {
tabstop = 2, -- number of space in a tab
termguicolors = true, -- enable 24-bit RGB color in the TUI
timeoutlen = 500, -- shorten key timeout length a little bit for which-key
title = true, -- set terminal title to the filename and path
undofile = true, -- enable persistent undo
updatetime = 300, -- length of time to wait before triggering the plugin
virtualedit = "block", -- allow going past end of line in visual block mode
Expand Down
10 changes: 6 additions & 4 deletions lua/astronvim/utils/buffer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,14 @@ function M.sort(compare_func, skip_autocmd)
return false
end

--- Close the current tab
function M.close_tab()
--- Close a given tab
---@param tabpage? integer The tabpage to close or the current tab if not provided
function M.close_tab(tabpage)
if #vim.api.nvim_list_tabpages() > 1 then
vim.t.bufs = nil
tabpage = tabpage or vim.api.nvim_get_current_tabpage()
vim.t[tabpage].bufs = nil
utils.event "BufsUpdated"
vim.cmd.tabclose()
vim.cmd.tabclose(vim.api.nvim_tabpage_get_number(tabpage))
end
end

Expand Down
2 changes: 1 addition & 1 deletion lua/astronvim/utils/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ M.on_attach = function(client, bufnr)
if vim.b.inlay_hints_enabled == nil then vim.b.inlay_hints_enabled = vim.g.inlay_hints_enabled end
-- TODO: remove check after dropping support for Neovim v0.9
if vim.lsp.inlay_hint then
if vim.b.inlay_hints_enabled then vim.lsp.inlay_hint(bufnr, true) end
if vim.b.inlay_hints_enabled then vim.lsp.inlay_hint.enable(bufnr, true) end
lsp_mappings.n["<leader>uH"] = {
function() require("astronvim.utils.ui").toggle_buffer_inlay_hints(bufnr) end,
desc = "Toggle LSP inlay hints (buffer)",
Expand Down
6 changes: 3 additions & 3 deletions lua/astronvim/utils/status/component.lua
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ function M.git_branch(opts)
name = "heirline_branch",
callback = function()
if is_available "telescope.nvim" then
vim.defer_fn(function() require("telescope.builtin").git_branches() end, 100)
vim.defer_fn(function() require("telescope.builtin").git_branches { use_file_path = true } end, 100)
end
end,
},
Expand All @@ -217,7 +217,7 @@ function M.git_diff(opts)
name = "heirline_git",
callback = function()
if is_available "telescope.nvim" then
vim.defer_fn(function() require("telescope.builtin").git_status() end, 100)
vim.defer_fn(function() require("telescope.builtin").git_status { use_file_path = true } end, 100)
end
end,
},
Expand Down Expand Up @@ -352,7 +352,7 @@ function M.foldcolumn(opts)
local fillchars = vim.opt_local.fillchars:get()
if char == (fillchars.foldopen or get_icon "FoldOpened") then
vim.cmd "norm! zc"
elseif char == (fillchars.foldcolse or get_icon "FoldClosed") then
elseif char == (fillchars.foldclose or get_icon "FoldClosed") then
vim.cmd "norm! zo"
end
end,
Expand Down
2 changes: 1 addition & 1 deletion lua/astronvim/utils/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function M.toggle_buffer_inlay_hints(bufnr, silent)
vim.b[bufnr].inlay_hints_enabled = not vim.b[bufnr].inlay_hints_enabled
-- TODO: remove check after dropping support for Neovim v0.9
if vim.lsp.inlay_hint then
vim.lsp.inlay_hint(bufnr, vim.b[bufnr].inlay_hints_enabled)
vim.lsp.inlay_hint.enable(bufnr, vim.b[bufnr].inlay_hints_enabled)
ui_notify(silent, string.format("Inlay hints %s", bool2str(vim.b[bufnr].inlay_hints_enabled)))
end
end
Expand Down
28 changes: 14 additions & 14 deletions lua/lazy_snapshot.lua
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
return {
{ "AstroNvim/astrotheme", version = "^3", optional = true },
{ "JoosepAlviste/nvim-ts-context-commentstring", commit = "92e688f013c69f90c9bbd596019ec10235bc51de", optional = true },
{ "JoosepAlviste/nvim-ts-context-commentstring", commit = "6c30f3c8915d7b31c3decdfe6c7672432da1809d", optional = true },
{ "L3MON4D3/LuaSnip", version = "^2", optional = true },
{ "MunifTanjim/nui.nvim", version = "^0.2", optional = true },
{ "NMAC427/guess-indent.nvim", commit = "b8ae749fce17aa4c267eec80a6984130b94f80b2", optional = true },
{ "NvChad/nvim-colorizer.lua", commit = "dde3084106a70b9a79d48f426f6d6fec6fd203f7", optional = true },
{ "Shatur/neovim-session-manager", commit = "68dde355a4304d83b40cf073f53915604bdd8e70", optional = true },
{ "akinsho/toggleterm.nvim", version = "^2", optional = true },
{ "b0o/SchemaStore.nvim", commit = "686687585c040529f7efa68aa433282068c9d78b", optional = true },
{ "b0o/SchemaStore.nvim", commit = "177cae4f44ddf7c166ef263956378ae308ff77ff", optional = true },
{ "echasnovski/mini.bufremove", commit = "f53c7f27e36009fe61563c11cde154b94a0e5b94", optional = true },
{ "folke/lazy.nvim", version = "^10", optional = true },
{ "folke/neoconf.nvim", version = "^1", optional = true },
{ "folke/neodev.nvim", version = "^2", optional = true },
{ "folke/which-key.nvim", version = "^1", optional = true },
{ "goolord/alpha-nvim", commit = "234822140b265ec4ba3203e3e0be0e0bb826dff5", optional = true },
{ "goolord/alpha-nvim", commit = "29074eeb869a6cbac9ce1fbbd04f5f5940311b32", optional = true },
{ "hrsh7th/cmp-buffer", commit = "3022dbc9166796b644a841a02de8dd1cc1d311fa", optional = true },
{ "hrsh7th/cmp-nvim-lsp", commit = "44b16d11215dce86f253ce0c30949813c0a90765", optional = true },
{ "hrsh7th/cmp-nvim-lsp", commit = "5af77f54de1b16c34b23cba810150689a3a90312", optional = true },
{ "hrsh7th/cmp-path", commit = "91ff86cd9c29299a64f968ebb45846c485725f23", optional = true },
{ "hrsh7th/nvim-cmp", commit = "51260c02a8ffded8e16162dcf41a23ec90cfba62", optional = true },
{ "hrsh7th/nvim-cmp", commit = "41d7633e4146dce1072de32cea31ee31b056a131", optional = true },
{ "jay-babu/mason-null-ls.nvim", version = "^2", optional = true },
{ "jay-babu/mason-nvim-dap.nvim", version = "^2", optional = true },
{ "jose-elias-alvarez/null-ls.nvim", commit = "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7", optional = true },
{ "kevinhwang91/nvim-ufo", version = "^1", optional = true },
{ "kevinhwang91/promise-async", version = "^1", optional = true },
{ "lewis6991/gitsigns.nvim", version = "^0.6", optional = true },
{ "lewis6991/gitsigns.nvim", version = "^0.7", optional = true },
{ "lukas-reineke/indent-blankline.nvim", version = "^3", optional = true },
{ "max397574/better-escape.nvim", commit = "7031dc734add47bb71c010e0551829fa5799375f", optional = true },
{ "mfussenegger/nvim-dap", version = "^0.6", optional = true },
{ "mfussenegger/nvim-dap", version = "^0.7", optional = true },
{ "mrjones2014/smart-splits.nvim", version = "^1", optional = true },
{ "neovim/nvim-lspconfig", commit = "d0467b9574b48429debf83f8248d8cee79562586", optional = true },
{ "neovim/nvim-lspconfig", commit = "f451052bd6804e9e5ccd0ac874d7df8d3d4c55b9", optional = true },
{ "numToStr/Comment.nvim", version = "^0.8", optional = true },
{ "nvim-lua/plenary.nvim", version = "^0.1", optional = true },
{ "nvim-neo-tree/neo-tree.nvim", version = "^3", optional = true },
{ "nvim-telescope/telescope-fzf-native.nvim", commit = "6c921ca12321edaa773e324ef64ea301a1d0da62", optional = true },
{ "nvim-telescope/telescope.nvim", version = "^0.1", optional = true },
{ "nvim-tree/nvim-web-devicons", commit = "5de460ca7595806044eced31e3c36c159a493857", optional = true },
{ "nvim-treesitter/nvim-treesitter", commit = "c5a7533113b2deb7db899d387b877389cc8b6113", optional = true },
{ "nvim-treesitter/nvim-treesitter-textobjects", commit = "e69a504baf2951d52e1f1fbb05145d43f236cbf1", optional = true },
{ "nvim-tree/nvim-web-devicons", commit = "a1425903ab52a0a0460622519e827f224e5b4fee", optional = true },
{ "nvim-treesitter/nvim-treesitter", commit = "42381aae7c1f785e4658cdb34a750be9851ba9af", optional = true },
{ "nvim-treesitter/nvim-treesitter-textobjects", commit = "ec1c5bdb3d87ac971749fa6c7dbc2b14884f1f6a", optional = true },
{ "onsails/lspkind.nvim", commit = "57610d5ab560c073c465d6faf0c19f200cb67e6e", optional = true },
{ "rafamadriz/friendly-snippets", commit = "43727c2ff84240e55d4069ec3e6158d74cb534b6", optional = true },
{ "rcarriga/cmp-dap", commit = "d16f14a210cd28988b97ca8339d504533b7e09a4", optional = true },
{ "rafamadriz/friendly-snippets", commit = "53d3df271d031c405255e99410628c26a8f0d2b0", optional = true },
{ "rcarriga/cmp-dap", commit = "ea92773e84c0ad3288c3bc5e452ac91559669087", optional = true },
{ "rcarriga/nvim-dap-ui", version = "^3", optional = true },
{ "rcarriga/nvim-notify", version = "^3", optional = true },
{ "rebelot/heirline.nvim", version = "^1", optional = true },
Expand All @@ -50,5 +50,5 @@ return {
{ "williamboman/mason-lspconfig.nvim", version = "^1", optional = true },
{ "williamboman/mason.nvim", version = "^1", optional = true },
{ "windwp/nvim-autopairs", commit = "0f04d78619cce9a5af4f355968040f7d675854a1", optional = true },
{ "windwp/nvim-ts-autotag", commit = "6be1192965df35f94b8ea6d323354f7dc7a557e4", optional = true },
{ "windwp/nvim-ts-autotag", commit = "8515e48a277a2f4947d91004d9aa92c29fdc5e18", optional = true },
}
1 change: 1 addition & 0 deletions lua/plugins/cmp.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
return {
{
"L3MON4D3/LuaSnip",
lazy = true,
build = vim.fn.has "win32" == 0
and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build\n'; make install_jsregexp"
or nil,
Expand Down
12 changes: 11 additions & 1 deletion lua/plugins/configs/nvim-treesitter.lua
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
return function(_, opts) require("nvim-treesitter.configs").setup(opts) end
return function(_, opts)
if type(opts.ensure_installed) == "table" then
local added = {}
opts.ensure_installed = vim.tbl_filter(function(parser)
if added[parser] then return false end
added[parser] = true
return true
end, opts.ensure_installed)
end
require("nvim-treesitter.configs").setup(opts)
end
9 changes: 6 additions & 3 deletions lua/plugins/core.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
return {
"nvim-lua/plenary.nvim",
"echasnovski/mini.bufremove",
{ "AstroNvim/astrotheme", opts = { plugins = { ["dashboard-nvim"] = true } } },
{ "nvim-lua/plenary.nvim", lazy = true },
{ "echasnovski/mini.bufremove", lazy = true },
{ "AstroNvim/astrotheme", lazy = true, opts = { plugins = { ["dashboard-nvim"] = true } } },
{ "max397574/better-escape.nvim", event = "InsertCharPre", opts = { timeout = 300 } },
{ "NMAC427/guess-indent.nvim", event = "User AstroFile", config = require "plugins.configs.guess-indent" },
{ -- TODO: REMOVE neovim-session-manager with AstroNvim v4
Expand All @@ -13,6 +13,7 @@ return {
{
"stevearc/resession.nvim",
enabled = vim.g.resession_enabled == true,
lazy = true,
opts = {
buf_filter = function(bufnr) return require("astronvim.utils.buffer").is_restorable(bufnr) end,
tab_buf_filter = function(tabpage, bufnr) return vim.tbl_contains(vim.t[tabpage].bufs, bufnr) end,
Expand All @@ -21,11 +22,13 @@ return {
},
{
"s1n7ax/nvim-window-picker",
lazy = true,
main = "window-picker",
opts = { picker_config = { statusline_winbar_picker = { use_winbar = "smart" } } },
},
{
"mrjones2014/smart-splits.nvim",
lazy = true,
opts = { ignored_filetypes = { "nofile", "quickfix", "qf", "prompt" }, ignored_buftypes = { "nofile" } },
},
{
Expand Down
2 changes: 1 addition & 1 deletion lua/plugins/heirline.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ return {
"NvimTree",
"OverseerList",
"aerial",
"dap-repl",
"dap%-repl",
"dapui_.",
"edgy",
"neo%-tree",
Expand Down
3 changes: 2 additions & 1 deletion lua/plugins/lsp.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
return {
"b0o/SchemaStore.nvim",
{ "b0o/SchemaStore.nvim", lazy = true },
{
"folke/neodev.nvim",
lazy = true,
opts = {
override = function(root_dir, library)
for _, astronvim_config in ipairs(astronvim.supported_configs) do
Expand Down
26 changes: 24 additions & 2 deletions lua/plugins/treesitter.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
return {
"nvim-treesitter/nvim-treesitter",
dependencies = {
"JoosepAlviste/nvim-ts-context-commentstring",
{ "JoosepAlviste/nvim-ts-context-commentstring", commit = "6c30f3c8915d7b31c3decdfe6c7672432da1809d" },
"nvim-treesitter/nvim-treesitter-textobjects",
"nvim-treesitter/nvim-tree-docs",
-- HACK: remove when https://github.com/windwp/nvim-ts-autotag/issues/125 closed.
{ "windwp/nvim-ts-autotag", opts = { autotag = { enable_close_on_slash = false } } },
{ "windwp/nvim-ts-autotag", opts = { enable_close_on_slash = false } },
},
event = "User AstroFile",
cmd = {
Expand All @@ -24,10 +24,32 @@ return {
"TSUpdateSync",
},
build = ":TSUpdate",
init = function(plugin)
-- PERF: add nvim-treesitter queries to the rtp and it's custom query predicates early
-- This is needed because a bunch of plugins no longer `require("nvim-treesitter")`, which
-- no longer trigger the **nvim-treeitter** module to be loaded in time.
-- Luckily, the only thins that those plugins need are the custom queries, which we make available
-- during startup.
-- CODE FROM LazyVim (thanks folke!) https://github.com/LazyVim/LazyVim/commit/1e1b68d633d4bd4faa912ba5f49ab6b8601dc0c9
require("lazy.core.loader").add_to_rtp(plugin)
require "nvim-treesitter.query_predicates"
end,
opts = function()
return {
autotag = { enable = true },
context_commentstring = { enable = true, enable_autocmd = false },
-- HACK: force install of shipped neovim parsers since TSUpdate doesn't correctly update them
ensure_installed = {
"bash",
"c",
"lua",
"markdown",
"markdown_inline",
"python",
"query",
"vim",
"vimdoc",
},
highlight = {
enable = true,
disable = function(_, bufnr) return vim.b[bufnr].large_buf end,
Expand Down
4 changes: 4 additions & 0 deletions lua/plugins/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ return {
{
"nvim-tree/nvim-web-devicons",
enabled = vim.g.icons_enabled,
lazy = true,
opts = {
override = {
default_icon = { icon = require("astronvim.utils").get_icon "DefaultFile" },
Expand All @@ -22,6 +23,7 @@ return {
},
{
"onsails/lspkind.nvim",
lazy = true,
opts = {
mode = "symbol",
symbol_map = {
Expand Down Expand Up @@ -49,6 +51,7 @@ return {
},
{
"rcarriga/nvim-notify",
lazy = true,
init = function() require("astronvim.utils").load_plugin_with_func("nvim-notify", vim, "notify") end,
opts = {
on_open = function(win)
Expand All @@ -65,6 +68,7 @@ return {
},
{
"stevearc/dressing.nvim",
lazy = true,
init = function() require("astronvim.utils").load_plugin_with_func("dressing.nvim", vim.ui, { "input", "select" }) end,
opts = {
input = { default_prompt = "" },
Expand Down

0 comments on commit a012acd

Please sign in to comment.