feat: swaync cpu frequency slider

This commit is contained in:
2025-09-26 08:57:30 +03:00
parent 9f7b47f8ea
commit 6f039f587b
3 changed files with 71 additions and 22 deletions

View File

@@ -47,6 +47,22 @@ vim.keymap.set("n", "<space>gb", dap.run_to_cursor, { desc = "Dap Run to cursor"
local function toggle_terminal()
require("nvchad.term").toggle { pos = "sp", id = "htoggleTerm" }
end
local function toggle_git_add()
local filepath = vim.fn.expand("%:p") -- Get the full path of the current file
local handle = io.popen("git ls-files --cached --error-unmatch " .. filepath .. " 2>/dev/null") -- Check if the file is staged
local result = handle:read("*a")
handle:close()
if result ~= "" then
os.execute("git reset " .. filepath) -- Unstage the file if it's already staged
print("Unstaged: " .. filepath)
else
os.execute("git add " .. filepath) -- Stage the file if it's not staged
print("Staged: " .. filepath)
end
end
map({ "n", "t" }, "<A-b>", toggle_terminal, { desc = "terminal toggleable horizontal term" })
map({ "n", "t" }, "<C-`>", toggle_terminal, { desc = "terminal toggleable horizontal term" })
@@ -86,6 +102,9 @@ vim.keymap.set("n", "<leader>ft", '<cmd>TodoTelescope<cr>', { desc = "Telescope
-- nvimtree refresh
vim.keymap.set("n", "<leader>tr", '<cmd>NvimTreeRefresh<cr>', { desc = "Nvimtree Refresh" })
-- toggle git add current file
vim.keymap.set("n", "<leader>ga", toggle_git_add, { desc = "Toggle git add for current file" })
-- nvimtree open file without focusing
vim.keymap.set("n", "T",
function(node)