aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--awesome/.config/awesome/rc.lua40
-rw-r--r--kitty/.config/kitty/current-theme.conf2
-rw-r--r--nvim/.config/nvim/.github/README.md18
-rw-r--r--nvim/.config/nvim/.github/workflows/conventional_commit.yml4
-rw-r--r--nvim/.config/nvim/.github/workflows/docs.yml2
-rw-r--r--nvim/.config/nvim/.github/workflows/luacheck.yml2
-rw-r--r--nvim/.config/nvim/.github/workflows/spell.yml2
-rw-r--r--nvim/.config/nvim/.github/workflows/style.yml2
-rw-r--r--nvim/.config/nvim/.gitignore39
-rw-r--r--nvim/.config/nvim/init.lua5
-rw-r--r--nvim/.config/nvim/lua/astronvim/autocmds.lua18
-rw-r--r--nvim/.config/nvim/lua/astronvim/health.lua25
-rw-r--r--nvim/.config/nvim/lua/astronvim/icons/nerd_font.lua22
-rw-r--r--nvim/.config/nvim/lua/astronvim/lazy.lua2
-rw-r--r--nvim/.config/nvim/lua/astronvim/mappings.lua96
-rw-r--r--nvim/.config/nvim/lua/astronvim/options.lua3
-rw-r--r--nvim/.config/nvim/lua/astronvim/utils/buffer.lua93
-rw-r--r--nvim/.config/nvim/lua/astronvim/utils/init.lua35
-rw-r--r--nvim/.config/nvim/lua/astronvim/utils/lsp.lua48
-rw-r--r--nvim/.config/nvim/lua/astronvim/utils/status.lua76
-rw-r--r--nvim/.config/nvim/lua/astronvim/utils/ui.lua15
-rw-r--r--nvim/.config/nvim/lua/astronvim/utils/updater.lua2
-rw-r--r--nvim/.config/nvim/lua/lazy_snapshot.lua46
-rw-r--r--nvim/.config/nvim/lua/plugins/alpha.lua4
-rw-r--r--nvim/.config/nvim/lua/plugins/configs/alpha.lua2
-rw-r--r--nvim/.config/nvim/lua/plugins/configs/mason-lspconfig.lua6
-rw-r--r--nvim/.config/nvim/lua/plugins/configs/mason-nvim-dap.lua2
-rw-r--r--nvim/.config/nvim/lua/plugins/configs/nvim-web-devicons.lua1
-rw-r--r--nvim/.config/nvim/lua/plugins/core.lua16
-rw-r--r--nvim/.config/nvim/lua/plugins/dap.lua3
-rw-r--r--nvim/.config/nvim/lua/plugins/git.lua3
-rw-r--r--nvim/.config/nvim/lua/plugins/lsp.lua6
-rw-r--r--nvim/.config/nvim/lua/plugins/mason.lua1
-rw-r--r--nvim/.config/nvim/lua/plugins/neo-tree.lua135
-rw-r--r--nvim/.config/nvim/lua/plugins/treesitter.lua5
-rw-r--r--nvim/.config/nvim/lua/plugins/ui.lua44
-rw-r--r--nvim/.config/nvim/lua/resession/extensions/astronvim.lua32
m---------nvim/.config/nvim/lua/user0
38 files changed, 605 insertions, 252 deletions
diff --git a/awesome/.config/awesome/rc.lua b/awesome/.config/awesome/rc.lua
index c64d457..b94aaa1 100644
--- a/awesome/.config/awesome/rc.lua
+++ b/awesome/.config/awesome/rc.lua
@@ -26,7 +26,7 @@ local freedesktop = require("freedesktop")
-- when client with a matching name is opened:
local hotkeys_popup = require("awful.hotkeys_popup").widget
require("awful.hotkeys_popup.keys")
-local my_table = awful.util.table or gears.table -- 4.{0,1} compatibility
+local my_table = awful.util.table or gears.table -- 4.{0,1} compatibility
local dpi = require("beautiful.xresources").apply_dpi
-- }}}
@@ -337,25 +337,33 @@ globalkeys = my_table.join(
-- alt + ...
awful.key({ altkey, "Shift" }, "t",
- function() awful.spawn.with_shell(
- "variety -t && wal -i $(cat $HOME/.config/variety/wallpaper/wallpaper.jpg.txt)&") end,
+ function()
+ awful.spawn.with_shell(
+ "variety -t && wal -i $(cat $HOME/.config/variety/wallpaper/wallpaper.jpg.txt)&")
+ end,
{ description = "Pywal Wallpaper trash", group = "altkey" }),
awful.key({ altkey, "Shift" }, "n",
- function() awful.spawn.with_shell(
- "variety -n && wal -i $(cat $HOME/.config/variety/wallpaper/wallpaper.jpg.txt)&") end,
+ function()
+ awful.spawn.with_shell(
+ "variety -n && wal -i $(cat $HOME/.config/variety/wallpaper/wallpaper.jpg.txt)&")
+ end,
{ description = "Pywal Wallpaper next", group = "altkey" }),
awful.key({ altkey, "Shift" }, "u",
function() awful.spawn.with_shell("wal -i $(cat $HOME/.config/variety/wallpaper/wallpaper.jpg.txt)&") end,
{ description = "Pywal Wallpaper update", group = "altkey" }),
awful.key({ altkey, "Shift" }, "p",
- function() awful.spawn.with_shell(
- "variety -p && wal -i $(cat $HOME/.config/variety/wallpaper/wallpaper.jpg.txt)&") end,
+ function()
+ awful.spawn.with_shell(
+ "variety -p && wal -i $(cat $HOME/.config/variety/wallpaper/wallpaper.jpg.txt)&")
+ end,
{ description = "Pywal Wallpaper previous", group = "altkey" }),
-- screenshots
awful.key({}, "Print",
- function() awful.util.spawn(
- "scrot 'ArcoLinux-%Y-%m-%d-%s_screenshot_$wx$h.jpg' -e 'mv $f $$(xdg-user-dir PICTURES)'") end,
+ function()
+ awful.util.spawn(
+ "scrot 'ArcoLinux-%Y-%m-%d-%s_screenshot_$wx$h.jpg' -e 'mv $f $$(xdg-user-dir PICTURES)'")
+ end,
{ description = "Scrot", group = "screenshots" }),
awful.key({ modkey1 }, "Print", function() awful.util.spawn("xfce4-screenshooter") end,
{ description = "Xfce screenshot", group = "screenshots" }),
@@ -593,7 +601,7 @@ globalkeys = my_table.join(
awful.key({}, "XF86AudioMute",
function()
os.execute(string.format("amixer -q set %s toggle",
- beautiful.volume.togglechannel or beautiful.volume.channel))
+ beautiful.volume.togglechannel or beautiful.volume.channel))
beautiful.volume.update()
end),
awful.key({ modkey1, "Shift" }, "m",
@@ -775,7 +783,7 @@ awful.rules.rules = {
{
rule_any = {
instance = {
- "DTA", -- Firefox addon DownThemAll.
+ "DTA", -- Firefox addon DownThemAll.
"copyq", -- Includes session name in class.
},
class = {
@@ -805,7 +813,7 @@ awful.rules.rules = {
},
role = {
"AlarmWindow", -- Thunderbird's calendar.
- "pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
+ "pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
"Preferences",
"setup",
}
@@ -867,15 +875,15 @@ client.connect_signal("request::titlebars", function(c)
awful.titlebar(c, { size = dpi(21) }):setup {
{
- -- Left
+ -- Left
awful.titlebar.widget.iconwidget(c),
buttons = buttons,
layout = wibox.layout.fixed.horizontal
},
{
- -- Middle
+ -- Middle
{
- -- Title
+ -- Title
align = "center",
widget = awful.titlebar.widget.titlewidget(c)
},
@@ -883,7 +891,7 @@ client.connect_signal("request::titlebars", function(c)
layout = wibox.layout.flex.horizontal
},
{
- -- Right
+ -- Right
awful.titlebar.widget.floatingbutton(c),
awful.titlebar.widget.maximizedbutton(c),
awful.titlebar.widget.stickybutton(c),
diff --git a/kitty/.config/kitty/current-theme.conf b/kitty/.config/kitty/current-theme.conf
index fd9aa9f..02e44b1 100644
--- a/kitty/.config/kitty/current-theme.conf
+++ b/kitty/.config/kitty/current-theme.conf
@@ -10,7 +10,7 @@
# The basic colors
foreground #CDD6F4
-background #000000
+background #000011
selection_foreground #1E1E2E
selection_background #F5E0DC
diff --git a/nvim/.config/nvim/.github/README.md b/nvim/.config/nvim/.github/README.md
index 54bdad8..12d91e7 100644
--- a/nvim/.config/nvim/.github/README.md
+++ b/nvim/.config/nvim/.github/README.md
@@ -84,6 +84,8 @@ AstroNvim is an aesthetic and feature-rich neovim config that is extensible and
## 🛠️ Installation
+### Linux/Mac OS (Unix)
+
#### Make a backup of your current nvim and shared folder
```shell
@@ -98,6 +100,22 @@ git clone --depth 1 https://github.com/AstroNvim/AstroNvim ~/.config/nvim
nvim
```
+### Windows (Powershell)
+
+#### Make a backup of your current nvim and nvim-data folder
+
+```pwsh
+Rename-Item -Path $env:LOCALAPPDATA\nvim -NewName $env:LOCALAPPDATA\nvim.bak
+Rename-Item -Path $env:LOCALAPPDATA\nvim-data -NewName $env:LOCALAPPDATA\nvim-data.bak
+```
+
+#### Clone the repository
+
+```pwsh
+git clone --depth 1 https://github.com/AstroNvim/AstroNvim $env:LOCALAPPDATA\nvim
+nvim
+```
+
## 📦 Basic Setup
#### Install LSP
diff --git a/nvim/.config/nvim/.github/workflows/conventional_commit.yml b/nvim/.config/nvim/.github/workflows/conventional_commit.yml
index 76819c4..c8d3558 100644
--- a/nvim/.config/nvim/.github/workflows/conventional_commit.yml
+++ b/nvim/.config/nvim/.github/workflows/conventional_commit.yml
@@ -2,7 +2,7 @@ name: Conventional Commits
on:
pull_request:
- branches: [ main ]
+ branches: [main]
jobs:
build:
@@ -10,4 +10,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- - uses: webiny/action-conventional-commits@v1.0.3
+ - uses: webiny/action-conventional-commits@v1.1.0
diff --git a/nvim/.config/nvim/.github/workflows/docs.yml b/nvim/.config/nvim/.github/workflows/docs.yml
index 67a997d..47ce3b6 100644
--- a/nvim/.config/nvim/.github/workflows/docs.yml
+++ b/nvim/.config/nvim/.github/workflows/docs.yml
@@ -11,7 +11,7 @@ jobs:
steps:
- name: Checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
- name: Setup Lua
uses: leafo/gh-actions-lua@v8
with:
diff --git a/nvim/.config/nvim/.github/workflows/luacheck.yml b/nvim/.config/nvim/.github/workflows/luacheck.yml
index f8d48a7..87111d6 100644
--- a/nvim/.config/nvim/.github/workflows/luacheck.yml
+++ b/nvim/.config/nvim/.github/workflows/luacheck.yml
@@ -9,5 +9,5 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- uses: lunarmodules/luacheck@v1
diff --git a/nvim/.config/nvim/.github/workflows/spell.yml b/nvim/.config/nvim/.github/workflows/spell.yml
index 7bae68e..463606f 100644
--- a/nvim/.config/nvim/.github/workflows/spell.yml
+++ b/nvim/.config/nvim/.github/workflows/spell.yml
@@ -11,4 +11,4 @@ jobs:
- name: Checkout Actions Repository
uses: actions/checkout@v3
- name: Check spelling
- uses: crate-ci/typos@v1.13.26
+ uses: crate-ci/typos@v1.14.5
diff --git a/nvim/.config/nvim/.github/workflows/style.yml b/nvim/.config/nvim/.github/workflows/style.yml
index 3473f5e..f666542 100644
--- a/nvim/.config/nvim/.github/workflows/style.yml
+++ b/nvim/.config/nvim/.github/workflows/style.yml
@@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- - uses: JohnnyMorganz/stylua-action@v2
+ - uses: JohnnyMorganz/stylua-action@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest
diff --git a/nvim/.config/nvim/.gitignore b/nvim/.config/nvim/.gitignore
index 11b67c8..9ed7e4c 100644
--- a/nvim/.config/nvim/.gitignore
+++ b/nvim/.config/nvim/.gitignore
@@ -1,9 +1,46 @@
+# Project gitignore
!colors/astronvim.lua
colors/*
docs
ginit.vim
-lua/user
plugin
ftplugin
spell
+.github
.luarc.json
+
+# Global gitignore
+# ----------------
+
+# Mac OS X
+.DS_Store
+.AppleDouble
+.LSOverride
+._*
+
+# Windoze
+Thumbs.db
+Thumbs.db:encryptable
+ehthumbs.db
+ehthumbs_vista.db
+$RECYCLE.BIN/
+
+# (Neo)Vim
+[._]*.s[a-v][a-z]
+[._]*.sw[a-p]
+[._]s[a-rt-v][a-z]
+[._]ss[a-gi-z]
+[._]sw[a-p]
+Session.vim
+Sessionx.vim
+.netrwhist
+*~
+tags
+[._]*.un~
+
+# VS Code
+.vscode
+.history
+
+# JetBrains
+.idea
diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua
index a887f21..4f67424 100644
--- a/nvim/.config/nvim/init.lua
+++ b/nvim/.config/nvim/init.lua
@@ -11,7 +11,10 @@ end
if astronvim.default_colorscheme then
if not pcall(vim.cmd.colorscheme, astronvim.default_colorscheme) then
- require("astronvim.utils").notify("Error setting up colorscheme: " .. astronvim.default_colorscheme, "error")
+ require("astronvim.utils").notify(
+ "Error setting up colorscheme: " .. astronvim.default_colorscheme,
+ vim.log.levels.ERROR
+ )
end
end
diff --git a/nvim/.config/nvim/lua/astronvim/autocmds.lua b/nvim/.config/nvim/lua/astronvim/autocmds.lua
index c3b1734..7b47b6e 100644
--- a/nvim/.config/nvim/lua/astronvim/autocmds.lua
+++ b/nvim/.config/nvim/lua/astronvim/autocmds.lua
@@ -15,7 +15,7 @@ vim.on_key(function(char)
end, namespace "auto_hlsearch")
local bufferline_group = augroup("bufferline", { clear = true })
-autocmd({ "BufAdd", "BufEnter" }, {
+autocmd({ "BufAdd", "BufEnter", "TabNewEntered" }, {
desc = "Update buffers when adding new buffers",
group = bufferline_group,
callback = function(args)
@@ -151,6 +151,8 @@ if is_available "alpha-nvim" then
vim.opt.showtabline = 0
vim.opt_local.winbar = nil
autocmd("BufUnload", {
+ desc = "Reenable status and tablines for alpha",
+ group = group_name,
pattern = "<buffer>",
callback = function()
vim.opt.laststatus = prev_status
@@ -179,6 +181,18 @@ if is_available "alpha-nvim" then
})
end
+if is_available "resession.nvim" then
+ autocmd("VimLeavePre", {
+ desc = "Save session on close",
+ group = augroup("resession_auto_save", { clear = true }),
+ callback = function()
+ local save = require("resession").save
+ save "Last Session"
+ save(vim.fn.getcwd(), { dir = "dirsession", notify = false })
+ end,
+ })
+end
+
if is_available "neo-tree.nvim" then
autocmd("BufEnter", {
desc = "Open Neo-Tree on startup with directory",
@@ -214,6 +228,7 @@ autocmd({ "VimEnter", "ColorScheme" }, {
})
autocmd({ "BufReadPost", "BufNewFile" }, {
+ desc = "AstroNvim user events for file detection (AstroFile and AstroGitFile)",
group = augroup("file_user_events", { clear = true }),
callback = function(args)
if not (vim.fn.expand "%" == "" or vim.api.nvim_get_option_value("buftype", { buf = args.buf }) == "nofile") then
@@ -236,3 +251,4 @@ cmd(
cmd("AstroRollback", function() require("astronvim.utils.updater").rollback() end, { desc = "Rollback AstroNvim" })
cmd("AstroUpdate", function() require("astronvim.utils.updater").update() end, { desc = "Update AstroNvim" })
cmd("AstroVersion", function() require("astronvim.utils.updater").version() end, { desc = "Check AstroNvim Version" })
+cmd("AstroReload", function() require("astronvim.utils").reload() end, { desc = "Reload AstroNvim (Experimental)" })
diff --git a/nvim/.config/nvim/lua/astronvim/health.lua b/nvim/.config/nvim/lua/astronvim/health.lua
index 9e48adf..d1fa8a6 100644
--- a/nvim/.config/nvim/lua/astronvim/health.lua
+++ b/nvim/.config/nvim/lua/astronvim/health.lua
@@ -1,17 +1,26 @@
local M = {}
+-- TODO: remove deprecated method check after dropping support for neovim v0.9
+local health = {
+ start = vim.health.start or vim.health.report_start,
+ ok = vim.health.ok or vim.health.report_ok,
+ warn = vim.health.warn or vim.health.report_warn,
+ error = vim.health.error or vim.health.report_error,
+ info = vim.health.info or vim.health.report_info,
+}
+
function M.check()
- vim.health.report_start "AstroNvim"
+ health.start "AstroNvim"
- vim.health.report_info("AstroNvim Version: " .. require("astronvim.utils.updater").version(true))
- vim.health.report_info("Neovim Version: v" .. vim.fn.matchstr(vim.fn.execute "version", "NVIM v\\zs[^\n]*"))
+ health.info("AstroNvim Version: " .. require("astronvim.utils.updater").version(true))
+ health.info("Neovim Version: v" .. vim.fn.matchstr(vim.fn.execute "version", "NVIM v\\zs[^\n]*"))
if vim.version().prerelease then
- vim.health.report_warn "Neovim nightly is not officially supported and may have breaking changes"
+ health.warn "Neovim nightly is not officially supported and may have breaking changes"
elseif vim.fn.has "nvim-0.8" == 1 then
- vim.health.report_ok "Using stable Neovim >= 0.8.0"
+ health.ok "Using stable Neovim >= 0.8.0"
else
- vim.health.report_error "Neovim >= 0.8.0 is required"
+ health.error "Neovim >= 0.8.0 is required"
end
local programs = {
@@ -41,9 +50,9 @@ function M.check()
end
if found then
- vim.health.report_ok(("`%s` is installed: %s"):format(name, program.msg))
+ health.ok(("`%s` is installed: %s"):format(name, program.msg))
else
- vim.health["report_" .. program.type](("`%s` is not installed: %s"):format(name, program.msg))
+ health[program.type](("`%s` is not installed: %s"):format(name, program.msg))
end
end
end
diff --git a/nvim/.config/nvim/lua/astronvim/icons/nerd_font.lua b/nvim/.config/nvim/lua/astronvim/icons/nerd_font.lua
index d6f7f47..8b0a91f 100644
--- a/nvim/.config/nvim/lua/astronvim/icons/nerd_font.lua
+++ b/nvim/.config/nvim/lua/astronvim/icons/nerd_font.lua
@@ -3,17 +3,17 @@ return {
ActiveTS = "",
ArrowLeft = "",
ArrowRight = "",
- BufferClose = "",
+ BufferClose = "󰅖",
DapBreakpoint = "",
DapBreakpointCondition = "",
DapBreakpointRejected = "",
DapLogPoint = ".>",
- DapStopped = "",
- DefaultFile = "",
- Diagnostic = "裂",
+ DapStopped = "󰁕",
+ DefaultFile = "󰈙",
+ Diagnostic = "󰒡",
DiagnosticError = "",
- DiagnosticHint = "",
- DiagnosticInfo = "",
+ DiagnosticHint = "󰌵",
+ DiagnosticInfo = "󰋼",
DiagnosticWarn = "",
Ellipsis = "…",
FileModified = "",
@@ -24,7 +24,7 @@ return {
FolderClosed = "",
FolderEmpty = "",
FolderOpen = "",
- Git = "",
+ Git = "󰊢",
GitAdd = "",
GitBranch = "",
GitChange = "",
@@ -37,12 +37,12 @@ return {
GitUntracked = "★",
LSPLoaded = "",
LSPLoading1 = "",
- LSPLoading2 = "",
+ LSPLoading2 = "󰀚",
LSPLoading3 = "",
MacroRecording = "",
- Paste = "",
+ Paste = "󰅌",
Search = "",
Selected = "❯",
- Spellcheck = "暈",
- TabClose = "",
+ Spellcheck = "󰓆",
+ TabClose = "󰅙",
}
diff --git a/nvim/.config/nvim/lua/astronvim/lazy.lua b/nvim/.config/nvim/lua/astronvim/lazy.lua
index 0a5bd32..d918c24 100644
--- a/nvim/.config/nvim/lua/astronvim/lazy.lua
+++ b/nvim/.config/nvim/lua/astronvim/lazy.lua
@@ -37,7 +37,7 @@ require("lazy").setup(astronvim.user_opts("lazy", {
performance = {
rtp = {
paths = astronvim.supported_configs,
- disabled_plugins = { "tohtml", "gzip", "matchit", "zipPlugin", "netrwPlugin", "tarPlugin" },
+ disabled_plugins = { "tohtml", "gzip", "zipPlugin", "netrwPlugin", "tarPlugin" },
},
},
lockfile = vim.fn.stdpath "data" .. "/lazy-lock.json",
diff --git a/nvim/.config/nvim/lua/astronvim/mappings.lua b/nvim/.config/nvim/lua/astronvim/mappings.lua
index b7a486a..7301d7b 100644
--- a/nvim/.config/nvim/lua/astronvim/mappings.lua
+++ b/nvim/.config/nvim/lua/astronvim/mappings.lua
@@ -10,8 +10,9 @@ local sections = {
l = { desc = " LSP" },
u = { desc = " UI" },
b = { desc = "󰓩 Buffers" },
+ bs = { desc = "󰒺 Sort Buffers" },
d = { desc = " Debugger" },
- g = { desc = " Git" },
+ g = { desc = "󰊢 Git" },
S = { desc = "󱂬 Session" },
t = { desc = " Terminal" },
}
@@ -19,10 +20,8 @@ if not vim.g.icons_enabled then vim.tbl_map(function(opts) opts.desc = opts.desc
-- Normal --
-- Standard Operations
-maps.n["j"] = { "v:count ? 'j' : 'gj'", expr = true, desc = "Move cursor down" }
-maps.n["k"] = { "v:count ? 'k' : 'gk'", expr = true, desc = "Move cursor up" }
-maps.v["j"] = maps.n.j
-maps.v["k"] = maps.n.k
+maps.n["j"] = { "v:count == 0 ? 'gj' : 'j'", expr = true, desc = "Move cursor down" }
+maps.n["k"] = { "v:count == 0 ? 'gk' : 'k'", expr = true, desc = "Move cursor up" }
maps.n["<leader>w"] = { "<cmd>w<cr>", desc = "Save" }
maps.n["<leader>q"] = { "<cmd>confirm q<cr>", desc = "Quit" }
maps.n["<leader>n"] = { "<cmd>enew<cr>", desc = "New File" }
@@ -50,7 +49,7 @@ maps.n["<leader>pl"] = { "<cmd>AstroChangelog<cr>", desc = "AstroNvim Changelog"
maps.n["<leader>c"] = { function() require("astronvim.utils.buffer").close() end, desc = "Close buffer" }
maps.n["<leader>C"] = { function() require("astronvim.utils.buffer").close(0, true) end, desc = "Force close buffer" }
maps.n["]b"] =
-{ function() require("astronvim.utils.buffer").nav(vim.v.count > 0 and vim.v.count or 1) end, desc = "Next buffer" }
+ { function() require("astronvim.utils.buffer").nav(vim.v.count > 0 and vim.v.count or 1) end, desc = "Next buffer" }
maps.n["[b"] = {
function() require("astronvim.utils.buffer").nav(-(vim.v.count > 0 and vim.v.count or 1)) end,
desc = "Previous buffer",
@@ -66,7 +65,7 @@ maps.n["<b"] = {
maps.n["<leader>b"] = sections.b
maps.n["<leader>bc"] =
-{ function() require("astronvim.utils.buffer").close_all(true) end, desc = "Close all buffers except current" }
+ { function() require("astronvim.utils.buffer").close_all(true) end, desc = "Close all buffers except current" }
maps.n["<leader>bC"] = { function() require("astronvim.utils.buffer").close_all() end, desc = "Close all buffers" }
maps.n["<leader>bb"] = {
function()
@@ -82,6 +81,21 @@ maps.n["<leader>bd"] = {
end,
desc = "Delete buffer from tabline",
}
+maps.n["<leader>bl"] =
+ { function() require("astronvim.utils.buffer").close_left() end, desc = "Close all buffers to the left" }
+maps.n["<leader>br"] =
+ { function() require("astronvim.utils.buffer").close_right() end, desc = "Close all buffers to the right" }
+maps.n["<leader>bs"] = sections.bs
+maps.n["<leader>bse"] =
+ { function() require("astronvim.utils.buffer").sort "extension" end, desc = "Sort by extension (buffers)" }
+maps.n["<leader>bsr"] =
+ { function() require("astronvim.utils.buffer").sort "unique_path" end, desc = "Sort by relative path (buffers)" }
+maps.n["<leader>bsp"] =
+ { function() require("astronvim.utils.buffer").sort "full_path" end, desc = "Sort by full path (buffers)" }
+maps.n["<leader>bsi"] =
+ { function() require("astronvim.utils.buffer").sort "bufnr" end, desc = "Sort by buffer number (buffers)" }
+maps.n["<leader>bsm"] =
+ { function() require("astronvim.utils.buffer").sort "modified" end, desc = "Sort by modification (buffers)" }
maps.n["<leader>b\\"] = {
function()
require("astronvim.utils.status").heirline.buffer_picker(function(bufnr)
@@ -126,7 +140,7 @@ if is_available "Comment.nvim" then
desc = "Comment line",
}
maps.v["<leader>/"] =
- { "<esc><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<cr>", desc = "Toggle comment line" }
+ { "<esc><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<cr>", desc = "Toggle comment line" }
end
-- GitSigns
@@ -168,7 +182,19 @@ if is_available "neovim-session-manager" then
maps.n["<leader>Sd"] = { "<cmd>SessionManager! delete_session<cr>", desc = "Delete session" }
maps.n["<leader>Sf"] = { "<cmd>SessionManager! load_session<cr>", desc = "Search sessions" }
maps.n["<leader>S."] =
- { "<cmd>SessionManager! load_current_dir_session<cr>", desc = "Load current directory session" }
+ { "<cmd>SessionManager! load_current_dir_session<cr>", desc = "Load current directory session" }
+end
+if is_available "resession.nvim" then
+ maps.n["<leader>S"] = sections.S
+ maps.n["<leader>Sl"] = { function() require("resession").load "Last Session" end, desc = "Load last session" }
+ maps.n["<leader>Ss"] = { function() require("resession").save() end, desc = "Save this session" }
+ maps.n["<leader>St"] = { function() require("resession").save_tab() end, desc = "Save this tab's session" }
+ maps.n["<leader>Sd"] = { function() require("resession").delete() end, desc = "Delete a session" }
+ maps.n["<leader>Sf"] = { function() require("resession").load() end, desc = "Load a session" }
+ maps.n["<leader>S."] = {
+ function() require("resession").load(vim.fn.getcwd(), { dir = "dirsession" }) end,
+ desc = "Load current directory session",
+ }
end
-- Package Manager
@@ -217,11 +243,11 @@ if is_available "telescope.nvim" then
function()
local cwd = vim.fn.stdpath "config" .. "/.."
local search_dirs = {}
- for _, dir in ipairs(astronvim.supported_configs) do -- search all supported config locations
- if dir == astronvim.install.home then dir = dir .. "/lua/user" end -- don't search the astronvim core files
+ for _, dir in ipairs(astronvim.supported_configs) do -- search all supported config locations
+ if dir == astronvim.install.home then dir = dir .. "/lua/user" end -- don't search the astronvim core files
if vim.fn.isdirectory(dir) == 1 then table.insert(search_dirs, dir) end -- add directory to search if exists
end
- if vim.tbl_isempty(search_dirs) then -- if no config folders found, show warning
+ if vim.tbl_isempty(search_dirs) then -- if no config folders found, show warning
utils.notify("No user configuration files found", vim.log.levels.WARN)
else
if #search_dirs == 1 then cwd = search_dirs[1] end -- if only one directory, focus cwd
@@ -236,7 +262,7 @@ if is_available "telescope.nvim" then
}
maps.n["<leader>fb"] = { function() require("telescope.builtin").buffers() end, desc = "Find buffers" }
maps.n["<leader>fc"] =
- { function() require("telescope.builtin").grep_string() end, desc = "Find for word under cursor" }
+ { function() require("telescope.builtin").grep_string() end, desc = "Find for word under cursor" }
maps.n["<leader>fC"] = { function() require("telescope.builtin").commands() end, desc = "Find commands" }
maps.n["<leader>ff"] = { function() require("telescope.builtin").find_files() end, desc = "Find files" }
maps.n["<leader>fF"] = {
@@ -248,12 +274,12 @@ if is_available "telescope.nvim" then
maps.n["<leader>fm"] = { function() require("telescope.builtin").man_pages() end, desc = "Find man" }
if is_available "nvim-notify" then
maps.n["<leader>fn"] =
- { function() require("telescope").extensions.notify.notify() end, desc = "Find notifications" }
+ { function() require("telescope").extensions.notify.notify() end, desc = "Find notifications" }
end
maps.n["<leader>fo"] = { function() require("telescope.builtin").oldfiles() end, desc = "Find history" }
maps.n["<leader>fr"] = { function() require("telescope.builtin").registers() end, desc = "Find registers" }
maps.n["<leader>ft"] =
- { function() require("telescope.builtin").colorscheme { enable_preview = true } end, desc = "Find themes" }
+ { function() require("telescope.builtin").colorscheme { enable_preview = true } end, desc = "Find themes" }
maps.n["<leader>fw"] = { function() require("telescope.builtin").live_grep() end, desc = "Find words" }
maps.n["<leader>fW"] = {
function()
@@ -308,14 +334,19 @@ end
if is_available "nvim-dap" then
maps.n["<leader>d"] = sections.d
+ maps.v["<leader>d"] = sections.d
-- modified function keys found with `showkey -a` in the terminal to get key code
-- run `nvim -V3log +quit` and search through the "Terminal info" in the `log` file for the correct keyname
- maps.n["<F1>"] = { function() require("dap").continue() end, desc = "Debugger: Start" }
- maps.n["<F3>"] = {
- function() require("dap").set_breakpoint(vim.fn.input("Breakpoint condition: ")) end,
- desc = "Toggle Conditional Breakpoint"
+ maps.n["<F5>"] = { function() require("dap").continue() end, desc = "Debugger: Start" }
+ maps.n["<F17>"] = { function() require("dap").terminate() end, desc = "Debugger: Stop" } -- Shift+F5
+ maps.n["<F21>"] = {
+ function()
+ vim.ui.input({ prompt = "Condition: " }, function(condition)
+ if condition then require("dap").set_breakpoint(condition) end
+ end)
+ end,
+ desc = "Debugger: Conditional Breakpoint",
}
- maps.n["<F17>"] = { function() require("dap").terminate() end, desc = "Debugger: Stop" } -- Shift+F5
maps.n["<F29>"] = { function() require("dap").restart_frame() end, desc = "Debugger: Restart" } -- Control+F5
maps.n["<F6>"] = { function() require("dap").pause() end, desc = "Debugger: Pause" }
maps.n["<F9>"] = { function() require("dap").toggle_breakpoint() end, desc = "Debugger: Toggle Breakpoint" }
@@ -323,12 +354,16 @@ if is_available "nvim-dap" then
maps.n["<F11>"] = { function() require("dap").step_into() end, desc = "Debugger: Step Into" }
maps.n["<F23>"] = { function() require("dap").step_out() end, desc = "Debugger: Step Out" } -- Shift+F11
maps.n["<leader>db"] = { function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint (F9)" }
- maps.n["<leader>dbc"] = {
- function() require("dap").set_breakpoint(vim.fn.input("Breakpoint condition: ")) end,
- desc = "Toggle Conditional Breakpoint"
- }
maps.n["<leader>dB"] = { function() require("dap").clear_breakpoints() end, desc = "Clear Breakpoints" }
maps.n["<leader>dc"] = { function() require("dap").continue() end, desc = "Start/Continue (F5)" }
+ maps.n["<leader>dC"] = {
+ function()
+ vim.ui.input({ prompt = "Condition: " }, function(condition)
+ if condition then require("dap").set_breakpoint(condition) end
+ end)
+ end,
+ desc =