diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
index 5c0f3fff4..4906f93c9 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -7,7 +7,7 @@ body:
value: |
_Before reporting:_ Search [existing issues](https://github.com/ayamir/nvimdots/issues) and check the [FAQ](https://github.com/ayamir/nvimdots/wiki/Issues). Thank you for helping us improve!
> [!IMPORTANT]
- > The `0.10` branch is intended for nightly neovim builds and is **not** stable. It typically harbors subtle issues scattered throughout. Therefore, refrain from submitting issues if you happen to encounter them. They will be closed directly unless a viable solution is proposed or included.
+ > The `0.11` branch is intended for nightly Neovim builds and is **not** stable. It typically harbors subtle issues scattered throughout. Therefore, refrain from submitting issues if you happen to encounter them. They will be closed directly unless a viable solution is proposed or included.
- type: checkboxes
id: is-latest-commit
attributes:
@@ -38,7 +38,7 @@ body:
attributes:
label: "Neovim version"
description: "Paste the output of `nvim --version` here"
- placeholder: "NVIM v0.10.0-dev-873+g71ad771ea"
+ placeholder: "NVIM v0.11.0-dev-194+g6c7677e5d"
validations:
required: true
- type: input
@@ -69,16 +69,16 @@ body:
description: "Which branch are you currently on? If you are not sure, check the output of `git rev-parse --abbrev-ref HEAD`"
options:
- main (Default/Latest)
- - 0.8 (Legacy)
- - 0.7 (Deprecated)
- - 0.10 (Nightly)
+ - 0.9 (Legacy)
+ - 0.8 (Deprecated)
+ - 0.11 (Nightly)
validations:
required: true
- type: dropdown
id: fetch-pref
attributes:
label: "Fetch Preferences"
- description: "In what way do you fetch resources? If you are not sure, check the value of `use_ssh` in `lua/core/settings.lua`"
+ description: "In what way do you fetch resources? If you are not sure, check the value of `use_ssh` in `lua/user/settings.lua`"
options:
- SSH (use_ssh = true)
- HTTPS (use_ssh = false)
diff --git a/.github/ISSUE_TEMPLATE/custom_config.yml b/.github/ISSUE_TEMPLATE/custom_config.yml
index d3dc98dd2..6a95d3903 100644
--- a/.github/ISSUE_TEMPLATE/custom_config.yml
+++ b/.github/ISSUE_TEMPLATE/custom_config.yml
@@ -7,7 +7,7 @@ body:
value: |
_Before requesting:_ Make sure you've read through our [Wiki: Usage](https://github.com/ayamir/nvimdots/wiki/Usage) before you start to add things to nvimdots!
> [!IMPORTANT]
- > The `0.10` branch is intended for nightly neovim builds and is **not** stable. It typically harbors subtle issues scattered throughout. Therefore, refrain from submitting issues if you happen to encounter them. They will be closed directly unless a viable solution is proposed or included.
+ > The `0.11` branch is intended for nightly Neovim builds and is **not** stable. It typically harbors subtle issues scattered throughout. Therefore, refrain from submitting issues if you happen to encounter them. They will be closed directly unless a viable solution is proposed or included.
- type: checkboxes
id: is-latest-commit
attributes:
@@ -30,7 +30,7 @@ body:
attributes:
label: "Neovim version"
description: "Paste the output of `nvim --version` here"
- placeholder: "NVIM v0.10.0-dev-873+g71ad771ea"
+ placeholder: "NVIM v0.11.0-dev-194+g6c7677e5d"
validations:
required: true
- type: dropdown
@@ -40,9 +40,9 @@ body:
description: "This issue template mainly targets `main` branch. Check the output of `git rev-parse --abbrev-ref HEAD` if you're not sure."
options:
- main (Default/Latest)
- - 0.8 (Legacy)
- - 0.7 (Deprecated)
- - 0.10 (Nightly)
+ - 0.9 (Legacy)
+ - 0.8 (Deprecated)
+ - 0.11 (Nightly)
validations:
required: true
diff --git a/.github/ISSUE_TEMPLATE/lsp_issue_report.yml b/.github/ISSUE_TEMPLATE/lsp_issue_report.yml
index 519b0e6de..09978612c 100644
--- a/.github/ISSUE_TEMPLATE/lsp_issue_report.yml
+++ b/.github/ISSUE_TEMPLATE/lsp_issue_report.yml
@@ -7,7 +7,7 @@ body:
value: |
_Before reporting:_ Search [existing issues](https://github.com/ayamir/nvimdots/issues) and check the [FAQ](https://github.com/ayamir/nvimdots/wiki/Issues). Thank you for helping us improve!
> [!IMPORTANT]
- > The `0.10` branch is intended for nightly neovim builds and is **not** stable. It typically harbors subtle issues scattered throughout. Therefore, refrain from submitting issues if you happen to encounter them. They will be closed directly unless a viable solution is proposed or included.
+ > The `0.11` branch is intended for nightly Neovim builds and is **not** stable. It typically harbors subtle issues scattered throughout. Therefore, refrain from submitting issues if you happen to encounter them. They will be closed directly unless a viable solution is proposed or included.
- type: checkboxes
id: is-latest-commit
attributes:
@@ -38,7 +38,7 @@ body:
attributes:
label: "Neovim version"
description: "Paste the output of `nvim --version` here"
- placeholder: "NVIM v0.10.0-dev-873+g71ad771ea"
+ placeholder: "NVIM v0.11.0-dev-194+g6c7677e5d"
validations:
required: true
- type: input
@@ -69,16 +69,16 @@ body:
description: "Which branch are you currently on? If you are not sure, check the output of `git rev-parse --abbrev-ref HEAD`"
options:
- main (Default/Latest)
- - 0.8 (Legacy)
- - 0.7 (Deprecated)
- - 0.10 (Nightly)
+ - 0.9 (Legacy)
+ - 0.8 (Deprecated)
+ - 0.11 (Nightly)
validations:
required: true
- type: dropdown
id: fetch-pref
attributes:
label: "Fetch Preferences"
- description: "In what way do you fetch resources? If you are not sure, check the value of `use_ssh` in `lua/core/settings.lua`"
+ description: "In what way do you fetch resources? If you are not sure, check the value of `use_ssh` in `lua/user/settings.lua`"
options:
- SSH (use_ssh = true)
- HTTPS (use_ssh = false)
diff --git a/.github/workflows/lint_code.yml b/.github/workflows/lint_code.yml
index 9e88fa59e..71d11c5e2 100644
--- a/.github/workflows/lint_code.yml
+++ b/.github/workflows/lint_code.yml
@@ -8,4 +8,4 @@ jobs:
- uses: actions/checkout@v4
- uses: lunarmodules/luacheck@v1
with:
- args: . --std luajit --globals vim _toggle_lazygit _buf_vtext _command_panel _flash_esc_or_noh _debugging --max-line-length 150 --no-config
+ args: . --std luajit --globals vim _debugging _command_panel _flash_esc_or_noh _telescope_collections _toggle_lazygit --max-line-length 150 --no-config
diff --git a/LICENSE b/LICENSE
old mode 100755
new mode 100644
index 0203a8bed..33895b644
--- a/LICENSE
+++ b/LICENSE
@@ -1,21 +1,30 @@
-MIT License
+BSD 3-Clause License
Copyright (c) 2021 ayamir
+Copyright (c) 2022 Jint-lzxy, CharlesChiuGit
+Copyright (c) 2023 aarnphm, misumisumi
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/README.md b/README.md
index 05390439a..c450710be 100644
--- a/README.md
+++ b/README.md
@@ -3,8 +3,8 @@
+ alt="Neovim Version Capability"
+ src="https://img.shields.io/badge/Supports%20Nvim-v0.10-A6D895?style=for-the-badge&colorA=363A4F&logo=neovim&logoColor=D9E0EE">
-| Branch | Supported neovim version |
+| Branch | Supported Neovim version |
| :----: | :----------------------: |
-| main | nvim 0.9 stable |
-| 0.10 | nvim 0.10 nightly |
+| main | nvim 0.10 stable |
+| 0.11 | nvim 0.11 nightly |
+| 0.9 | nvim 0.9 |
| 0.8 | nvim 0.8 |
-| 0.7 | nvim 0.7 |
> [!IMPORTANT]
-> The `0.10` branch is intended for nightly neovim builds and is **not** stable. It typically harbors subtle issues scattered throughout. Therefore, refrain from submitting issues if you happen to encounter them. They will be closed directly unless a viable solution is proposed or included.
+> The `0.11` branch is intended for nightly Neovim builds and is **not** stable. It typically harbors subtle issues scattered throughout. Therefore, refrain from submitting issues if you happen to encounter them. They will be closed directly unless a viable solution is proposed or included.
We currently manage plugins using [lazy.nvim](https://github.com/folke/lazy.nvim).
@@ -61,14 +61,14 @@ Chinese introduction is [here](https://zhuanlan.zhihu.com/p/382092667).
### 🎐 Features
- **Fast.** Less than **30ms** to start (Depends on SSD and CPU, tested on Zephyrus G14 2022 version).
-- **Simple.** Run out of the box.
+- **Simple.** Runs out of the box.
- **Modern.** Pure `lua` config.
- **Modular.** Easy to customize.
- **Powerful.** Full functionality to code.
## 🏗 How to Install
-Just run the following interactive bootstrap command, and you're good to go 👍
+Simply run the following interactive bootstrap command, and you should be all set 👍
- **Windows** _(Note: This script REQUIRES `pwsh` > `v7.1`)_
@@ -197,6 +197,8 @@ It's strongly recommended to read [Wiki: Prerequisites](https://github.com/ayami
- [ayamir](https://github.com/ayamir)
- [Jint-lzxy](https://github.com/Jint-lzxy)
- [CharlesChiuGit](https://github.com/CharlesChiuGit)
+- [aarnphm](https://github.com/aarnphm)
+- [misumisumi](https://github.com/misumisumi)
## 🎉 Acknowledgement
@@ -204,7 +206,7 @@ It's strongly recommended to read [Wiki: Prerequisites](https://github.com/ayami
## 📜 License
-This NeoVim configuration is released under the MIT license, which grants the following permissions:
+This Neovim configuration is released under the BSD 3-Clause license, which grants the following permissions:
- Commercial use
- Distribution
diff --git a/lazy-lock.json b/lazy-lock.json
index 43e8c7c95..a5ecf48e1 100644
--- a/lazy-lock.json
+++ b/lazy-lock.json
@@ -93,4 +93,4 @@
"vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" },
"which-key.nvim": { "branch": "main", "commit": "0099511294f16b81c696004fa6a403b0ae61f7a0" },
"wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" }
-}
\ No newline at end of file
+}
diff --git a/lua/core/event.lua b/lua/core/event.lua
index c605da18a..b7ba7788c 100644
--- a/lua/core/event.lua
+++ b/lua/core/event.lua
@@ -3,23 +3,32 @@ local autocmd = {}
function autocmd.nvim_create_augroups(definitions)
for group_name, definition in pairs(definitions) do
- vim.api.nvim_command("augroup " .. group_name)
+ -- Prepend an underscore to avoid name clashes
+ vim.api.nvim_command("augroup _" .. group_name)
vim.api.nvim_command("autocmd!")
for _, def in ipairs(definition) do
- local command = table.concat(vim.tbl_flatten({ "autocmd", def }), " ")
+ local command = table.concat(vim.iter({ "autocmd", def }):flatten(math.huge):totable(), " ")
vim.api.nvim_command(command)
end
vim.api.nvim_command("augroup END")
end
end
--- defer setting LSP-related keymaps till LspAttach
+-- Hold off on configuring anything related to the LSP until LspAttach
local mapping = require("keymap.completion")
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("LspKeymapLoader", { clear = true }),
callback = function(event)
if not _G._debugging then
+ -- LSP Keymaps
mapping.lsp(event.buf)
+
+ -- LSP Inlay Hints
+ local inlayhints_enabled = require("core.settings").lsp_inlayhints
+ local client = vim.lsp.get_client_by_id(event.data.client_id)
+ if client and client.server_capabilities.inlayHintProvider ~= nil then
+ vim.lsp.inlay_hint.enable(inlayhints_enabled == true, { bufnr = event.buf })
+ end
end
end,
})
@@ -32,7 +41,7 @@ vim.api.nvim_create_autocmd("BufEnter", {
local layout = vim.api.nvim_call_function("winlayout", {})
if
layout[1] == "leaf"
- and vim.api.nvim_get_option_value("filetype", { buf = vim.api.nvim_win_get_buf(layout[2]) }) == "NvimTree"
+ and vim.bo[vim.api.nvim_win_get_buf(layout[2])].filetype == "NvimTree"
and layout[3] == nil
then
vim.api.nvim_command([[confirm quit]])
@@ -59,7 +68,7 @@ vim.api.nvim_create_autocmd("FileType", {
},
callback = function(event)
vim.bo[event.buf].buflisted = false
- vim.api.nvim_buf_set_keymap(event.buf, "n", "q", "close", { silent = true })
+ vim.api.nvim_buf_set_keymap(event.buf, "n", "q", "close", { silent = true })
end,
})
diff --git a/lua/core/global.lua b/lua/core/global.lua
index 7ab42829c..0f01edc16 100644
--- a/lua/core/global.lua
+++ b/lua/core/global.lua
@@ -1,5 +1,5 @@
local global = {}
-local os_name = vim.loop.os_uname().sysname
+local os_name = vim.uv.os_uname().sysname
function global:load_variables()
self.is_mac = os_name == "Darwin"
@@ -7,12 +7,10 @@ function global:load_variables()
self.is_windows = os_name == "Windows_NT"
self.is_wsl = vim.fn.has("wsl") == 1
self.vim_path = vim.fn.stdpath("config")
- local path_sep = self.is_windows and "\\" or "/"
- local home = self.is_windows and os.getenv("USERPROFILE") or os.getenv("HOME")
- self.cache_dir = home .. path_sep .. ".cache" .. path_sep .. "nvim" .. path_sep
- self.modules_dir = self.vim_path .. path_sep .. "modules"
- self.home = home
+ self.cache_dir = vim.fn.stdpath("cache")
self.data_dir = string.format("%s/site/", vim.fn.stdpath("data"))
+ self.modules_dir = self.vim_path .. "/modules"
+ self.home = self.is_windows and os.getenv("USERPROFILE") or os.getenv("HOME")
end
global:load_variables()
diff --git a/lua/core/init.lua b/lua/core/init.lua
index 951d3adaa..a5fa32813 100644
--- a/lua/core/init.lua
+++ b/lua/core/init.lua
@@ -3,19 +3,20 @@ local global = require("core.global")
-- Create cache dir and data dirs
local createdir = function()
- local data_dir = {
- global.cache_dir .. "backup",
- global.cache_dir .. "session",
- global.cache_dir .. "swap",
- global.cache_dir .. "tags",
- global.cache_dir .. "undo",
+ local data_dirs = {
+ global.cache_dir .. "/backup",
+ global.cache_dir .. "/session",
+ global.cache_dir .. "/swap",
+ global.cache_dir .. "/tags",
+ global.cache_dir .. "/undo",
}
-- Only check whether cache_dir exists, this would be enough.
if vim.fn.isdirectory(global.cache_dir) == 0 then
- os.execute("mkdir -p " .. global.cache_dir)
- for _, v in pairs(data_dir) do
- if vim.fn.isdirectory(v) == 0 then
- os.execute("mkdir -p " .. v)
+ ---@diagnostic disable-next-line: param-type-mismatch
+ vim.fn.mkdir(global.cache_dir, "p")
+ for _, dir in pairs(data_dirs) do
+ if vim.fn.isdirectory(dir) == 0 then
+ vim.fn.mkdir(dir, "p")
end
end
end
@@ -135,12 +136,13 @@ You're recommended to install PowerShell for better experience.]],
local basecmd = "-NoLogo -MTA -ExecutionPolicy RemoteSigned"
local ctrlcmd = "-Command [console]::InputEncoding = [console]::OutputEncoding = [System.Text.Encoding]::UTF8"
- vim.api.nvim_set_option_value("shell", vim.fn.executable("pwsh") == 1 and "pwsh" or "powershell", {})
- vim.api.nvim_set_option_value("shellcmdflag", string.format("%s %s;", basecmd, ctrlcmd), {})
- vim.api.nvim_set_option_value("shellredir", "-RedirectStandardOutput %s -NoNewWindow -Wait", {})
- vim.api.nvim_set_option_value("shellpipe", "2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode", {})
- vim.api.nvim_set_option_value("shellquote", nil, {})
- vim.api.nvim_set_option_value("shellxquote", nil, {})
+ local set_opts = vim.api.nvim_set_option_value
+ set_opts("shell", vim.fn.executable("pwsh") == 1 and "pwsh" or "powershell", {})
+ set_opts("shellcmdflag", string.format("%s %s;", basecmd, ctrlcmd), {})
+ set_opts("shellredir", "-RedirectStandardOutput %s -NoNewWindow -Wait", {})
+ set_opts("shellpipe", "2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode", {})
+ set_opts("shellquote", "", {})
+ set_opts("shellxquote", "", {})
end
end
@@ -160,10 +162,8 @@ local load_core = function()
require("core.pack")
require("keymap")
- local colorscheme = settings.colorscheme
- local background = settings.background
- vim.api.nvim_command("set background=" .. background)
- vim.api.nvim_command("colorscheme " .. colorscheme)
+ vim.api.nvim_set_option_value("background", settings.background, {})
+ vim.cmd.colorscheme(settings.colorscheme)
end
load_core()
diff --git a/lua/core/mapping.lua b/lua/core/mapping.lua
index cb0c061de..351216925 100644
--- a/lua/core/mapping.lua
+++ b/lua/core/mapping.lua
@@ -34,6 +34,7 @@ local core_map = {
["n|"] = map_cr("wq"):with_desc("edit: Save file and quit"),
["n|"] = map_cr("q!"):with_desc("edit: Force quit"),
["n|o"] = map_cr("setlocal spell! spelllang=en_us"):with_desc("edit: Toggle spell check"),
+ ["n|bn"] = map_cu("enew"):with_noremap():with_silent():with_desc("buffer: New"),
["n|tn"] = map_cr("tabnew"):with_noremap():with_silent():with_desc("tab: Create a new tab"),
["n|tk"] = map_cr("tabnext"):with_noremap():with_silent():with_desc("tab: Move to next tab"),
["n|tj"] = map_cr("tabprevious"):with_noremap():with_silent():with_desc("tab: Move to previous tab"),
diff --git a/lua/core/options.lua b/lua/core/options.lua
index b3b3e0295..d025abf07 100644
--- a/lua/core/options.lua
+++ b/lua/core/options.lua
@@ -2,10 +2,10 @@ local global = require("core.global")
local function load_options()
local global_local = {
- -- backupdir = global.cache_dir .. "backup/",
- -- directory = global.cache_dir .. "swap/",
- -- spellfile = global.cache_dir .. "spell/en.uft-8.add",
- -- viewdir = global.cache_dir .. "view/",
+ -- backupdir = global.cache_dir .. "/backup/",
+ -- directory = global.cache_dir .. "/swap/",
+ -- spellfile = global.cache_dir .. "/spell/en.uft-8.add",
+ -- viewdir = global.cache_dir .. "/view/",
autoindent = true,
autoread = true,
autowrite = true,
@@ -17,8 +17,8 @@ local function load_options()
clipboard = "unnamedplus",
cmdheight = 1, -- 0, 1, 2
cmdwinheight = 5,
- complete = ".,w,b,k",
- completeopt = "menuone,noselect",
+ complete = ".,w,b,k,kspell",
+ completeopt = "menuone,noselect,popup",
concealcursor = "niv",
conceallevel = 0,
cursorcolumn = true,
@@ -70,6 +70,7 @@ local function load_options()
signcolumn = "yes",
smartcase = true,
smarttab = true,
+ smoothscroll = true,
splitbelow = true,
splitkeep = "screen",
splitright = true,
@@ -83,7 +84,7 @@ local function load_options()
timeoutlen = 300,
ttimeout = true,
ttimeoutlen = 0,
- undodir = global.cache_dir .. "undo/",
+ undodir = global.cache_dir .. "/undo/",
undofile = true,
-- Please do NOT set `updatetime` to above 500, otherwise most plugins may not function correctly
updatetime = 200,
@@ -120,7 +121,7 @@ local function load_options()
end
for name, value in pairs(require("modules.utils").extend_config(global_local, "user.options")) do
- vim.o[name] = value
+ vim.api.nvim_set_option_value(name, value, {})
end
end
diff --git a/lua/core/pack.lua b/lua/core/pack.lua
index 6046e5fe3..326bf3df9 100644
--- a/lua/core/pack.lua
+++ b/lua/core/pack.lua
@@ -63,7 +63,7 @@ function Lazy:load_plugins()
end
function Lazy:load_lazy()
- if not vim.loop.fs_stat(lazy_path) then
+ if not vim.uv.fs_stat(lazy_path) then
local lazy_repo = use_ssh and "git@github.com:folke/lazy.nvim.git " or "https://github.com/folke/lazy.nvim.git "
api.nvim_command("!git clone --filter=blob:none --branch=stable " .. lazy_repo .. lazy_path)
end
diff --git a/lua/core/settings.lua b/lua/core/settings.lua
index 0b0d61030..125416008 100644
--- a/lua/core/settings.lua
+++ b/lua/core/settings.lua
@@ -8,10 +8,14 @@ settings["use_ssh"] = true
---@type boolean
settings["use_copilot"] = true
--- Set it to false if there are no need to format on save.
+-- Set it to false if there is no need to format on save.
---@type boolean
settings["format_on_save"] = true
+-- Set format timeout here (in ms).
+---@type number
+settings["format_timeout"] = 1000
+
-- Set it to false if the notification after formatting is annoying.
---@type boolean
settings["format_notify"] = true
@@ -33,6 +37,24 @@ settings["format_disabled_dirs"] = {
"~/format_disabled_dir",
}
+-- Filetypes in this list will skip lsp formatting if rhs is true.
+---@type table
+settings["formatter_block_list"] = {
+ lua = false, -- example
+}
+
+-- Servers in this list will skip setting formatting capabilities if rhs is true.
+---@type table
+settings["server_formatting_block_list"] = {
+ lua_ls = true,
+ tsserver = true,
+ clangd = true,
+}
+
+-- Set it to false if you want to turn off LSP Inlay Hints
+---@type boolean
+settings["lsp_inlayhints"] = true
+
-- Set it to false if diagnostics virtual text is annoying.
-- If disabled, you may browse lsp diagnostics using trouble.nvim (press `gt` to toggle it).
---@type boolean
@@ -42,8 +64,8 @@ settings["diagnostics_virtual_text"] = true
-- Priority: `Error` > `Warning` > `Information` > `Hint`.
-- > e.g. if you set this option to `Warning`, only lsp warnings and errors will be shown.
-- NOTE: This entry only works when `diagnostics_virtual_text` is true.
----@type "Error"|"Warning"|"Information"|"Hint"
-settings["diagnostics_level"] = "Hint"
+---@type "ERROR"|"WARN"|"INFO"|"HINT"
+settings["diagnostics_level"] = "HINT"
-- Set the plugins to disable here.
-- Example: "Some-User/A-Repo"
@@ -81,20 +103,6 @@ settings["background"] = "dark"
---@type string
settings["external_browser"] = "chrome-cli open"
--- Filetypes in this list will skip lsp formatting if rhs is true.
----@type table
-settings["formatter_block_list"] = {
- lua = false, -- example
-}
-
--- Servers in this list will skip setting formatting capabilities if rhs is true.
----@type table
-settings["server_formatting_block_list"] = {
- lua_ls = true,
- tsserver = true,
- clangd = true,
-}
-
-- Set the language servers that will be installed during bootstrap here.
-- check the below link for all the supported LSPs:
-- https://github.com/neovim/nvim-lspconfig/tree/master/lua/lspconfig/server_configurations
diff --git a/lua/keymap/helpers.lua b/lua/keymap/helpers.lua
index 68276e2eb..60d99e46f 100644
--- a/lua/keymap/helpers.lua
+++ b/lua/keymap/helpers.lua
@@ -11,6 +11,33 @@ _G._command_panel = function()
})
end
+_G._telescope_collections = function(picker_type)
+ local actions = require("telescope.actions")
+ local action_state = require("telescope.actions.state")
+ local conf = require("telescope.config").values
+ local finder = require("telescope.finders")
+ local pickers = require("telescope.pickers")
+ picker_type = picker_type or {}
+
+ local collections = vim.tbl_keys(require("search.tabs").collections)
+ pickers
+ .new(picker_type, {
+ prompt_title = "Telescope Collections",
+ finder = finder.new_table({ results = collections }),
+ sorter = conf.generic_sorter(picker_type),
+ attach_mappings = function(bufnr)
+ actions.select_default:replace(function()
+ actions.close(bufnr)
+ local selection = action_state.get_selected_entry()
+ require("search").open({ collection = selection[1] })
+ end)
+
+ return true
+ end,
+ })
+ :find()
+end
+
_G._flash_esc_or_noh = function()
local flash_active, state = pcall(function()
return require("flash.plugins.char").state
@@ -38,16 +65,3 @@ _G._toggle_lazygit = function()
vim.notify("Command [lazygit] not found!", vim.log.levels.ERROR, { title = "toggleterm.nvim" })
end
end
-
--- TODO: Update this function to use `vim.getregion()` when v0.10 is released.
-_G._buf_vtext = function()
- local a_orig = vim.fn.getreg("a")
- local mode = vim.fn.mode()
- if mode ~= "v" and mode ~= "V" then
- vim.cmd([[normal! gv]])
- end
- vim.cmd([[silent! normal! "aygv]])
- local text = vim.fn.getreg("a")
- vim.fn.setreg("a", a_orig)
- return text
-end
diff --git a/lua/keymap/tool.lua b/lua/keymap/tool.lua
index 6eebff316..617a2d082 100644
--- a/lua/keymap/tool.lua
+++ b/lua/keymap/tool.lua
@@ -63,24 +63,19 @@ local plug_map = {
:with_desc("git: Toggle lazygit"),
-- Plugin: trouble
- ["n|gt"] = map_cr("TroubleToggle"):with_noremap():with_silent():with_desc("lsp: Toggle trouble list"),
- ["n|ll"] = map_cr("TroubleToggle lsp_references")
+ ["n|gt"] = map_cr("Trouble diagnostics toggle"):with_noremap():with_silent():with_desc("lsp: Toggle trouble list"),
+ ["n|lw"] = map_cr("Trouble diagnostics toggle")
:with_noremap()
:with_silent()
- :with_desc("lsp: Show lsp references"),
- ["n|ld"] = map_cr("TroubleToggle document_diagnostics")
+ :with_desc("lsp: Show workspace diagnostics"),
+ ["n|lp"] = map_cr("Trouble project_diagnostics toggle")
:with_noremap()
:with_silent()
- :with_desc("lsp: Show document diagnostics"),
- ["n|lw"] = map_cr("TroubleToggle workspace_diagnostics")
+ :with_desc("lsp: Show project diagnostics"),
+ ["n|ld"] = map_cr("Trouble diagnostics toggle filter.buf=0")
:with_noremap()
:with_silent()
- :with_desc("lsp: Show workspace diagnostics"),
- ["n|lq"] = map_cr("TroubleToggle quickfix")
- :with_noremap()
- :with_silent()
- :with_desc("lsp: Show quickfix list"),
- ["n|lL"] = map_cr("TroubleToggle loclist"):with_noremap():with_silent():with_desc("lsp: Show loclist"),
+ :with_desc("lsp: Show document diagnostics"),
-- Plugin: telescope
["n|"] = map_callback(function()
@@ -89,56 +84,46 @@ local plug_map = {
:with_noremap()
:with_silent()
:with_desc("tool: Toggle command panel"),
- ["n|u"] = map_callback(function()
- require("telescope").extensions.undo.undo()
+ ["n|fc"] = map_callback(function()
+ _telescope_collections(require("telescope.themes").get_dropdown())
end)
:with_noremap()
:with_silent()
- :with_desc("edit: Show undo history"),
- ["n|fp"] = map_callback(function()
- require("telescope").extensions.projects.projects({})
+ :with_desc("tool: Open Telescope collections"),
+ ["n|ff"] = map_callback(function()
+ require("search").open({ collection = "file" })
end)
:with_noremap()
:with_silent()
- :with_desc("find: Project"),
- ["n|fr"] = map_callback(function()
- require("telescope").extensions.frecency.frecency({})
+ :with_desc("tool: Find files"),
+ ["n|fp"] = map_callback(function()
+ require("search").open({ collection = "pattern" })
end)
:with_noremap()
:with_silent()
- :with_desc("find: File by frecency"),
- ["n|fw"] = map_callback(function()
- require("telescope").extensions.live_grep_args.live_grep_args()
- end)
+ :with_desc("tool: Find patterns"),
+ ["v|fs"] = map_cu("Telescope grep_string")
:with_noremap()
:with_silent()
- :with_desc("find: Word in project"),
- ["n|fe"] = map_cu("Telescope oldfiles"):with_noremap():with_silent():with_desc("find: File by history"),
- ["n|ff"] = map_cu("Telescope find_files"):with_noremap():with_silent():with_desc("find: File in project"),
- ["n|fc"] = map_callback(function()
- require("telescope.builtin").colorscheme({ enable_preview = true })
+ :with_desc("tool: Find word under cursor"),
+ ["n|fg"] = map_callback(function()
+ require("search").open({ collection = "git" })
end)
:with_noremap()
:with_silent()
- :with_desc("ui: Change colorscheme for current session"),
- ["n|bn"] = map_cu(":enew"):with_noremap():with_silent():with_desc("buffer: New"),
- ["n|fg"] = map_cu("Telescope git_files")
- :with_noremap()
- :with_silent()
- :with_desc("find: file in git project"),
- ["n|fz"] = map_cu("Telescope zoxide list")
+ :with_desc("tool: Locate Git objects"),
+ ["n|fd"] = map_callback(function()
+ require("search").open({ collection = "dossier" })
+ end)
:with_noremap()
:with_silent()
- :with_desc("edit: Change current directory by zoxide"),
- ["n|fb"] = map_cu("Telescope buffers"):with_noremap():with_silent():with_desc("find: Buffer opened"),
- ["n|fs"] = map_cu("Telescope grep_string"):with_noremap():with_silent():with_desc("find: Current word"),
- ["v|fs"] = map_callback(function()
- require("telescope.builtin").grep_string({ search = _buf_vtext() })
+ :with_desc("tool: Retrieve dossiers"),
+ ["n|fm"] = map_callback(function()
+ require("search").open({ collection = "misc" })
end)
:with_noremap()
:with_silent()
- :with_desc("find: Selection text"),
- ["n|fd"] = map_cu("Telescope persisted"):with_noremap():with_silent():with_desc("find: Session"),
+ :with_desc("tool: Miscellaneous"),
-- Plugin: dap
["n|"] = map_callback(function()
diff --git a/lua/modules/configs/completion/cmp.lua b/lua/modules/configs/completion/cmp.lua
index 0d926e0ee..f20e7b60d 100644
--- a/lua/modules/configs/completion/cmp.lua
+++ b/lua/modules/configs/completion/cmp.lua
@@ -127,15 +127,14 @@ return function()
},
-- You can set mappings if you want
mapping = cmp.mapping.preset.insert({
- [""] = cmp.mapping.confirm({ select = false, behavior = cmp.ConfirmBehavior.Replace }),
- [""] = cmp.mapping.select_prev_item(),
- [""] = cmp.mapping.select_next_item(),
+ [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }),
+ [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }),
[""] = cmp.mapping.scroll_docs(-4),
[""] = cmp.mapping.scroll_docs(4),
- [""] = cmp.mapping.close(),
+ [""] = cmp.mapping.abort(),
[""] = cmp.mapping(function(fallback)
if cmp.visible() then
- cmp.select_next_item()
+ cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
elseif require("luasnip").expand_or_locally_jumpable() then
require("luasnip").expand_or_jump()
else
@@ -144,13 +143,24 @@ return function()
end, { "i", "s" }),
[""] = cmp.mapping(function(fallback)
if cmp.visible() then
- cmp.select_prev_item()
+ cmp.select_prev_item({ behavior = cmp.SelectBehavior.Select })
elseif require("luasnip").jumpable(-1) then
require("luasnip").jump(-1)
else
fallback()
end
end, { "i", "s" }),
+ [""] = cmp.mapping({
+ i = function(fallback)
+ if cmp.visible() and cmp.get_active_entry() then
+ cmp.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = false })
+ else
+ fallback()
+ end
+ end,
+ s = cmp.mapping.confirm({ select = true }),
+ c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true }),
+ }),
}),
snippet = {
expand = function(args)
@@ -171,7 +181,7 @@ return function()
name = "buffer",
option = {
get_bufnrs = function()
- return vim.api.nvim_list_bufs()
+ return vim.api.nvim_buf_line_count(0) < 7500 and vim.api.nvim_list_bufs() or {}
end,
},
},
diff --git a/lua/modules/configs/completion/copilot.lua b/lua/modules/configs/completion/copilot.lua
index 96de94fd1..a6ea78c2a 100644
--- a/lua/modules/configs/completion/copilot.lua
+++ b/lua/modules/configs/completion/copilot.lua
@@ -14,8 +14,14 @@ return function()
enabled = false,
},
filetypes = {
+ ["bigfile"] = false,
["dap-repl"] = false,
- ["big_file_disabled_ft"] = false,
+ ["fugitive"] = false,
+ ["fugitiveblame"] = false,
+ ["git"] = false,
+ ["gitcommit"] = false,
+ ["log"] = false,
+ ["toggleterm"] = false,
},
})
end, 100)
diff --git a/lua/modules/configs/completion/formatting.lua b/lua/modules/configs/completion/formatting.lua
index 9e8018812..0368efef7 100644
--- a/lua/modules/configs/completion/formatting.lua
+++ b/lua/modules/configs/completion/formatting.lua
@@ -6,12 +6,13 @@ local format_on_save = settings.format_on_save
local format_notify = settings.format_notify
local format_modifications_only = settings.format_modifications_only
local server_formatting_block_list = settings.server_formatting_block_list
+local format_timeout = settings.format_timeout
vim.api.nvim_create_user_command("FormatToggle", function()
M.toggle_format_on_save()
end, {})
-local block_list = require("core.settings").formatter_block_list
+local block_list = settings.formatter_block_list
vim.api.nvim_create_user_command("FormatterToggleFt", function(opts)
if block_list[opts.args] == nil then
vim.notify(
@@ -35,7 +36,7 @@ vim.api.nvim_create_user_command("FormatterToggleFt", function(opts)
end, { nargs = 1, complete = "filetype" })
function M.enable_format_on_save(is_configured)
- local opts = { pattern = "*", timeout = 1000 }
+ local opts = { pattern = "*", timeout = format_timeout }
vim.api.nvim_create_augroup("format_on_save", { clear = true })
vim.api.nvim_create_autocmd("BufWritePre", {
group = "format_on_save",
@@ -117,7 +118,7 @@ function M.format(opts)
end
local bufnr = opts.bufnr or vim.api.nvim_get_current_buf()
- local clients = vim.lsp.buf_get_clients(bufnr)
+ local clients = vim.lsp.get_clients({ buffer = bufnr })
if opts.filter then
clients = opts.filter(clients)
@@ -156,7 +157,9 @@ function M.format(opts)
{ title = "LSP Formatter Warning" }
)
return
- elseif
+ end
+
+ if
format_modifications_only
and require("lsp-format-modifications").format_modifications(client, bufnr).success
then
diff --git a/lua/modules/configs/completion/lsp.lua b/lua/modules/configs/completion/lsp.lua
index be60436db..ba3c5a873 100644
--- a/lua/modules/configs/completion/lsp.lua
+++ b/lua/modules/configs/completion/lsp.lua
@@ -19,5 +19,5 @@ return function()
pcall(require, "user.configs.lsp")
- vim.api.nvim_command([[LspStart]]) -- Start LSPs
+ pcall(vim.cmd.LspStart) -- Start LSPs
end
diff --git a/lua/modules/configs/completion/lspsaga.lua b/lua/modules/configs/completion/lspsaga.lua
index bca447da0..162cdda2c 100644
--- a/lua/modules/configs/completion/lspsaga.lua
+++ b/lua/modules/configs/completion/lspsaga.lua
@@ -10,17 +10,17 @@ return function()
}
local function set_sidebar_icons()
- -- Set icons for sidebar.
- local diagnostic_icons = {
- Error = icons.diagnostics.Error_alt,
- Warn = icons.diagnostics.Warning_alt,
- Info = icons.diagnostics.Information_alt,
- Hint = icons.diagnostics.Hint_alt,
- }
- for type, icon in pairs(diagnostic_icons) do
- local hl = "DiagnosticSign" .. type
- vim.fn.sign_define(hl, { text = icon, texthl = hl })
- end
+ -- Set icons for sidebar
+ vim.diagnostic.config({
+ signs = {
+ text = {
+ [vim.diagnostic.severity.ERROR] = icons.diagnostics.Error_alt,
+ [vim.diagnostic.severity.WARN] = icons.diagnostics.Warning_alt,
+ [vim.diagnostic.severity.INFO] = icons.diagnostics.Information_alt,
+ [vim.diagnostic.severity.HINT] = icons.diagnostics.Hint_alt,
+ },
+ },
+ })
end
set_sidebar_icons()
@@ -28,7 +28,7 @@ return function()
require("modules.utils").load_plugin("lspsaga", {
-- Breadcrumbs: https://nvimdev.github.io/lspsaga/breadcrumbs/
symbol_in_winbar = {
- enable = true,
+ enable = false,
separator = " " .. icons.ui.Separator,
hide_keyword = false,
show_file = false,
@@ -148,7 +148,6 @@ return function()
Method = { icons.kind.Method, "LspKindMethod" },
Module = { icons.kind.Module, "LspKindModule" },
Namespace = { icons.kind.Namespace, "LspKindNamespace" },
- Number = { icons.kind.Number, "LspKindNumber" },
Operator = { icons.kind.Operator, "LspKindOperator" },
Package = { icons.kind.Package, "LspKindPackage" },
Property = { icons.kind.Property, "LspKindProperty" },
@@ -159,6 +158,7 @@ return function()
Array = { icons.type.Array, "LspKindArray" },
Boolean = { icons.type.Boolean, "LspKindBoolean" },
Null = { icons.type.Null, "LspKindNull" },
+ Number = { icons.type.Number, "LspKindNumber" },
Object = { icons.type.Object, "LspKindObject" },
String = { icons.type.String, "LspKindString" },
-- ccls-specific icons.
diff --git a/lua/modules/configs/completion/mason-lspconfig.lua b/lua/modules/configs/completion/mason-lspconfig.lua
index 8885aaa2b..567ff9f94 100644
--- a/lua/modules/configs/completion/mason-lspconfig.lua
+++ b/lua/modules/configs/completion/mason-lspconfig.lua
@@ -16,14 +16,20 @@ M.setup = function()
signs = true,
underline = true,
virtual_text = diagnostics_virtual_text and {
- severity_limit = diagnostics_level,
+ severity = {
+ min = vim.diagnostic.severity[diagnostics_level],
+ },
} or false,
-- set update_in_insert to false because it was enabled by lspsaga
update_in_insert = false,
})
local opts = {
- capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()),
+ capabilities = vim.tbl_deep_extend(
+ "force",
+ vim.lsp.protocol.make_client_capabilities(),
+ require("cmp_nvim_lsp").default_capabilities()
+ ),
}
---A handler to setup all servers defined under `completion/servers/*.lua`
---@param lsp_name string
diff --git a/lua/modules/configs/completion/null-ls.lua b/lua/modules/configs/completion/null-ls.lua
index 3ff15f54b..72982d6ea 100644
--- a/lua/modules/configs/completion/null-ls.lua
+++ b/lua/modules/configs/completion/null-ls.lua
@@ -17,7 +17,7 @@ return function()
-- Don't specify any config here if you are using the default one.
local sources = {
btns.formatting.clang_format.with({
- filetypes = { "c", "cpp" },
+ filetypes = { "c", "cpp", "objc", "objcpp", "cs", "java", "cuda", "proto" },
extra_args = formatter_args("clang_format"),
}),
btns.formatting.prettier.with({
@@ -42,6 +42,7 @@ return function()
log_level = "warn",
update_in_insert = false,
sources = sources,
+ default_timeout = require("core.settings").format_timeout,
})
require("completion.mason-null-ls").setup()
@@ -49,7 +50,7 @@ return function()
-- Setup usercmd to register/deregister available source(s)
local function _gen_completion()
local sources_cont = null_ls.get_source({
- filetype = vim.api.nvim_get_option_value("filetype", { scope = "local" }),
+ filetype = vim.bo.filetype,
})
local completion_items = {}
for _, server in pairs(sources_cont) do
diff --git a/lua/modules/configs/completion/servers/lua_ls.lua b/lua/modules/configs/completion/servers/lua_ls.lua
index 67cc63078..cd68c9ee4 100644
--- a/lua/modules/configs/completion/servers/lua_ls.lua
+++ b/lua/modules/configs/completion/servers/lua_ls.lua
@@ -2,18 +2,20 @@
return {
settings = {
Lua = {
+ runtime = { version = "LuaJIT" },
diagnostics = {
globals = { "vim" },
disable = { "different-requires", "undefined-field" },
},
workspace = {
library = {
- [vim.fn.expand("$VIMRUNTIME/lua")] = true,
- [vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true,
+ vim.fn.expand("$VIMRUNTIME/lua"),
+ vim.fn.expand("$VIMRUNTIME/lua/vim/lsp"),
},
maxPreload = 100000,
preloadFileSize = 10000,
},
+ hint = { enable = true, setType = true },
format = { enable = false },
telemetry = { enable = false },
-- Do not override treesitter lua highlighting with lua_ls's highlighting
diff --git a/lua/modules/configs/editor/autoclose.lua b/lua/modules/configs/editor/autoclose.lua
index d5e9b0d46..a43888f49 100644
--- a/lua/modules/configs/editor/autoclose.lua
+++ b/lua/modules/configs/editor/autoclose.lua
@@ -16,8 +16,24 @@ return function()
["'"] = { escape = true, close = true, pair = "''", disabled_filetypes = { "rust" } },
},
options = {
- disabled_filetypes = { "big_file_disabled_ft" },
disable_when_touch = false,
+ disabled_filetypes = {
+ "alpha",
+ "bigfile",
+ "checkhealth",
+ "dap-repl",
+ "diff",
+ "help",
+ "log",
+ "notify",
+ "NvimTree",
+ "Outline",
+ "qf",
+ "TelescopePrompt",
+ "toggleterm",
+ "undotree",
+ "vimwiki",
+ },
},
})
end
diff --git a/lua/modules/configs/editor/autotag.lua b/lua/modules/configs/editor/autotag.lua
index 303b67fd2..42dcd973f 100644
--- a/lua/modules/configs/editor/autotag.lua
+++ b/lua/modules/configs/editor/autotag.lua
@@ -1,12 +1,9 @@
return function()
require("modules.utils").load_plugin("nvim-ts-autotag", {
- filetypes = {
- "html",
- "javascript",
- "javascriptreact",
- "typescriptreact",
- "vue",
- "xml",
+ opts = {
+ enable_close = true, -- Auto close tags
+ enable_rename = true, -- Auto rename pairs of tags
+ enable_close_on_slash = false, -- Auto close on trailing
},
})
end
diff --git a/lua/modules/configs/editor/bigfile.lua b/lua/modules/configs/editor/bigfile.lua
index c260a4432..6c4e79d1f 100644
--- a/lua/modules/configs/editor/bigfile.lua
+++ b/lua/modules/configs/editor/bigfile.lua
@@ -3,7 +3,7 @@ return function()
name = "ftdetect",
opts = { defer = true },
disable = function()
- vim.api.nvim_set_option_value("filetype", "big_file_disabled_ft", { scope = "local" })
+ vim.api.nvim_set_option_value("filetype", "bigfile", { scope = "local" })
end,
}
@@ -16,15 +16,16 @@ return function()
}
require("modules.utils").load_plugin("bigfile", {
- filesize = 1, -- size of the file in MiB
+ filesize = 2, -- size of the file in MiB
pattern = { "*" }, -- autocmd pattern
features = { -- features to disable
+ "indent_blankline",
"lsp",
- "treesitter",
"syntax",
+ "treesitter",
"vimopts",
- ftdetect,
cmp,
+ ftdetect,
},
})
end
diff --git a/lua/modules/configs/editor/colorizer.lua b/lua/modules/configs/editor/colorizer.lua
deleted file mode 100644
index efee45019..000000000
--- a/lua/modules/configs/editor/colorizer.lua
+++ /dev/null
@@ -1,3 +0,0 @@
-return function()
- require("modules.utils").load_plugin("colorizer", {})
-end
diff --git a/lua/modules/configs/editor/highlight-colors.lua b/lua/modules/configs/editor/highlight-colors.lua
new file mode 100644
index 000000000..06a0f6acd
--- /dev/null
+++ b/lua/modules/configs/editor/highlight-colors.lua
@@ -0,0 +1,31 @@
+return function()
+ require("modules.utils").load_plugin("nvim-highlight-colors", {
+ render = "background",
+ enable_hex = true,
+ enable_short_hex = true,
+ enable_rgb = true,
+ enable_hsl = true,
+ enable_var_usage = true,
+ enable_named_colors = false,
+ enable_tailwind = false,
+ -- Exclude filetypes or buftypes from highlighting
+ exclude_filetypes = {
+ "alpha",
+ "bigfile",
+ "dap-repl",
+ "fugitive",
+ "git",
+ "notify",
+ "NvimTree",
+ "Outline",
+ "TelescopePrompt",
+ "toggleterm",
+ "undotree",
+ },
+ exclude_buftypes = {
+ "nofile",
+ "prompt",
+ "terminal",
+ },
+ })
+end
diff --git a/lua/modules/configs/editor/rainbow_delims.lua b/lua/modules/configs/editor/rainbow_delims.lua
index 0f1a50aa2..d2e681d23 100644
--- a/lua/modules/configs/editor/rainbow_delims.lua
+++ b/lua/modules/configs/editor/rainbow_delims.lua
@@ -2,6 +2,13 @@ return function()
---@param threshold number @Use global strategy if nr of lines exceeds this value
local function init_strategy(threshold)
return function()
+ -- Disable on very large files
+ local line_count = vim.api.nvim_buf_line_count(0)
+ if line_count > 7500 then
+ return nil
+ end
+
+ -- Disable on parser error
local errors = 200
vim.treesitter.get_parser():for_each_tree(function(lt)
if lt:root():has_error() and errors >= 0 then
@@ -11,7 +18,8 @@ return function()
if errors < 0 then
return nil
end
- return vim.fn.line("$") > threshold and require("rainbow-delimiters").strategy["global"]
+
+ return line_count > threshold and require("rainbow-delimiters").strategy["global"]
or require("rainbow-delimiters").strategy["local"]
end
end
@@ -19,8 +27,8 @@ return function()
vim.g.rainbow_delimiters = {
strategy = {
[""] = init_strategy(500),
- c = init_strategy(200),
- cpp = init_strategy(200),
+ c = init_strategy(300),
+ cpp = init_strategy(300),
lua = init_strategy(500),
vimdoc = init_strategy(300),
vim = init_strategy(300),
@@ -40,5 +48,6 @@ return function()
"RainbowDelimiterViolet",
},
}
+
require("modules.utils").load_plugin("rainbow_delimiters", nil, true)
end
diff --git a/lua/modules/configs/editor/treesitter.lua b/lua/modules/configs/editor/treesitter.lua
index e9fe90151..5b25ebe95 100644
--- a/lua/modules/configs/editor/treesitter.lua
+++ b/lua/modules/configs/editor/treesitter.lua
@@ -9,7 +9,10 @@ return vim.schedule_wrap(function()
highlight = {
enable = true,
disable = function(ft, bufnr)
- if vim.tbl_contains({ "vim" }, ft) then
+ if
+ vim.tbl_contains({ "gitcommit" }, ft)
+ or (vim.api.nvim_buf_line_count(bufnr) > 7500 and ft ~= "vimdoc")
+ then
return true
end
@@ -21,6 +24,7 @@ return vim.schedule_wrap(function()
textobjects = {
select = {
enable = true,
+ lookahead = true,
keymaps = {
["af"] = "@function.outer",
["if"] = "@function.inner",
@@ -30,7 +34,7 @@ return vim.schedule_wrap(function()
},
move = {
enable = true,
- set_jumps = true, -- whether to set jumps in the jumplist
+ set_jumps = true,
goto_next_start = {
["]["] = "@function.outer",
["]m"] = "@class.outer",
@@ -55,8 +59,8 @@ return vim.schedule_wrap(function()
require("nvim-treesitter.install").prefer_git = true
if use_ssh then
local parsers = require("nvim-treesitter.parsers").get_parser_configs()
- for _, p in pairs(parsers) do
- p.install_info.url = p.install_info.url:gsub("https://github.com/", "git@github.com:")
+ for _, parser in pairs(parsers) do
+ parser.install_info.url = parser.install_info.url:gsub("https://github.com/", "git@github.com:")
end
end
end)
diff --git a/lua/modules/configs/editor/ts-context.lua b/lua/modules/configs/editor/ts-context.lua
index 186a52558..ba96e0312 100644
--- a/lua/modules/configs/editor/ts-context.lua
+++ b/lua/modules/configs/editor/ts-context.lua
@@ -7,6 +7,6 @@ return function()
multiline_threshold = 20, -- Maximum number of lines to collapse for a single context line
trim_scope = "outer", -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
mode = "cursor", -- Line used to calculate context. Choices: 'cursor', 'topline'
- zindex = 30,
+ zindex = 50, -- Ensure compatibility with Glance's preview window
})
end
diff --git a/lua/modules/configs/lang/crates-keymap.lua b/lua/modules/configs/lang/crates-keymap.lua
index 1c07e9ff2..cf1584cff 100644
--- a/lua/modules/configs/lang/crates-keymap.lua
+++ b/lua/modules/configs/lang/crates-keymap.lua
@@ -1,16 +1,17 @@
local bind = require("keymap.bind")
local map_callback = bind.map_callback
+local crates = require("crates")
local crates_keymap = {
["n|ct"] = map_callback(function()
- require("crates").toggle()
+ crates.toggle()
end)
:with_noremap()
:with_silent()
:with_buffer(0)
:with_desc("crates: Toggle spec activities"),
["n|cr"] = map_callback(function()
- require("crates").reload()
+ crates.reload()
end)
:with_noremap()
:with_silent()
@@ -18,31 +19,31 @@ local crates_keymap = {
:with_desc("crates: Reload crate specs"),
["n|cs"] = map_callback(function()
- require("crates").show_popup()
+ crates.show_popup()
end)
:with_noremap()
:with_silent()
:with_buffer(0)
:with_desc("crates: Toggle pop-up window"),
["n|cv"] = map_callback(function()
- require("crates").show_versions_popup()
- require("crates").show_popup()
+ crates.show_versions_popup()
+ crates.show_popup()
end)
:with_noremap()
:with_silent()
:with_buffer(0)
:with_desc("crates: Select spec versions"),
["n|cf"] = map_callback(function()
- require("crates").show_features_popup()
- require("crates").show_popup()
+ crates.show_features_popup()
+ crates.show_popup()
end)
:with_noremap()
:with_silent()
:with_buffer(0)
:with_desc("crates: Select spec features"),
["n|cd"] = map_callback(function()
- require("crates").show_dependencies_popup()
- require("crates").show_popup()
+ crates.show_dependencies_popup()
+ crates.show_popup()
end)
:with_noremap()
:with_silent()
@@ -50,42 +51,42 @@ local crates_keymap = {
:with_desc("crates: Show project dependencies"),
["n|cu"] = map_callback(function()
- require("crates").update_crate()
+ crates.update_crate()
end)
:with_noremap()
:with_silent()
:with_buffer(0)
:with_desc("crates: Update current crate's spec"),
["v|cu"] = map_callback(function()
- require("crates").update_crates()
+ crates.update_crates()
end)
:with_noremap()
:with_silent()
:with_buffer(0)
:with_desc("crates: Update selected crate's spec"),
["n|ca"] = map_callback(function()
- require("crates").update_all_crates()
+ crates.update_all_crates()
end)
:with_noremap()
:with_silent()
:with_buffer(0)
:with_desc("crates: Update all crates' specs"),
["n|cU"] = map_callback(function()
- require("crates").upgrade_crate()
+ crates.upgrade_crate()
end)
:with_noremap()
:with_silent()
:with_buffer(0)
:with_desc("crates: Upgrade current crate"),
["v|cU"] = map_callback(function()
- require("crates").upgrade_crates()
+ crates.upgrade_crates()
end)
:with_noremap()
:with_silent()
:with_buffer(0)
:with_desc("crates: Upgrade selected crates"),
["n|cA"] = map_callback(function()
- require("crates").upgrade_all_crates()
+ crates.upgrade_all_crates()
end)
:with_noremap()
:with_silent()
@@ -93,28 +94,28 @@ local crates_keymap = {
:with_desc("crates: Upgrade all crates"),
["n|cH"] = map_callback(function()
- require("crates").open_homepage()
+ crates.open_homepage()
end)
:with_noremap()
:with_silent()
:with_buffer(0)
:with_desc("crates: Open current crate's homepage"),
["n|cR"] = map_callback(function()
- require("crates").open_repository()
+ crates.open_repository()
end)
:with_noremap()
:with_silent()
:with_buffer(0)
:with_desc("crates: Open current crate's repository"),
["n|cD"] = map_callback(function()
- require("crates").open_documentation()
+ crates.open_documentation()
end)
:with_noremap()
:with_silent()
:with_buffer(0)
:with_desc("crates: Open current crate's documentation"),
["n|cC"] = map_callback(function()
- require("crates").open_crates_io()
+ crates.open_crates_io()
end)
:with_noremap()
:with_silent()
diff --git a/lua/modules/configs/tool/dropbar.lua b/lua/modules/configs/tool/dropbar.lua
new file mode 100644
index 000000000..a02dcaf04
--- /dev/null
+++ b/lua/modules/configs/tool/dropbar.lua
@@ -0,0 +1,109 @@
+return function()
+ local icons = {
+ kind = require("modules.utils.icons").get("kind", true),
+ type = require("modules.utils.icons").get("type", true),
+ misc = require("modules.utils.icons").get("misc", true),
+ ui = require("modules.utils.icons").get("ui", true),
+ }
+
+ require("modules.utils").load_plugin("dropbar", {
+ bar = {
+ hover = false,
+ truncate = true,
+ pick = { pivots = "etovxqpdygfblzhckisuran" },
+ },
+ sources = {
+ path = {
+ relative_to = function()
+ -- Only show the leaf filename in dropbar
+ return vim.fn.expand("%:p:h")
+ end,
+ },
+ terminal = {
+ name = function(buf)
+ local name = vim.api.nvim_buf_get_name(buf)
+ local term = select(2, require("toggleterm.terminal").identify(name))
+ -- Trying to "snag" a display name from toggleterm
+ if term then
+ return term.display_name or term.name
+ else
+ return name
+ end
+ end,
+ },
+ },
+ icons = {
+ enable = true,
+ kinds = {
+ use_devicons = true,
+ symbols = {
+ -- Type
+ Array = icons.type.Array,
+ Boolean = icons.type.Boolean,
+ Null = icons.type.Null,
+ Number = icons.type.Number,
+ Object = icons.type.Object,
+ String = icons.type.String,
+ Text = icons.type.String,
+
+ -- Kind
+ BreakStatement = icons.kind.Break,
+ Call = icons.kind.Call,
+ CaseStatement = icons.kind.Case,
+ Class = icons.kind.Class,
+ Color = icons.kind.Color,
+ Constant = icons.kind.Constant,
+ Constructor = icons.kind.Constructor,
+ ContinueStatement = icons.kind.Continue,
+ Declaration = icons.kind.Declaration,
+ Delete = icons.kind.Delete,
+ DoStatement = icons.kind.Loop,
+ Enum = icons.kind.Enum,
+ EnumMember = icons.kind.EnumMember,
+ Event = icons.kind.Event,
+ Field = icons.kind.Field,
+ File = icons.kind.File,
+ ForStatement = icons.kind.Loop,
+ Function = icons.kind.Function,
+ Identifier = icons.kind.Variable,
+ Interface = icons.kind.Interface,
+ Keyword = icons.kind.Keyword,
+ List = icons.kind.List,
+ Lsp = icons.misc.LspAvailable,
+ Method = icons.kind.Method,
+ Module = icons.kind.Module,
+ Namespace = icons.kind.Namespace,
+ Operator = icons.kind.Operator,
+ Package = icons.kind.Package,
+ Pair = icons.kind.List,
+ Property = icons.kind.Property,
+ Reference = icons.kind.Reference,
+ Regex = icons.kind.Regex,
+ Repeat = icons.kind.Loop,
+ Scope = icons.kind.Statement,
+ Snippet = icons.kind.Snippet,
+ Statement = icons.kind.Statement,
+ Struct = icons.kind.Struct,
+ SwitchStatement = icons.kind.Switch,
+ Type = icons.kind.Interface,
+ TypeParameter = icons.kind.TypeParameter,
+ Unit = icons.kind.Unit,
+ Value = icons.kind.Value,
+ Variable = icons.kind.Variable,
+ WhileStatement = icons.kind.Loop,
+
+ -- Microsoft-specific icons
+ Folder = icons.kind.Folder,
+
+ -- ccls-specific icons
+ Macro = icons.kind.Macro,
+ Terminal = icons.kind.Terminal,
+ },
+ },
+ ui = {
+ bar = { separator = " " },
+ menu = { indicator = icons.ui.ArrowClosed },
+ },
+ },
+ })
+end
diff --git a/lua/modules/configs/tool/nvim-tree.lua b/lua/modules/configs/tool/nvim-tree.lua
index 3f6f64112..fcf5288ce 100644
--- a/lua/modules/configs/tool/nvim-tree.lua
+++ b/lua/modules/configs/tool/nvim-tree.lua
@@ -126,8 +126,27 @@ return function()
enable = true,
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
exclude = {
- filetype = { "notify", "qf", "diff", "fugitive", "fugitiveblame" },
- buftype = { "terminal", "help" },
+ buftype = {
+ "help",
+ "nofile",
+ "prompt",
+ "quickfix",
+ "terminal",
+ },
+ filetype = {
+ "dap-repl",
+ "diff",
+ "fugitive",
+ "fugitiveblame",
+ "git",
+ "notify",
+ "NvimTree",
+ "Outline",
+ "qf",
+ "TelescopePrompt",
+ "toggleterm",
+ "undotree",
+ },
},
},
},
diff --git a/lua/modules/configs/tool/search.lua b/lua/modules/configs/tool/search.lua
new file mode 100644
index 000000000..ffad69cbc
--- /dev/null
+++ b/lua/modules/configs/tool/search.lua
@@ -0,0 +1,141 @@
+return function()
+ local builtin = require("telescope.builtin")
+ local extensions = require("telescope").extensions
+
+ require("modules.utils").load_plugin("search", {
+ collections = {
+ -- Search using filenames
+ file = {
+ initial_tab = 1,
+ tabs = {
+ {
+ name = "Files",
+ tele_func = function(opts)
+ opts = opts or {}
+ if vim.fn.isdirectory(".git") == 1 then
+ builtin.git_files(opts)
+ else
+ builtin.find_files(opts)
+ end
+ end,
+ },
+ {
+ name = "Frecency",
+ tele_func = function()
+ extensions.frecency.frecency()
+ end,
+ },
+ {
+ name = "Oldfiles",
+ tele_func = function()
+ builtin.oldfiles()
+ end,
+ },
+ {
+ name = "Buffers",
+ tele_func = function()
+ builtin.buffers()
+ end,
+ },
+ },
+ },
+ -- Search using patterns
+ pattern = {
+ initial_tab = 1,
+ tabs = {
+ {
+ name = "Word in project",
+ tele_func = function()
+ extensions.live_grep_args.live_grep_args()
+ end,
+ },
+ {
+ name = "Word under cursor",
+ tele_func = function(opts)
+ opts = opts or {}
+ builtin.grep_string(opts)
+ end,
+ },
+ },
+ },
+ -- Search Git objects (branches, commits)
+ git = {
+ initial_tab = 1,
+ tabs = {
+ {
+ name = "Branches",
+ tele_func = function()
+ builtin.git_branches()
+ end,
+ },
+ {
+ name = "Commits",
+ tele_func = function()
+ builtin.git_commits()
+ end,
+ },
+ {
+ name = "Commit content",
+ tele_func = function()
+ extensions.advanced_git_search.search_log_content()
+ end,
+ },
+ {
+ name = "Diff current file with commit",
+ tele_func = function()
+ extensions.advanced_git_search.diff_commit_file()
+ end,
+ },
+ },
+ },
+ -- Retrieve dossiers
+ dossier = {
+ initial_tab = 1,
+ tabs = {
+ {
+ name = "Sessions",
+ tele_func = function()
+ extensions.persisted.persisted()
+ end,
+ },
+ {
+ name = "Projects",
+ tele_func = function()
+ extensions.projects.projects({})
+ end,
+ },
+ {
+ name = "Zoxide",
+ tele_func = function()
+ extensions.zoxide.list()
+ end,
+ },
+ },
+ },
+ -- Miscellaneous
+ misc = {
+ initial_tab = 1,
+ tabs = {
+ {
+ name = "Colorschemes",
+ tele_func = function()
+ builtin.colorscheme({ enable_preview = true })
+ end,
+ },
+ {
+ name = "Notify",
+ tele_func = function()
+ extensions.notify.notify()
+ end,
+ },
+ {
+ name = "Undo History",
+ tele_func = function()
+ extensions.undo.undo()
+ end,
+ },
+ },
+ },
+ },
+ })
+end
diff --git a/lua/modules/configs/tool/telescope.lua b/lua/modules/configs/tool/telescope.lua
index d8fdddd44..71884d085 100644
--- a/lua/modules/configs/tool/telescope.lua
+++ b/lua/modules/configs/tool/telescope.lua
@@ -64,7 +64,6 @@ return function()
},
live_grep_args = {
auto_quoting = true, -- enable/disable auto-quoting
- -- define mappings, e.g.
mappings = { -- extend mappings
i = {
[""] = lga_actions.quote_prompt(),
@@ -74,18 +73,19 @@ return function()
},
undo = {
side_by_side = true,
- mappings = { -- this whole table is the default
+ mappings = {
i = {
- -- IMPORTANT: Note that telescope-undo must be available when telescope is configured if
- -- you want to use the following actions. This means installing as a dependency of
- -- telescope in it's `requirements` and loading this extension from there instead of
- -- having the separate plugin definition as outlined above. See issue #6.
[""] = require("telescope-undo.actions").yank_additions,
[""] = require("telescope-undo.actions").yank_deletions,
[""] = require("telescope-undo.actions").restore,
},
},
},
+ advanced_git_search = {
+ diff_plugin = "diffview",
+ git_flags = { "-c", "delta.side-by-side=true" },
+ entry_default_author_or_date = "author", -- one of "author" or "date"
+ },
},
})
@@ -98,4 +98,5 @@ return function()
require("telescope").load_extension("zoxide")
require("telescope").load_extension("persisted")
require("telescope").load_extension("aerial")
+ require("telescope").load_extension("advanced_git_search")
end
diff --git a/lua/modules/configs/tool/trouble.lua b/lua/modules/configs/tool/trouble.lua
index 386af479a..6a9bbfcb0 100644
--- a/lua/modules/configs/tool/trouble.lua
+++ b/lua/modules/configs/tool/trouble.lua
@@ -1,55 +1,38 @@
return function()
local icons = {
- ui = require("modules.utils.icons").get("ui"),
- diagnostics = require("modules.utils.icons").get("diagnostics"),
+ ui = require("modules.utils.icons").get("ui", true),
}
require("modules.utils").load_plugin("trouble", {
- position = "bottom", -- position of the list can be: bottom, top, left, right
- height = 10, -- height of the trouble list when position is top or bottom
- width = 50, -- width of the list when position is left or right
- icons = true, -- use devicons for filenames
- mode = "document_diagnostics", -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist"
- fold_open = icons.ui.ArrowOpen, -- icon used for open folds
- fold_closed = icons.ui.ArrowClosed, -- icon used for closed folds
- group = true, -- group results by file
- padding = true, -- add an extra new line on top of the list
- action_keys = {
- -- key mappings for actions in the trouble list
- -- map to {} to remove a mapping, for example:
- -- close = {},
- close = "q", -- close the list
- cancel = "", -- cancel the preview and get back to your last window / buffer / cursor
- refresh = "r", -- manually refresh
- jump = { "", "" }, -- jump to the diagnostic or open / close folds
- open_split = { "" }, -- open buffer in new split
- open_vsplit = { "" }, -- open buffer in new vsplit
- open_tab = { "" }, -- open buffer in new tab
- jump_close = { "o" }, -- jump to the diagnostic and close the list
- toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode
- toggle_preview = "P", -- toggle auto_preview
- hover = "K", -- opens a small popup with the full multiline message
- preview = "p", -- preview the diagnostic location
- close_folds = { "zM", "zm" }, -- close all folds
- open_folds = { "zR", "zr" }, -- open all folds
- toggle_fold = { "zA", "za" }, -- toggle fold of current file
- previous = "k", -- preview item
- next = "j", -- next item
+ auto_open = false,
+ auto_close = false,
+ auto_jump = false,
+ auto_preview = true,
+ auto_refresh = true,
+ focus = false, -- do not focus the window when opened
+ follow = true,
+ restore = true,
+ icons = {
+ indent = {
+ fold_open = icons.ui.ArrowOpen,
+ fold_closed = icons.ui.ArrowClosed,
+ },
+ folder_closed = icons.ui.Folder,
+ folder_open = icons.ui.FolderOpen,
},
- indent_lines = true, -- add an indent guide below the fold icons
- auto_open = false, -- automatically open the list when you have diagnostics
- auto_close = false, -- automatically close the list when you have no diagnostics
- auto_preview = true, -- automatically preview the location of the diagnostic. to close preview and go back to last window
- auto_fold = false, -- automatically fold a file trouble list at creation
- auto_jump = { "lsp_definitions" }, -- for the given modes, automatically jump if there is only a single result
- signs = {
- -- icons / text used for a diagnostic
- error = icons.diagnostics.Error_alt,
- warning = icons.diagnostics.Warning_alt,
- hint = icons.diagnostics.Hint_alt,
- information = icons.diagnostics.Information_alt,
- other = icons.diagnostics.Question_alt,
+ modes = {
+ project_diagnostics = {
+ mode = "diagnostics",
+ filter = {
+ any = {
+ {
+ function(item)
+ return item.filename:find(vim.fn.getcwd(), 1, true)
+ end,
+ },
+ },
+ },
+ },
},
- use_diagnostic_signs = false, -- enabling this will use the signs defined in your lsp client
})
end
diff --git a/lua/modules/configs/ui/alpha.lua b/lua/modules/configs/ui/alpha.lua
index c84dbcf06..befcbd2e3 100644
--- a/lua/modules/configs/ui/alpha.lua
+++ b/lua/modules/configs/ui/alpha.lua
@@ -39,55 +39,56 @@ return function()
end
local leader = " "
+ local icons = {
+ documents = require("modules.utils.icons").get("documents", true),
+ git = require("modules.utils.icons").get("git", true),
+ ui = require("modules.utils.icons").get("ui", true),
+ misc = require("modules.utils.icons").get("misc", true),
+ }
+
dashboard.section.buttons.val = {
- button("space f c", " Scheme change", leader, nil, {
- noremap = true,
- silent = true,
- nowait = true,
- callback = function()
- require("telescope.builtin").colorscheme()
- end,
- }),
- button("space f r", " File frecency", leader, nil, {
- noremap = true,
- silent = true,
- nowait = true,
- callback = function()
- require("telescope").extensions.frecency.frecency({})
- end,
- }),
- button("space f e", " File history", leader, nil, {
- noremap = true,
- silent = true,
- nowait = true,
- callback = function()
- require("telescope.builtin").oldfiles()
- end,
- }),
- button("space f p", " Project find", leader, nil, {
- noremap = true,
- silent = true,
- nowait = true,
- callback = function()
- require("telescope").extensions.projects.projects({})
- end,
- }),
- button("space f f", " File find", leader, nil, {
- noremap = true,
- silent = true,
- nowait = true,
- callback = function()
- require("telescope.builtin").find_files()
- end,
- }),
- button("space f w", " Word find", leader, nil, {
- noremap = true,
- silent = true,
- nowait = true,
- callback = function()
- require("telescope.builtin").live_grep()
- end,
- }),
+ button(
+ "space f c",
+ icons.misc.Neovim .. "Telescope collections",
+ leader,
+ nil,
+ { noremap = true, silent = true, nowait = true }
+ ),
+ button(
+ "space f f",
+ icons.documents.FileFind .. "Find files",
+ leader,
+ nil,
+ { noremap = true, silent = true, nowait = true }
+ ),
+ button(
+ "space f d",
+ icons.ui.FolderWithHeart .. "Retrieve dossiers",
+ leader,
+ nil,
+ { noremap = true, silent = true, nowait = true }
+ ),
+ button(
+ "space f p",
+ icons.documents.Word .. "Find patterns",
+ leader,
+ nil,
+ { noremap = true, silent = true, nowait = true }
+ ),
+ button(
+ "space f g",
+ icons.git.Git .. "Locate Git objects",
+ leader,
+ nil,
+ { noremap = true, silent = true, nowait = true }
+ ),
+ button(
+ "space f m",
+ icons.misc.Ghost .. "Miscellaneous artifacts",
+ leader,
+ nil,
+ { noremap = true, silent = true, nowait = true }
+ ),
}
dashboard.section.buttons.opts.hl = "AlphaButtons"
@@ -113,7 +114,7 @@ return function()
local head_butt_padding = 2
local occu_height = #dashboard.section.header.val + 2 * #dashboard.section.buttons.val + head_butt_padding
- local header_padding = math.max(0, math.ceil((vim.fn.winheight("$") - occu_height) * 0.25))
+ local header_padding = math.max(0, math.ceil((vim.fn.winheight(0) - occu_height) * 0.25))
local foot_butt_padding = 1
dashboard.config.layout = {
diff --git a/lua/modules/configs/ui/catppuccin.lua b/lua/modules/configs/ui/catppuccin.lua
index b3a402394..c0a9048b1 100644
--- a/lua/modules/configs/ui/catppuccin.lua
+++ b/lua/modules/configs/ui/catppuccin.lua
@@ -146,6 +146,7 @@ return function()
-- For trouble.nvim
TroubleNormal = { bg = transparent_background and cp.none or cp.base },
+ TroubleNormalNC = { bg = transparent_background and cp.none or cp.base },
-- For telescope.nvim
TelescopeMatching = { fg = cp.lavender },
diff --git a/lua/modules/configs/ui/gitsigns.lua b/lua/modules/configs/ui/gitsigns.lua
index c70684266..de14cd5f5 100644
--- a/lua/modules/configs/ui/gitsigns.lua
+++ b/lua/modules/configs/ui/gitsigns.lua
@@ -2,45 +2,22 @@ return function()
local mapping = require("keymap.ui")
require("modules.utils").load_plugin("gitsigns", {
signs = {
- add = {
- hl = "GitSignsAdd",
- text = "│",
- numhl = "GitSignsAddNr",
- linehl = "GitSignsAddLn",
- },
- change = {
- hl = "GitSignsChange",
- text = "│",
- numhl = "GitSignsChangeNr",
- linehl = "GitSignsChangeLn",
- },
- delete = {
- hl = "GitSignsDelete",
- text = "_",
- numhl = "GitSignsDeleteNr",
- linehl = "GitSignsDeleteLn",
- },
- topdelete = {
- hl = "GitSignsDelete",
- text = "‾",
- numhl = "GitSignsDeleteNr",
- linehl = "GitSignsDeleteLn",
- },
- changedelete = {
- hl = "GitSignsChange",
- text = "~",
- numhl = "GitSignsChangeNr",
- linehl = "GitSignsChangeLn",
- },
+ add = { text = "┃" },
+ change = { text = "┃" },
+ delete = { text = "_" },
+ topdelete = { text = "‾" },
+ changedelete = { text = "~" },
+ untracked = { text = "┆" },
},
+ auto_attach = true,
on_attach = mapping.gitsigns,
- watch_gitdir = { interval = 1000, follow_files = true },
- current_line_blame = true,
- current_line_blame_opts = { delay = 1000, virtual_text_pos = "eol" },
+ signcolumn = true,
sign_priority = 6,
update_debounce = 100,
- status_formatter = nil, -- Use default
word_diff = false,
+ current_line_blame = true,
diff_opts = { internal = true },
+ watch_gitdir = { follow_files = true },
+ current_line_blame_opts = { delay = 1000, virt_text = true, virtual_text_pos = "eol" },
})
end
diff --git a/lua/modules/configs/ui/indent-blankline.lua b/lua/modules/configs/ui/indent-blankline.lua
index 1f55ea3a9..169a56f29 100644
--- a/lua/modules/configs/ui/indent-blankline.lua
+++ b/lua/modules/configs/ui/indent-blankline.lua
@@ -1,4 +1,468 @@
return function()
+ -- This list delineates the per-language nodes used for guiding |ibl| in highlighting the current scope
+ -- It is extracted from each language's `indents.scm` file
+ -- NOTE: Only a subset of the supported programming languages is included
+ -- If your preferred language isn't listed, you can add it to the user config
+ local nodes = {
+ bibtex = {
+ "entry",
+ },
+ c = {
+ "case_statement",
+ "compound_literal_expression",
+ "enumerator_list",
+ "field_declaration_list",
+ "initializer_list",
+ "init_declarator",
+ },
+ cmake = {
+ "block_def",
+ "foreach_loop",
+ "function_def",
+ "if_condition",
+ "macro_def",
+ "normal_command",
+ "while_loop",
+ },
+ cpp = {
+ "case_statement",
+ "compound_literal_expression",
+ "condition_clause",
+ "enumerator_list",
+ "field_declaration_list",
+ "field_initializer_list",
+ "init_declarator",
+ "initializer_list",
+ "namespace_definition",
+ },
+ css = {
+ "block",
+ "declaration",
+ },
+ d = {
+ "aggregate_body",
+ "block_statement",
+ "case_statement",
+ "expression_statement",
+ "function_body",
+ "parameters",
+ "scope_statement",
+ "template_parameters",
+ },
+ dart = {
+ "arguments",
+ "class_body",
+ "formal_parameter",
+ "formal_parameter_list",
+ "function_body",
+ "function_expression_body",
+ "initializers",
+ "list_literal",
+ "return_statement",
+ "switch_block",
+ },
+ dot = {
+ "block",
+ "attr_list",
+ },
+ ecma = {
+ "arguments",
+ "array",
+ "binary_expression",
+ "call_expression",
+ "class_body",
+ "export_clause",
+ "formal_parameters",
+ "named_imports",
+ "object",
+ "object_pattern",
+ "parenthesized_expression",
+ "return_statement",
+ "switch_case",
+ "switch_default",
+ "switch_statement",
+ "template_substitution",
+ "ternary_expression",
+ },
+ elixir = {
+ "arguments",
+ "block",
+ "do_block",
+ "list",
+ "map",
+ "tuple",
+ },
+ firrtl = {
+ "memory",
+ },
+ fortran = {
+ "derived_type_definition",
+ "do_loop_statement",
+ "enum",
+ "function",
+ "if_statement",
+ "module",
+ "program",
+ "subroutine",
+ "where_statement",
+ },
+ gleam = {
+ "anonymous_function",
+ "assert",
+ "case",
+ "constant",
+ "external_function",
+ "function",
+ "import",
+ "let",
+ "list",
+ "constant",
+ "function",
+ "type_definition",
+ "type_alias",
+ "todo",
+ "tuple",
+ },
+ go = {
+ "call_expression",
+ "communication_case",
+ "const_declaration",
+ "default_case",
+ "expression_case",
+ "import_declaration",
+ "literal_value",
+ "parameter_list",
+ "struct_type",
+ "type_case",
+ "type_declaration",
+ "var_declaration",
+ },
+ html = {
+ "start_tag",
+ "self_closing_tag",
+ },
+ java = {
+ "annotation_argument_list",
+ "annotation_type_body",
+ "argument_list",
+ "array_initializer",
+ "class_body",
+ "constructor_body",
+ "element_value_array_initializer",
+ "enum_body",
+ "formal_parameters",
+ "interface_body",
+ "method_invocation",
+ "switch_block",
+ },
+ javascript = {
+ "arguments",
+ "array",
+ "binary_expression",
+ "call_expression",
+ "class_body",
+ "export_clause",
+ "formal_parameters",
+ "jsx_expression",
+ "jsx_self_closing_element",
+ "named_imports",
+ "object",
+ "object_pattern",
+ "parenthesized_expression",
+ "return_statement",
+ "switch_case",
+ "switch_default",
+ "switch_statement",
+ "template_substitution",
+ "ternary_expression",
+ },
+ julia = {
+ "assignment",
+ "call_expression",
+ "compound_statement",
+ "comprehension_expression",
+ "for_binding",
+ "if_statement",
+ "matrix_expression",
+ "parenthesized_expression",
+ "struct_definition",
+ "tuple_expression",
+ "vector_expression",
+ },
+ just = {
+ "external_command",
+ "recipe",
+ "string",
+ },
+ linkerscript = {
+ "memory_command",
+ "output_section",
+ "phdrs_command",
+ "sections_command",
+ },
+ lua = {
+ "arguments",
+ "field",
+ "method_index_expression",
+ "return_statement",
+ "table_constructor",
+ },
+ matlab = {
+ "class_definition",
+ "enumeration",
+ "events",
+ "for_statement",
+ "if_statement",
+ "methods",
+ "properties",
+ "switch_statement",
+ "try_statement",
+ "while_statement",
+ },
+ ninja = {
+ "build",
+ "pool",
+ "rule",
+ },
+ ocaml = {
+ "application_expression",
+ "do_clause",
+ "external",
+ "field_expression",
+ "if_expression",
+ "list_expression",
+ "parenthesized_expression",
+ "record_declaration",
+ "record_expression",
+ "try_expression",
+ "type_binding",
+ "value_specification",
+ },
+ pascal = {
+ "arrInitializer",
+ "block",
+ "declArgs",
+ "declClass",
+ "declConsts",
+ "declProc",
+ "declTypes",
+ "declUses",
+ "declVars",
+ "defaultValue",
+ "exprArgs",
+ "exprBrackets",
+ "exprParens",
+ "exprSubscript",
+ "recInitializer",
+ "statement",
+ },
+ php = {
+ "arguments",
+ "array_creation_expression",
+ "binary_expression",
+ "case_statement",
+ "compound_statement",
+ "declaration_list",
+ "default_statement",
+ "enum_declaration_list",
+ "formal_parameters",
+ "match_block",
+ "member_call_expression",
+ "parenthesized_expression",
+ "return_statement",
+ "switch_block",
+ },
+ python = {
+ "binary_operator",
+ "case_clause",
+ "concatenated_string",
+ "for_statement",
+ "generator_expression",
+ "if_statement",
+ "import_from_statement",
+ "lambda",
+ "list_pattern",
+ "match_statement",
+ "parenthesized_expression",
+ "try_statement",
+ "tuple_pattern",
+ "while_statement",
+ "with_statement",
+ },
+ query = {
+ "list",
+ "predicate",
+ },
+ r = {
+ "brace_list",
+ "call",
+ "paren_list",
+ "pipe",
+ "special",
+ },
+ readline = {
+ "conditional_construct",
+ },
+ ruby = {
+ "argument_list",
+ "array",
+ "assignment",
+ "begin",
+ "call",
+ "case",
+ "for",
+ "hash",
+ "if",
+ "module",
+ "parenthesized_statements",
+ "singleton_class",
+ "singleton_method",
+ "unless",
+ "until",
+ "while",
+ },
+ rust = {
+ "arguments",
+ "array_expression",
+ "assignment_expression",
+ "call_expression",
+ "enum_variant_list",
+ "field_declaration_list",
+ "macro_definition",
+ "match_block",
+ "mod_item",
+ "ordered_field_declaration_list",
+ "parameters",
+ "struct_expression",
+ "struct_pattern",
+ "token_repetition",
+ "token_tree",
+ "trait_item",
+ "tuple_expression",
+ "tuple_pattern",
+ "tuple_struct_pattern",
+ "tuple_type",
+ "use_list",
+ "where_clause",
+ },
+ scss = {
+ "block",
+ "declaration",
+ "each_statement",
+ "mixin_statement",
+ "while_statement",
+ },
+ sql = {
+ "case",
+ "column_definitions",
+ "cte",
+ "insert",
+ "select",
+ "subquery",
+ "when_clause",
+ },
+ ssh_config = {
+ "host_declaration",
+ "match_declaration",
+ },
+ swift = {
+ "array_literal",
+ "array_type",
+ "assignment",
+ "call_expression",
+ "class_body",
+ "computed_getter",
+ "computed_property",
+ "computed_setter",
+ "control_transfer_statement",
+ "deinit_declaration",
+ "dictionary_literal",
+ "dictionary_type",
+ "didset_clause",
+ "enum_class_body",
+ "init_declaration",
+ "lambda_literal",
+ "protocol_body",
+ "subscript_declaration",
+ "tuple_expression",
+ "tuple_type",
+ "type_parameters",
+ "willset_clause",
+ "willset_didset_block",
+ },
+ tablegen = {
+ "assert",
+ "value_suffix",
+ },
+ tcl = {
+ "braced_word_simple",
+ "command",
+ "command_substitution",
+ "conditional",
+ "foreach",
+ "namespace",
+ "procedure",
+ "try",
+ "while",
+ },
+ teal = {
+ "record_declaration",
+ "function_body",
+ "table_constructor",
+ "return_statement",
+ "while_statement",
+ },
+ terraform = {
+ "block",
+ "function_call",
+ "object",
+ "tuple",
+ },
+ textproto = {
+ "message_list",
+ "message_value",
+ "scalar_list",
+ },
+ toml = {
+ "array",
+ "inline_table",
+ },
+ typescript = {
+ "arguments",
+ "array",
+ "binary_expression",
+ "call_expression",
+ "class_body",
+ "enum_declaration",
+ "export_clause",
+ "formal_parameters",
+ "interface_declaration",
+ "named_imports",
+ "object",
+ "object_pattern",
+ "object_type",
+ "parenthesized_expression",
+ "return_statement",
+ "switch_case",
+ "switch_default",
+ "switch_statement",
+ "template_substitution",
+ "ternary_expression",
+ },
+ vue = {
+ "start_tag",
+ },
+ xml = {
+ "element",
+ },
+ zig = {
+ "Block",
+ "ContainerDecl",
+ "InitList",
+ "SwitchExpr",
+ },
+ }
+
require("modules.utils").load_plugin("ibl", {
enabled = true,
debounce = 200,
@@ -19,76 +483,96 @@ return function()
priority = 1000,
include = {
node_type = {
- ["*"] = {
- "argument_list",
- "arguments",
- "assignment_statement",
- "Block",
- "class",
- "ContainerDecl",
- "dictionary",
- "do_block",
- "do_statement",
- "element",
- "except",
- "FnCallArguments",
- "for",
- "for_statement",
- "function",
- "function_declaration",
- "function_definition",
- "if_statement",
- "IfExpr",
- "IfStatement",
- "import",
- "InitList",
- "list_literal",
- "method",
- "object",
- "ParamDeclList",
- "repeat_statement",
- "selector",
- "SwitchExpr",
- "table",
- "table_constructor",
- "try",
- "tuple",
- "type",
- "var",
- "while",
- "while_statement",
- "with",
- },
+ angular = nodes.html,
+ arduino = nodes.cpp,
+ astro = nodes.html,
+ bibtex = nodes.bibtex,
+ c = nodes.c,
+ cmake = nodes.cmake,
+ cpp = nodes.cpp,
+ css = nodes.css,
+ cuda = nodes.cpp,
+ d = nodes.d,
+ dart = nodes.dart,
+ dot = nodes.dot,
+ ecma = nodes.ecma,
+ elixir = nodes.elixir,
+ firrtl = nodes.firrtl,
+ fortran = nodes.fortran,
+ glsl = nodes.c,
+ gleam = nodes.gleam,
+ go = nodes.go,
+ hlsl = nodes.cpp,
+ html = nodes.html,
+ java = nodes.java,
+ javascript = nodes.javascript,
+ julia = nodes.julia,
+ just = nodes.just,
+ linkerscript = nodes.linkerscript,
+ lua = nodes.lua,
+ luau = nodes.lua,
+ matlab = nodes.matlab,
+ ninja = nodes.ninja,
+ objc = nodes.c,
+ ocaml = nodes.ocaml,
+ ocaml_interface = nodes.ocaml,
+ pascal = nodes.pascal,
+ php = nodes.php,
+ python = nodes.python,
+ query = nodes.query,
+ r = nodes.r,
+ readline = nodes.readline,
+ ruby = nodes.ruby,
+ rust = nodes.rust,
+ scss = nodes.scss,
+ sql = nodes.sql,
+ ssh_config = nodes.ssh_config,
+ swift = nodes.swift,
+ tablegen = nodes.tablegen,
+ tcl = nodes.tcl,
+ teal = nodes.teal,
+ terraform = nodes.terraform,
+ textproto = nodes.textproto,
+ toml = nodes.toml,
+ typescript = nodes.typescript,
+ vue = nodes.vue,
+ xml = nodes.xml,
+ zig = nodes.zig,
},
},
},
exclude = {
+ buftypes = {
+ "help",
+ "nofile",
+ "prompt",
+ "quickfix",
+ "terminal",
+ },
filetypes = {
"", -- for all buffers without a file type
- "aerial",
"alpha",
- "big_file_disabled_ft",
- "dashboard",
- "dotooagenda",
- "flutterToolsOutline",
+ "bigfile",
+ "checkhealth",
+ "dap-repl",
+ "diff",
"fugitive",
+ "fugitiveblame",
"git",
"gitcommit",
"help",
- "json",
"log",
"markdown",
+ "notify",
"NvimTree",
- "peekaboo",
- "startify",
+ "Outline",
+ "qf",
"TelescopePrompt",
- "todoist",
- "txt",
+ "text",
+ "toggleterm",
"undotree",
"vimwiki",
- "vista",
},
- buftypes = { "terminal", "nofile", "quickfix", "prompt" },
},
})
end
diff --git a/lua/modules/configs/ui/lualine.lua b/lua/modules/configs/ui/lualine.lua
index 5681523a3..39e4b8911 100644
--- a/lua/modules/configs/ui/lualine.lua
+++ b/lua/modules/configs/ui/lualine.lua
@@ -163,8 +163,8 @@ return function()
lsp = {
function()
- local buf_ft = vim.api.nvim_get_option_value("filetype", { scope = "local" })
- local clients = vim.lsp.get_active_clients()
+ local buf_ft = vim.bo.filetype
+ local clients = vim.lsp.get_clients({ buffer = vim.api.nvim_get_current_buf() })
local lsp_lists = {}
local available_servers = {}
if next(clients) == nil then
@@ -201,7 +201,7 @@ return function()
return venv
end
- if vim.api.nvim_get_option_value("filetype", { scope = "local" }) == "python" then
+ if vim.bo.filetype == "python" then
local venv = os.getenv("CONDA_DEFAULT_ENV")
if venv then
return icons.misc.PyEnv .. env_cleanup(venv)
@@ -219,7 +219,7 @@ return function()
tabwidth = {
function()
- return icons.ui.Tab .. vim.api.nvim_get_option_value("tabstop", { scope = "local" })
+ return icons.ui.Tab .. vim.bo.tabstop
end,
padding = 1,
},
diff --git a/lua/modules/configs/ui/neodim.lua b/lua/modules/configs/ui/neodim.lua
index 17a5b262c..08ee94d66 100644
--- a/lua/modules/configs/ui/neodim.lua
+++ b/lua/modules/configs/ui/neodim.lua
@@ -11,6 +11,27 @@ return function()
underline = false,
},
priority = 80,
- disable = { "big_file_disabled_ft" },
+ disable = {
+ "alpha",
+ "bigfile",
+ "checkhealth",
+ "dap-repl",
+ "diff",
+ "fugitive",
+ "fugitiveblame",
+ "git",
+ "gitcommit",
+ "help",
+ "log",
+ "notify",
+ "NvimTree",
+ "Outline",
+ "qf",
+ "TelescopePrompt",
+ "text",
+ "toggleterm",
+ "undotree",
+ "vimwiki",
+ },
})
end
diff --git a/lua/modules/configs/ui/scrollview.lua b/lua/modules/configs/ui/scrollview.lua
index d3a821d53..ef11b5992 100644
--- a/lua/modules/configs/ui/scrollview.lua
+++ b/lua/modules/configs/ui/scrollview.lua
@@ -3,12 +3,22 @@ return function()
require("modules.utils").load_plugin("scrollview", {
mode = "virtual",
- excluded_filetypes = { "NvimTree", "terminal", "nofile", "aerial" },
winblend = 0,
signs_on_startup = { "diagnostics", "folds", "marks", "search", "spell" },
diagnostics_error_symbol = icons.diagnostics.Error,
diagnostics_warn_symbol = icons.diagnostics.Warning,
diagnostics_info_symbol = icons.diagnostics.Information,
diagnostics_hint_symbol = icons.diagnostics.Hint,
+ excluded_filetypes = {
+ "alpha",
+ "fugitive",
+ "git",
+ "notify",
+ "NvimTree",
+ "Outline",
+ "TelescopePrompt",
+ "toggleterm",
+ "undotree",
+ },
})
end
diff --git a/lua/modules/configs/ui/todo.lua b/lua/modules/configs/ui/todo.lua
index bbd8af4b8..ebdef8ee3 100644
--- a/lua/modules/configs/ui/todo.lua
+++ b/lua/modules/configs/ui/todo.lua
@@ -30,7 +30,22 @@ return function()
after = "",
comments_only = true,
max_line_len = 500,
- exclude = { "big_file_disabled_ft", "checkhealth" },
+ exclude = {
+ "alpha",
+ "bigfile",
+ "checkhealth",
+ "dap-repl",
+ "diff",
+ "help",
+ "log",
+ "notify",
+ "NvimTree",
+ "Outline",
+ "qf",
+ "TelescopePrompt",
+ "toggleterm",
+ "undotree",
+ },
},
colors = {
error = { "DiagnosticError", "ErrorMsg", "#DC2626" },
diff --git a/lua/modules/plugins/completion.lua b/lua/modules/plugins/completion.lua
index d4b5d088d..af694f73f 100644
--- a/lua/modules/plugins/completion.lua
+++ b/lua/modules/plugins/completion.lua
@@ -26,7 +26,7 @@ completion["stevearc/aerial.nvim"] = {
event = "LspAttach",
config = require("completion.aerial"),
}
-completion["dnlhc/glance.nvim"] = {
+completion["DNLHC/glance.nvim"] = {
lazy = true,
event = "LspAttach",
config = require("completion.glance"),
@@ -51,8 +51,9 @@ completion["hrsh7th/nvim-cmp"] = {
dependencies = {
{
"L3MON4D3/LuaSnip",
- dependencies = { "rafamadriz/friendly-snippets" },
+ build = "make install_jsregexp",
config = require("completion.luasnip"),
+ dependencies = { "rafamadriz/friendly-snippets" },
},
{ "lukas-reineke/cmp-under-comparator" },
{ "saadparwaiz1/cmp_luasnip" },
diff --git a/lua/modules/plugins/editor.lua b/lua/modules/plugins/editor.lua
index 73b273351..f396fc0ad 100644
--- a/lua/modules/plugins/editor.lua
+++ b/lua/modules/plugins/editor.lua
@@ -63,9 +63,14 @@ editor["smoka7/hop.nvim"] = {
}
editor["tzachar/local-highlight.nvim"] = {
lazy = true,
- event = { "CursorHold", "CursorHoldI" },
+ event = { "BufReadPost", "BufAdd", "BufNewFile" },
config = require("editor.local-highlight"),
}
+editor["brenoprata10/nvim-highlight-colors"] = {
+ lazy = true,
+ event = { "CursorHold", "CursorHoldI" },
+ config = require("editor.highlight-colors"),
+}
editor["romainl/vim-cool"] = {
lazy = true,
event = { "CursorMoved", "InsertEnter" },
@@ -95,7 +100,7 @@ editor["mrjones2014/smart-splits.nvim"] = {
editor["nvim-treesitter/nvim-treesitter"] = {
lazy = true,
build = function()
- if #vim.api.nvim_list_uis() ~= 0 then
+ if vim.fn.has("gui_running") == 1 then
vim.api.nvim_command([[TSUpdate]])
end
end,
@@ -109,10 +114,6 @@ editor["nvim-treesitter/nvim-treesitter"] = {
"windwp/nvim-ts-autotag",
config = require("editor.autotag"),
},
- {
- "NvChad/nvim-colorizer.lua",
- config = require("editor.colorizer"),
- },
{
"hiphish/rainbow-delimiters.nvim",
config = require("editor.rainbow_delims"),
diff --git a/lua/modules/plugins/lang.lua b/lua/modules/plugins/lang.lua
index 6877b0f0a..2cfc3974d 100644
--- a/lua/modules/plugins/lang.lua
+++ b/lua/modules/plugins/lang.lua
@@ -18,7 +18,7 @@ lang["ray-x/go.nvim"] = {
lang["mrcjkb/rustaceanvim"] = {
lazy = true,
ft = "rust",
- version = "^4",
+ version = "*",
init = require("lang.rust"),
dependencies = { "nvim-lua/plenary.nvim" },
}
diff --git a/lua/modules/plugins/tool.lua b/lua/modules/plugins/tool.lua
index bbcf0bb8e..37be1ed8e 100644
--- a/lua/modules/plugins/tool.lua
+++ b/lua/modules/plugins/tool.lua
@@ -4,13 +4,21 @@ tool["tpope/vim-fugitive"] = {
lazy = true,
cmd = { "Git", "G" },
}
--- only for fcitx5 user who uses non-English language during coding
+-- This is specifically for fcitx5 users who code in languages other than English
-- tool["pysan3/fcitx5.nvim"] = {
-- lazy = true,
-- event = "BufReadPost",
-- cond = vim.fn.executable("fcitx5-remote") == 1,
-- config = require("tool.fcitx5"),
-- }
+tool["Bekaboo/dropbar.nvim"] = {
+ lazy = false,
+ config = require("tool.dropbar"),
+ dependencies = {
+ "nvim-tree/nvim-web-devicons",
+ "nvim-telescope/telescope-fzf-native.nvim",
+ },
+}
tool["nvim-tree/nvim-tree.lua"] = {
lazy = true,
cmd = {
@@ -72,18 +80,31 @@ tool["nvim-telescope/telescope.nvim"] = {
cmd = "Telescope",
config = require("tool.telescope"),
dependencies = {
- { "nvim-tree/nvim-web-devicons" },
{ "nvim-lua/plenary.nvim" },
+ { "nvim-tree/nvim-web-devicons" },
+ { "jvgrootveld/telescope-zoxide" },
{ "debugloop/telescope-undo.nvim" },
+ { "nvim-telescope/telescope-frecency.nvim" },
+ { "nvim-telescope/telescope-live-grep-args.nvim" },
+ { "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
+ {
+ "FabianWirth/search.nvim",
+ config = require("tool.search"),
+ },
{
"ahmedkhalf/project.nvim",
event = { "CursorHold", "CursorHoldI" },
config = require("tool.project"),
},
- { "jvgrootveld/telescope-zoxide" },
- { "nvim-telescope/telescope-frecency.nvim" },
- { "nvim-telescope/telescope-live-grep-args.nvim" },
- { "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
+ {
+ "aaronhallaert/advanced-git-search.nvim",
+ cmd = { "AdvancedGitSearch" },
+ dependencies = {
+ "tpope/vim-rhubarb",
+ "tpope/vim-fugitive",
+ "sindrets/diffview.nvim",
+ },
+ },
},
}
diff --git a/lua/modules/plugins/ui.lua b/lua/modules/plugins/ui.lua
index 062f2b0b5..1a5aab469 100644
--- a/lua/modules/plugins/ui.lua
+++ b/lua/modules/plugins/ui.lua
@@ -38,7 +38,6 @@ ui["nvim-lualine/lualine.nvim"] = {
}
ui["zbirenbaum/neodim"] = {
lazy = true,
- commit = "9477da0",
event = "LspAttach",
config = require("ui.neodim"),
}
diff --git a/lua/modules/utils/icons.lua b/lua/modules/utils/icons.lua
index 2b24b3cdb..a050401b6 100644
--- a/lua/modules/utils/icons.lua
+++ b/lua/modules/utils/icons.lua
@@ -2,10 +2,16 @@ local icons = {}
local data = {
kind = {
+ Break = "",
+ Call = "",
+ Case = "",
Class = "",
Color = "",
Constant = "",
Constructor = "",
+ Continue = "",
+ Declaration = "",
+ Delete = "",
Enum = "",
EnumMember = "",
Event = "",
@@ -14,30 +20,35 @@ local data = {
Folder = "",
Fragment = "",
Function = "",
- Interface = "",
Implementation = "",
+ Interface = "",
Keyword = "",
+ List = "",
+ Loop = "",
Method = "",
Module = "",
Namespace = "",
- Number = "",
Operator = "",
Package = "",
Property = "",
Reference = "",
+ Regex = "",
Snippet = "",
+ Statement = "",
Struct = "",
+ Switch = "",
Text = "",
TypeParameter = "",
Undefined = "",
Unit = "",
Value = "",
Variable = "",
- -- ccls-specific icons.
- TypeAlias = "",
+ -- ccls-specific icons
+ Macro = "",
Parameter = "",
StaticMethod = "",
- Macro = "",
+ Terminal = "",
+ TypeAlias = "",
},
type = {
Array = "",
@@ -51,9 +62,11 @@ local data = {
Default = "",
File = "",
Files = "",
+ FileFind = "",
FileTree = "",
Import = "",
Symlink = "",
+ Word = "",
},
git = {
Add = "",
@@ -92,6 +105,7 @@ local data = {
CodeAction = "",
Comment = "",
Dashboard = "",
+ DoubleSeparator = "",
Emoji = "",
EmptyFolder = "",
EmptyFolderOpen = "",
@@ -107,8 +121,6 @@ local data = {
Keyboard = "",
Left = "",
List = "",
- Square = "",
- SymlinkFolder = "",
Lock = "",
Modified = "✥",
Modified_alt = "",
@@ -125,12 +137,13 @@ local data = {
RootFolderOpened = "",
Search = "",
Separator = "",
- DoubleSeparator = "",
SignIn = "",
SignOut = "",
Sort = "",
Spell = "",
+ Square = "",
Symlink = "",
+ SymlinkFolder = "",
Tab = "",
Table = "",
Telescope = "",
@@ -142,7 +155,7 @@ local data = {
Information = "",
Question = "",
Hint = "",
- -- Holo version
+ -- Hollow version
Error_alt = "",
Warning_alt = "",
Information_alt = "",
@@ -150,37 +163,28 @@ local data = {
Hint_alt = "",
},
misc = {
+ Add = "+",
+ Added = "",
Campass = "",
Code = "",
Gavel = "",
+ Ghost = "",
Glass = "",
+ Lego = "",
+ LspAvailable = "",
+ ManUp = "",
+ Neovim = "",
NoActiveLsp = "",
PyEnv = "",
Squirrel = "",
Tag = "",
Tree = "",
- Watch = "",
- Lego = "",
- LspAvailable = "",
Vbar = "│",
- Add = "+",
- Added = "",
- Ghost = "",
- ManUp = "",
- Neovim = "",
Vim = "",
+ Watch = "",
},
cmp = {
- Codeium = "",
- TabNine = "",
- Copilot = "",
- Copilot_alt = "",
- -- Add source-specific icons here
- buffer = "",
- cmp_tabnine = "",
- codeium = "",
- copilot = "",
- copilot_alt = "",
+ buffer = "",
latex_symbols = "",
luasnip = "",
nvim_lsp = "",
@@ -191,6 +195,15 @@ local data = {
tmux = "",
treesitter = "",
undefined = "",
+ -- Add source-specific icons here
+ codeium = "",
+ Codeium = "",
+ copilot = "",
+ copilot_alt = "",
+ Copilot = "",
+ Copilot_alt = "",
+ TabNine = "",
+ cmp_tabnine = "",
},
dap = {
Breakpoint = "",
@@ -211,7 +224,7 @@ local data = {
---Get a specific icon set.
---@param category "kind"|"type"|"documents"|"git"|"ui"|"diagnostics"|"misc"|"cmp"|"dap"
----@param add_space? boolean @Add trailing space after the icon.
+---@param add_space? boolean @Add trailing whitespace after the icon.
function icons.get(category, add_space)
if add_space then
return setmetatable({}, {
diff --git a/lua/modules/utils/init.lua b/lua/modules/utils/init.lua
index c5a25ca42..c2c9fd53e 100644
--- a/lua/modules/utils/init.lua
+++ b/lua/modules/utils/init.lua
@@ -121,7 +121,6 @@ end
---@param background string @The background color to blend with
---@param alpha number|string @Number between 0 and 1 for blending amount.
function M.blend(foreground, background, alpha)
- ---@diagnostic disable-next-line: cast-local-type
alpha = type(alpha) == "string" and (tonumber(alpha, 16) / 0xff) or alpha
local bg = hex_to_rgb(background)
local fg = hex_to_rgb(foreground)
@@ -277,9 +276,9 @@ local function tbl_recursive_merge(dst, src)
for key, value in pairs(src) do
if type(dst[key]) == "table" and type(value) == "function" then
dst[key] = value(dst[key])
- elseif type(dst[key]) == "table" and vim.tbl_islist(dst[key]) and key ~= "dashboard_image" then
+ elseif type(dst[key]) == "table" and vim.islist(dst[key]) and key ~= "dashboard_image" then
vim.list_extend(dst[key], value)
- elseif type(dst[key]) == "table" and type(value) == "table" and not vim.tbl_islist(dst[key]) then
+ elseif type(dst[key]) == "table" and type(value) == "table" and not vim.islist(dst[key]) then
tbl_recursive_merge(dst[key], value)
else
dst[key] = value
diff --git a/nixos/neovim/default.nix b/nixos/neovim/default.nix
index 93134d40f..420e7fac3 100644
--- a/nixos/neovim/default.nix
+++ b/nixos/neovim/default.nix
@@ -4,8 +4,15 @@
, pkgs
, ...
}:
-with lib; let
+let
cfg = config.programs.neovim.nvimdots;
+ inherit (lib) flip warn const;
+ inherit (lib.attrsets) optionalAttrs;
+ inherit (lib.lists) optionals;
+ inherit (lib.modules) mkIf;
+ inherit (lib.options) mkEnableOption mkOption literalExpression;
+ inherit (lib.strings) concatStringsSep versionOlder versionAtLeast;
+ inherit (lib.types) listOf coercedTo package functionTo;
in
{
options = {
@@ -19,6 +26,15 @@ in
Bind lazy-lock.json in your repository to $XDG_CONFIG_HOME/nvim.
Very powerful in terms of keeping the environment consistent, but has the following side effects.
You cannot update it even if you run the Lazy command, because it binds read-only.
+ You need to remove lazy-lock.json before enabling this option if `mergeLazyLock` is set.
+ '';
+ mergeLazyLock = mkEnableOption ''
+ Merges the managed lazy-lock.json with the existing one under $XDG_CONFIG_HOME/nvim if its hash has changed on activation.
+ Upstream package version changes have high priority.
+ This means changes to lazy-lock.json in the config directory (likely due to installing package) will be preserved.
+ In other words, it achieves environment consistency while remaining adaptable to changes.
+ You need to unlink lazy-lock.json before enabling this option if `bindLazyLock` is set.
+ Please refer to the wiki for details on the behavior.
'';
setBuildEnv = mkEnableOption ''
Sets environment variables that resolve build dependencies as required by `mason.nvim` and `nvim-treesitter`
@@ -34,9 +50,11 @@ in
use Haskell plugins.
'';
extraHaskellPackages = mkOption {
- type = with types;
- let fromType = listOf package;
- in coercedTo fromType
+ type =
+ let
+ fromType = listOf package;
+ in
+ coercedTo fromType
(flip warn const ''
Assigning a plain list to extraHaskellPackages is deprecated.
Please assign a function taking a package set as argument, so
@@ -56,7 +74,7 @@ in
'';
};
extraDependentPackages = mkOption {
- type = with types; listOf package;
+ type = listOf package;
default = [ ];
example = literalExpression "[ pkgs.openssl ]";
description = "Extra build depends to add `LIBRARY_PATH` and `CPATH`.";
@@ -67,33 +85,30 @@ in
config =
let
# Inspired from https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/programs/nix-ld.nix
- build-dependent-pkgs = with pkgs; builtins.filter (package: !package.meta.unsupported) [
+ build-dependent-pkgs = builtins.filter (package: !package.meta.unsupported) [
# manylinux
- acl
- attr
- bzip2
- curl
- glibc
- libsodium
- libssh
- libxml2
- openssl
- stdenv.cc.cc
- stdenv.cc.cc.lib
- systemd
- util-linux
- xz
- zlib
- zstd
+ pkgs.acl
+ pkgs.attr
+ pkgs.bzip2
+ pkgs.curl
+ pkgs.glibc
+ pkgs.libsodium
+ pkgs.libssh
+ pkgs.libxml2
+ pkgs.openssl
+ pkgs.stdenv.cc.cc
+ pkgs.stdenv.cc.cc.lib
+ pkgs.systemd
+ pkgs.util-linux
+ pkgs.xz
+ pkgs.zlib
+ pkgs.zstd
# Packages not included in `nix-ld`'s NixOSModule
- glib
- libcxx
+ pkgs.glib
+ pkgs.libcxx
]
++ cfg.extraDependentPackages;
- makePkgConfigPath = x: makeSearchPathOutput "dev" "lib/pkgconfig" x;
- makeIncludePath = x: makeSearchPathOutput "dev" "include" x;
-
neovim-build-deps = pkgs.buildEnv {
name = "neovim-build-deps";
paths = build-dependent-pkgs;
@@ -112,19 +127,37 @@ in
];
in
mkIf cfg.enable {
+ assertions = [
+ {
+ assertion = ! (cfg.bindLazyLock && cfg.mergeLazyLock);
+ message = "bindLazyLock and mergeLazyLock cannot be enabled at the same time.";
+ }
+ ];
xdg.configFile = {
"nvim/init.lua".source = ../../init.lua;
"nvim/lua".source = ../../lua;
"nvim/snips".source = ../../snips;
"nvim/tutor".source = ../../tutor;
- } // lib.optionalAttrs cfg.bindLazyLock {
+ } // optionalAttrs cfg.bindLazyLock {
"nvim/lazy-lock.json".source = ../../lazy-lock.json;
+ } // optionalAttrs cfg.mergeLazyLock {
+ "nvim/lazy-lock.fixed.json" = {
+ source = ../../lazy-lock.json;
+ onChange = ''
+ if [ -f ${config.xdg.configHome}/nvim/lazy-lock.json ]; then
+ tmp=$(mktemp)
+ ${pkgs.jq}/bin/jq -r -s '.[0] * .[1]' ${config.xdg.configHome}/nvim/lazy-lock.json ${config.xdg.configFile."nvim/lazy-lock.fixed.json".source} > "''${tmp}" && mv "''${tmp}" ${config.xdg.configHome}/nvim/lazy-lock.json
+ else
+ ${pkgs.rsync}/bin/rsync --chmod 644 ${config.xdg.configFile."nvim/lazy-lock.fixed.json".source} ${config.xdg.configHome}/nvim/lazy-lock.json
+ fi
+ '';
+ };
};
home = {
- packages = with pkgs; [
- ripgrep
+ packages = [
+ pkgs.ripgrep
];
- shellAliases = optionalAttrs (cfg.setBuildEnv && (lib.versionOlder config.home.stateVersion "24.05")) {
+ shellAliases = optionalAttrs (cfg.setBuildEnv && (versionOlder config.home.stateVersion "24.05")) {
nvim = concatStringsSep " " buildEnv + " nvim";
};
};
@@ -134,33 +167,32 @@ in
withNodeJs = true;
withPython3 = true;
- extraPackages = with pkgs;
- [
- # Dependent packages used by default plugins
- doq
- tree-sitter
- ]
- ++ optionals cfg.withBuildTools [
- cargo
- clang
- cmake
- gcc
- gnumake
- go
- lua51Packages.luarocks
- ninja
- pkg-config
- yarn
- ]
- ++ optionals cfg.withHaskell [
- (pkgs.writeShellApplication {
- name = "stack";
- text = ''
- exec "${pkgs.stack}/bin/stack" "--extra-include-dirs=${config.home.profileDirectory}/lib/nvim-depends/include" "--extra-lib-dirs=${config.home.profileDirectory}/lib/nvim-depends/lib" "$@"
- '';
- })
- (haskellPackages.ghcWithPackages (ps: cfg.extraHaskellPackages ps))
- ];
+ extraPackages = [
+ # Dependent packages used by default plugins
+ pkgs.doq
+ pkgs.tree-sitter
+ ]
+ ++ optionals cfg.withBuildTools [
+ pkgs.cargo
+ pkgs.clang
+ pkgs.cmake
+ pkgs.gcc
+ pkgs.gnumake
+ pkgs.go
+ pkgs.lua51Packages.luarocks
+ pkgs.ninja
+ pkgs.pkg-config
+ pkgs.yarn
+ ]
+ ++ optionals cfg.withHaskell [
+ (pkgs.writeShellApplication {
+ name = "stack";
+ text = ''
+ exec "${pkgs.stack}/bin/stack" "--extra-include-dirs=${config.home.profileDirectory}/lib/nvim-depends/include" "--extra-lib-dirs=${config.home.profileDirectory}/lib/nvim-depends/lib" "$@"
+ '';
+ })
+ (pkgs.haskellPackages.ghcWithPackages (ps: cfg.extraHaskellPackages ps))
+ ];
extraPython3Packages = ps: with ps; [
docformatter
@@ -168,8 +200,8 @@ in
pynvim
];
}
- // lib.optionalAttrs (lib.versionAtLeast config.home.stateVersion "24.05") {
- extraWrapperArgs = lib.optionals cfg.setBuildEnv [
+ // optionalAttrs (versionAtLeast config.home.stateVersion "24.05") {
+ extraWrapperArgs = optionals cfg.setBuildEnv [
"--suffix"
"CPATH"
":"
diff --git a/scripts/install.ps1 b/scripts/install.ps1
index 4d725c6e4..910abc8e5 100644
--- a/scripts/install.ps1
+++ b/scripts/install.ps1
@@ -8,9 +8,9 @@ Set-StrictMode -Version 3.0
$ErrorActionPreference = "Stop" # Exit when command fails
# global-scope vars
-$REQUIRED_NVIM_VERSION = [version]'0.9.0'
-$REQUIRED_NVIM_VERSION_LEGACY = [version]'0.8.0'
$USE_SSH = $True
+$REQUIRED_NVIM_VERSION = [version]'0.10.0'
+$REQUIRED_NVIM_VERSION_LEGACY = [version]'0.9.0'
# package mgr vars
$choco_package_matrix = @{ "gcc" = "mingw"; "git" = "git"; "nvim" = "neovim"; "make" = "make"; "sudo" = "psutils"; "node" = "nodejs"; "pip" = "python3"; "fzf" = "fzf"; "rg" = "ripgrep"; "go" = "go"; "curl" = "curl"; "wget" = "wget"; "tree-sitter" = "tree-sitter"; "ruby" = "ruby"; "rustc" = "rust-ms" }
@@ -20,15 +20,15 @@ $installer_pkg_matrix = @{ "NodeJS" = "npm"; "Python" = "pip"; "Ruby" = "gem" }
# env vars
$env:XDG_CONFIG_HOME ??= $env:LOCALAPPDATA
$env:CCPACK_MGR ??= 'unknown'
-$env:CCLONE_BRANCH ??= 'main'
-$env:CCLONE_BRANCH_LEGACY ??= '0.8'
$env:CCLONE_ATTR ??= 'undef'
+$env:CCLONE_BRANCH ??= 'main'
+$env:CCLONE_BRANCH_LEGACY ??= '0.9'
$env:CCDEST_DIR ??= "$env:XDG_CONFIG_HOME\nvim"
$env:CCBACKUP_DIR = "$env:CCDEST_DIR" + "_backup-" + (Get-Date).ToUniversalTime().ToString("yyyyMMddTHHmmss")
-function _abort ([Parameter(Mandatory = $True)] [string]$Msg,[Parameter(Mandatory = $True)] [string]$Type,[Parameter(Mandatory = $False)] [string]$Info_msg) {
- if ($Info_msg -ne $null) {
- Write-Host $Info_msg
+function _abort ([Parameter(Mandatory = $True)] [string]$Msg,[Parameter(Mandatory = $True)] [string]$Type,[Parameter(Mandatory = $False)] [string]$ExtMsg) {
+ if ($ExtMsg -ne $null) {
+ Write-Host $ExtMsg
}
Write-Error -Message "Error: $Msg" -Category $Type
exit 1
@@ -58,7 +58,7 @@ function info_ext ([Parameter(Mandatory = $True)][ValidateNotNullOrEmpty()] [str
}
function warn ([Parameter(Mandatory = $True)][ValidateNotNullOrEmpty()] [string]$Msg) {
- Write-Host "Warning" -ForegroundColor Yellow -NoNewline; Write-Host ": $(_chomp -Str $Msg)";
+ Write-Host "Warning:" -ForegroundColor Yellow -NoNewline; Write-Host " $(_chomp -Str $Msg)";
}
function warn_ext ([Parameter(Mandatory = $True)][ValidateNotNullOrEmpty()] [string]$Msg) {
@@ -157,7 +157,7 @@ function query_pack {
info -Msg " [Detected] We'll use 'Chocolatey' as the default package mgr."
$env:CCPACK_MGR = 'choco'
} else {
- _abort -Msg "Required executable not found." -Type "NotInstalled" -Info_msg @'
+ _abort -Msg "Required executable not found." -Type "NotInstalled" -ExtMsg @'
You must install a modern package manager before installing this Nvim config.
Available choices are:
- Chocolatey
@@ -292,7 +292,7 @@ function clone_repo ([Parameter(Mandatory = $True)][ValidateNotNullOrEmpty()] [s
safe_execute -WithCmd { git clone --progress -b "$env:CCLONE_BRANCH_LEGACY" "$env:CCLONE_ATTR" $WithURL "$env:CCDEST_DIR" }
} else {
warn -Msg "You have outdated Nvim installed (< $REQUIRED_NVIM_VERSION_LEGACY)."
- _abort -Msg "This Neovim distribution is no longer supported." -Type "NotImplemented" -Info_msg @"
+ _abort -Msg "This Neovim distribution is no longer supported." -Type "NotImplemented" -ExtMsg @"
You have a legacy Neovim distribution installed.
Please make sure you have nvim v$REQUIRED_NVIM_VERSION_LEGACY installed at the very least.
@@ -330,7 +330,7 @@ function _main {
# Check dependencies
if (-not (check_in_path -WithName "nvim")) {
- _abort -Msg "Required executable not found." -Type "NotInstalled" -Info_msg @'
+ _abort -Msg "Required executable not found." -Type "NotInstalled" -ExtMsg @'
You must install Neovim before installing this Nvim config. See:
https://github.com/neovim/neovim/wiki/Installing-Neovim
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
@@ -340,7 +340,7 @@ You must install Neovim before installing this Nvim config. See:
}
if (-not (check_in_path -WithName "git")) {
- _abort -Msg "Required executable not found." -Type "NotInstalled" -Info_msg @'
+ _abort -Msg "Required executable not found." -Type "NotInstalled" -ExtMsg @'
You must install Git before installing this Nvim config. See:
https://git-scm.com/
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
diff --git a/scripts/install.sh b/scripts/install.sh
index 6796f1a0f..0d1e113bb 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -4,15 +4,15 @@
# Allow `[[ -n "$(command)" ]]`, `func "$(command)"`, pipes, etc.
# shellcheck disable=SC2312
-set -u
+set -uo pipefail
-# global vars
+# global-scope vars
+REQUIRED_NVIM_VERSION=0.10.0
+REQUIRED_NVIM_VERSION_LEGACY=0.9.0
+USE_SSH=1
+CLONE_ATTR=("--progress")
DEST_DIR="${HOME}/.config/nvim"
BACKUP_DIR="${DEST_DIR}_backup-$(date +%Y%m%dT%H%M%S)"
-CLONE_ATTR=("--progress")
-REQUIRED_NVIM_VERSION=0.9.0
-REQUIRED_NVIM_VERSION_LEGACY=0.8.0
-USE_SSH=1
abort() {
printf "%s\n" "$@" >&2
@@ -31,7 +31,7 @@ if [[ -n "${CI-}" && -n "${INTERACTIVE-}" ]]; then
abort "Cannot run force-interactive mode in CI."
fi
-# string formatters
+# String formatters
if [[ -t 1 ]]; then
tty_escape() { printf "\033[%sm" "$1"; }
else
@@ -82,7 +82,7 @@ info_ext() {
}
warn() {
- printf "${tty_yellow}Warning${tty_reset}: %s\n" "$(chomp "$1")"
+ printf "${tty_yellow}Warning:${tty_reset} %s\n" "$(chomp "$1")"
}
warn_ext() {
@@ -98,7 +98,7 @@ getc() {
}
ring_bell() {
- # Use the shell's audible bell.
+ # Use the shell's audible bell
if [[ -t 1 ]]; then
printf "\a"
fi
@@ -106,13 +106,12 @@ ring_bell() {
wait_for_user() {
local c
- echo
+ printf "\n"
echo "Press ${tty_bold}RETURN${tty_reset}/${tty_bold}ENTER${tty_reset} to continue or any other key to abort..."
getc c
# we test for \r and \n because some stuff does \r instead
- if ! [[ "${c}" == $'\r' || "${c}" == $'\n' ]]; then
- echo "${tty_red}Aborted.${tty_reset}"
- exit 1
+ if ! [[ "$c" == $'\r' || "$c" == $'\n' ]]; then
+ abort "${tty_red}Aborted.${tty_reset}"
fi
}
@@ -121,9 +120,10 @@ version_ge() {
}
prompt_confirm() {
+ local choice
while true; do
- read -r -p "$1 [Y/n]: " USR_CHOICE
- case "${USR_CHOICE}" in
+ read -r -p "$1 [Y/n]: " choice
+ case "$choice" in
[yY][eE][sS] | [yY])
return 1
;;
@@ -131,10 +131,10 @@ prompt_confirm() {
return 0
;;
*)
- if [[ -z "${USR_CHOICE}" ]]; then
+ if [[ -z "$choice" ]]; then
return 1
fi
- printf "${tty_red}%s\n\n${tty_reset}" "Invalid input! Please enter one of: '[y/yes] / [n/no]'"
+ printf "${tty_red}%s\n\n${tty_reset}" "Input invalid! Please enter one of the following: '[y/yes]' or '[n/no]'."
;;
esac
done
@@ -175,7 +175,7 @@ clone_repo() {
elif check_nvim_version "${REQUIRED_NVIM_VERSION_LEGACY}"; then
warn "You have outdated Nvim installed (< ${REQUIRED_NVIM_VERSION})."
info "Automatically redirecting you to the latest compatible version..."
- execute "git" "clone" "-b" "0.8" "${CLONE_ATTR[@]}" "$1" "${DEST_DIR}"
+ execute "git" "clone" "-b" "0.9" "${CLONE_ATTR[@]}" "$1" "${DEST_DIR}"
else
warn "You have outdated Nvim installed (< ${REQUIRED_NVIM_VERSION_LEGACY})."
abort "$(
diff --git a/tutor/dots.tutor b/tutor/dots.tutor
index 7def1078d..c4232b100 100644
--- a/tutor/dots.tutor
+++ b/tutor/dots.tutor
@@ -1,6 +1,6 @@
# Welcome to the nvimdots Tutor
-Nvimdots is a [neovim](https://neovim.io/) config suite designed for extensibility, performance, and ease
+Nvimdots is a [Neovim](https://neovim.io/) config suite designed for extensibility, performance, and ease
of use. It provides the ability to work with text files yet feels like you are
working within an IDE environment.
@@ -64,7 +64,7 @@ Consequently, this segment of the status line provides insight into the context
your cursor position. It's important to note that this feature relies on LSP, so it
is disabled if the corresponding LSP is not attached to the current buffer.
-You can press `li`{normal} to check LSP info. Upon doing so, you will notice that
+You can press ``{normal}`l`{normal}`i`{normal} to check LSP info. Upon doing so, you will notice that
there are two active clients attached to this buffer.
Now, press [go](go) to toggle the code outline, which displays all symbols defined in
@@ -85,32 +85,33 @@ to the next topic, which covers the basic workflow.
# Lesson 1.2: FIND AND SEARCH
-Nvimdots utilizes [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) as the primary fuzzy finder. It offers numerous
-features for finding and searching. To open the file finder under the current
-working directory, press `ff`{normal}. Then, input the keyword you wish to find and use
-``{normal} and ``{normal} to navigate up and down the list of results. You can preview the
-content of the selected file in the right window and press ``{normal} to open it
-in a new buffer.
-
-Nvimdots also provide several additional search features. One commonly used keymap is
-`fr`{normal}, especially if you frequently edit files across different projects. This
-command lists files you have previously opened and sorts them by "frecency," a
-concept similar to that used in Firefox's address bar. This feature utilizes "Lua
-Bytecode" to permanently store the key-value pairs of file paths and their "frecency"
-values at **~/.local/share/nvim/file_frecency.bin**.
-
-You can press `fw`{normal} to search for a word in the current working directory. This
-feature utilizes [ripgrep](https://github.com/BurntSushi/ripgrep) for searching, allowing you to use it naturally as you would
-with ripgrep.
-
-Nvimdots also provides project management features and integrates them seamlessly
-with telescope. Press `fp`{normal} to open the recent project list. Please refrain from
-quitting this interface; instead, you can add the current working directory to the
-project list by pressing ``{normal}, and remove it by pressing ``{normal}. Typically, the
-current working directory corresponds to the project directory, which is identified
-by LSP and patterns such as *.git/*. However, you have the flexibility to set your own
-patterns. Consequently, the project directory will automatically change when you
-switch to another buffer whose file belongs to a different project.
+Nvimdots utilizes [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) as the primary fuzzy finder, offering numerous
+features for efficient finding and searching. To access the "file finder collection"
+within the current working directory, press ``{normal}`f`{normal}`f`{normal}. Subsequently, enter the
+desired keyword and use ``{normal} and ``{normal} to navigate through the list of results. The
+content of the selected file can be previewed in the adjacent window, and pressing
+``{normal} will open it in a new buffer. Additionally, ``{normal} and ``{normal} allow you to
+switch between various tabs to locate files with different properties. For instance,
+the "Frecency" and "Oldfiles" tabs enable searches based on the most frequently and
+recently opened files, respectively, while the "Buffers" tab facilitates searches
+among currently opened buffers.
+
+For pattern searches within the current working directory, press ``{normal}`f`{normal}`p`{normal}. This
+functionality leverages [ripgrep](https://github.com/BurntSushi/ripgrep) for its search capabilities, making it as intuitive
+to use as ripgrep itself. As with the "file finder collection", ``{normal} and ``{normal} can
+be used to cycle through the search tabs. The "Word under cursor" tab displays all
+instances of the word located under the current cursor position.
+
+Nvimdots also offers comprehensive dossier management, seamlessly integrated with
+Telescope. Press ``{normal}`f`{normal}`d`{normal} to access the recent dossiers list. The first tab
+presents the currently saved sessions; select a session and press ``{normal} to restore
+the corresponding session. The second tab lists various projects. Instead of exiting
+this interface, you can add the current working directory to the project list by
+pressing ``{normal}, and remove it by pressing ``{normal}. Generally, the current working
+directory corresponds to the current project's directory, identified by the LSP or
+patterns such as *.git/*. You can also define your own patterns. Consequently, the
+current working directory will automatically switch when you move to another buffer
+containing a file from a different project.
# Lesson 1.3: EDIT AND FORMAT