feat: swaync cpu frequency slider
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user