summaryrefslogtreecommitdiff
path: root/pkgs/custom-neovim/config/lua
diff options
context:
space:
mode:
authortriethyl <triethylammonium@pm.me>2025-08-21 21:45:20 -0400
committertriethyl <triethylammonium@pm.me>2025-08-21 21:45:20 -0400
commit238a47e986fb9ef8073811b14202ae2a2cb7dfba (patch)
treecdcaba8087f8e608eb71f878764d8febeb3252b7 /pkgs/custom-neovim/config/lua
parent637d0dc2fce0021985579d43efc2461bf65cad8e (diff)
neovim: working on heirline
Diffstat (limited to 'pkgs/custom-neovim/config/lua')
-rw-r--r--pkgs/custom-neovim/config/lua/keymaps.lua2
-rw-r--r--pkgs/custom-neovim/config/lua/plugins/heirline.lua32
2 files changed, 23 insertions, 11 deletions
diff --git a/pkgs/custom-neovim/config/lua/keymaps.lua b/pkgs/custom-neovim/config/lua/keymaps.lua
index 1057181..08558af 100644
--- a/pkgs/custom-neovim/config/lua/keymaps.lua
+++ b/pkgs/custom-neovim/config/lua/keymaps.lua
@@ -39,6 +39,8 @@ mapkey("n", "<leader>p", "Paste on newline", ":pu<cr>")
-- Visual Movement Keys
mapkey({"n", "v"}, "j", "Go down visually", "gj")
mapkey({"n", "v"}, "k", "Go up visually", "gk")
+mapkey({"n", "v"}, "<down>", "Go down visually", "gj")
+mapkey({"n", "v"}, "<up>", "Go up visually", "gk")
-- QOL Keys
mapkey("t", "<Esc><Esc>", "Exit terminal insert mode", "<C-\\><C-n>")
diff --git a/pkgs/custom-neovim/config/lua/plugins/heirline.lua b/pkgs/custom-neovim/config/lua/plugins/heirline.lua
index adb7c92..9cfe7fe 100644
--- a/pkgs/custom-neovim/config/lua/plugins/heirline.lua
+++ b/pkgs/custom-neovim/config/lua/plugins/heirline.lua
@@ -148,10 +148,10 @@ return {
condition = conditions.has_diagnostics,
-- Example of defining custom LSP diagnostic icons, you can copypaste in your config:
-- Fetching custom diagnostic icons
- error_icon = vim.diagnostic.config()['signs']['text'][vim.diagnostic.severity.ERROR] or "",
- warn_icon = vim.diagnostic.config()['signs']['text'][vim.diagnostic.severity.WARN] or "",
- info_icon = vim.diagnostic.config()['signs']['text'][vim.diagnostic.severity.INFO] or "",
- hint_icon = vim.diagnostic.config()['signs']['text'][vim.diagnostic.severity.HINT] or "",
+ error_icon = (vim.diagnostic.config()['signs']['text'][vim.diagnostic.severity.ERROR]) or "",
+ warn_icon = (vim.diagnostic.config()['signs']['text'][vim.diagnostic.severity.WARN]) or "",
+ info_icon = (vim.diagnostic.config()['signs']['text'][vim.diagnostic.severity.INFO]) or "",
+ hint_icon = (vim.diagnostic.config()['signs']['text'][vim.diagnostic.severity.HINT]) or "",
init = function(self)
self.errors = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.ERROR })
@@ -163,9 +163,6 @@ return {
update = { "DiagnosticChanged", "BufEnter" },
{
- provider = "![",
- },
- {
provider = function(self)
-- 0 is just another output, we can decide to print it or not!
return self.errors > 0 and (self.error_icon .. self.errors .. " ")
@@ -174,7 +171,7 @@ return {
},
{
provider = function(self)
- return self.warnings > 0 and (self.warn_icon .. self.warnings .. " ")
+ return self.warnings > 0 and (--[[ self.warn_icon ]] "" .. self.warnings .. " ")
end,
hl = { fg = "diag_warn" },
},
@@ -190,9 +187,20 @@ return {
end,
hl = { fg = "diag_hint" },
},
- {
- provider = "]",
- },
+ }
+
+ -- Working directory component
+ components.cwd = {
+ provider = function()
+ local cwd = vim.fn.getcwd(0)
+ cwd = vim.fn.fnamemodify(cwd, ":~")
+ if not conditions.width_percent_below(#cwd, 0.25) then
+ cwd = vim.fn.pathshorten(cwd)
+ end
+ local trail = cwd:sub(-1) == '/' and '' or "/"
+ return cwd .. trail
+ end,
+ hl = { fg = "blue", bold = true },
}
-- Spacers
@@ -203,6 +211,8 @@ return {
local statusline = {
components.mode,
space,
+ components.cwd,
+ space,
components.diagnostics,
dynamic_space,