pojokcodeid.nvim-lazy/lua/_vscode/functions.lua

266 lines
5 KiB
Lua
Raw Normal View History

2023-12-27 07:34:20 +07:00
function Active_whichkey()
2024-06-14 08:40:35 +07:00
VSCodeNotify("whichkey.show")
2023-12-26 11:19:42 +07:00
end
function Top_screen()
2024-06-14 08:40:35 +07:00
Cmd("call <SNR>3_reveal('top', 0)")
2023-12-26 11:19:42 +07:00
end
function Bottom_screen()
2024-06-14 08:40:35 +07:00
Cmd("call <SNR>3_reveal('bottom', 0)")
2023-12-26 11:19:42 +07:00
end
function Move_to_top_screen()
2024-06-14 08:40:35 +07:00
Cmd("call <SNR>3_moveCursor('top')")
2023-12-26 11:19:42 +07:00
end
function Move_to_bottom_screen()
2024-06-14 08:40:35 +07:00
Cmd("call <SNR>3_moveCursor('bottom')")
2023-12-26 11:19:42 +07:00
end
function Scroll_line_down()
2024-06-14 08:40:35 +07:00
VSCodeCall("scrollLineDown")
2023-12-26 11:19:42 +07:00
end
function Scroll_line_up()
2024-06-14 08:40:35 +07:00
VSCodeCall("scrollLineUp")
2023-12-26 11:19:42 +07:00
end
function Vscode_ctrl_d()
2024-06-14 08:40:35 +07:00
VSCodeNotify("vscode-neovim.ctrl-d")
2023-12-26 11:19:42 +07:00
end
function Vscode_ctrl_u()
2024-06-14 08:40:35 +07:00
VSCodeNotify("vscode-neovim.ctrl-u")
2023-12-26 11:19:42 +07:00
end
function Move_to_bottom_screen__center_screen()
2024-06-14 08:40:35 +07:00
Move_to_bottom_screen()
Center_screen()
2023-12-26 11:19:42 +07:00
end
function Move_to_top_screen__center_screen()
2024-06-14 08:40:35 +07:00
Move_to_top_screen()
Center_screen()
2023-12-26 11:19:42 +07:00
end
function Trim_trailing_whitespace()
2024-06-14 08:40:35 +07:00
VSCodeCall("editor.action.trimTrailingWhitespace")
2023-12-26 11:19:42 +07:00
end
function Save()
2024-06-14 08:40:35 +07:00
VSCodeCall("workbench.action.files.save")
2023-12-26 11:19:42 +07:00
end
function Save_no_format()
2024-06-14 08:40:35 +07:00
VSCodeCall("workbench.action.files.saveWithoutFormatting")
2023-12-26 11:19:42 +07:00
end
function Trim__save__no_format()
2024-06-14 08:40:35 +07:00
Trim_trailing_whitespace()
Save_no_format()
2023-12-26 11:19:42 +07:00
end
function Trim__save__no_highlight()
2024-06-14 08:40:35 +07:00
Trim_trailing_whitespace()
Save()
Remove_highlighting()
2023-12-26 11:19:42 +07:00
end
function Format()
2024-06-14 08:40:35 +07:00
VSCodeCall("editor.action.formatDocument")
print("formatted!")
2023-12-26 11:19:42 +07:00
end
function Trim__save__format()
2024-06-14 08:40:35 +07:00
Trim_trailing_whitespace()
Format()
Save()
2023-12-26 11:19:42 +07:00
end
function Reveal_definition_aside()
2024-06-14 08:40:35 +07:00
VSCodeNotify("editor.action.revealDefinitionAside")
2023-12-26 11:19:42 +07:00
end
function Go_to_implementation()
2024-06-14 08:40:35 +07:00
VSCodeNotify("editor.action.goToImplementation")
2023-12-26 11:19:42 +07:00
end
function Go_to_reference()
2024-06-14 08:40:35 +07:00
VSCodeNotify("editor.action.goToReferences")
2023-12-26 11:19:42 +07:00
end
function Rename_symbol()
2024-06-14 08:40:35 +07:00
VSCodeNotify("editor.action.rename")
2023-12-26 11:19:42 +07:00
end
function Outdent()
2024-06-14 08:40:35 +07:00
---@diagnostic disable-next-line: unused-local
for i = 1, vim.v.count1 do
VSCodeNotify("editor.action.outdentLines")
end
2023-12-26 11:19:42 +07:00
end
function Indent()
2024-06-14 08:40:35 +07:00
---@diagnostic disable-next-line: unused-local
for i = 1, vim.v.count1 do
VSCodeNotify("editor.action.indentLines")
end
2023-12-26 11:19:42 +07:00
end
function Outdent_vis()
2024-06-14 08:40:35 +07:00
VSCodeNotify("editor.action.outdentLines", false)
2023-12-26 11:19:42 +07:00
end
function Indent_vis()
2024-06-14 08:40:35 +07:00
VSCodeNotify("editor.action.indentLines", false)
2023-12-26 11:19:42 +07:00
end
function Comment()
2024-06-14 08:40:35 +07:00
VSCodeNotify("editor.action.commentLine")
2023-12-26 11:19:42 +07:00
end
function Convert_to_spaces()
2024-06-14 08:40:35 +07:00
VSCodeNotify("editor.action.indentationToSpaces")
2023-12-26 11:19:42 +07:00
end
function Convert_to_tabs()
2024-06-14 08:40:35 +07:00
VSCodeNotify("editor.action.indentationToTabs")
2023-12-26 11:19:42 +07:00
end
function Indent_with_spaces()
2024-06-14 08:40:35 +07:00
VSCodeNotify("editor.action.indentUsingSpaces")
2023-12-26 11:19:42 +07:00
end
function Indent_with_tabs()
2024-06-14 08:40:35 +07:00
VSCodeNotify("editor.action.indentUsingTabs")
2023-12-26 11:19:42 +07:00
end
function CloseEditor()
2024-06-14 08:40:35 +07:00
VSCodeNotify("workbench.action.closeActiveEditor")
2023-12-26 11:19:42 +07:00
end
function UndoCloseEditor()
2024-06-14 08:40:35 +07:00
VSCodeNotify("workbench.action.reopenClosedEditor")
2023-12-26 11:19:42 +07:00
end
function Git_stage_file()
2024-06-14 08:40:35 +07:00
Trim_trailing_whitespace()
Save()
VSCodeNotify("git.stage")
2023-12-26 11:19:42 +07:00
end
function Git_unstage_file()
2024-06-14 08:40:35 +07:00
Save()
VSCodeNotify("git.unstage")
2023-12-26 11:19:42 +07:00
end
function Git_revert_change()
2024-06-14 08:40:35 +07:00
VSCodeNotify("git.revertSelectedRanges")
2023-12-26 11:19:42 +07:00
end
function Git_stage_change()
2024-06-14 08:40:35 +07:00
VSCodeNotify("git.stageSelectedRanges")
2023-12-26 11:19:42 +07:00
end
function Git_unstage_change()
2024-06-14 08:40:35 +07:00
VSCodeNotify("git.unstageSelectedRanges")
2023-12-26 11:19:42 +07:00
end
function Git_open_changes()
2024-06-14 08:40:35 +07:00
VSCodeNotify("git.openChange")
2023-12-26 11:19:42 +07:00
end
function Git_open_all_changes()
2024-06-14 08:40:35 +07:00
VSCodeNotify("git.openAllChanges")
2023-12-26 11:19:42 +07:00
end
function Accept_merge_both()
2024-06-14 08:40:35 +07:00
VSCodeNotify("merge-conflict.accept.both")
2023-12-26 11:19:42 +07:00
end
function Accept_merge_all_both()
2024-06-14 08:40:35 +07:00
VSCodeNotify("merge-conflict.accept.all-both")
2023-12-26 11:19:42 +07:00
end
function Accept_merge_current()
2024-06-14 08:40:35 +07:00
VSCodeNotify("merge-conflict.accept.current")
2023-12-26 11:19:42 +07:00
end
function Accept_merge_all_current()
2024-06-14 08:40:35 +07:00
VSCodeNotify("merge-conflict.accept.all-current")
2023-12-26 11:19:42 +07:00
end
function Accept_merge_incoming()
2024-06-14 08:40:35 +07:00
VSCodeNotify("merge-conflict.accept.incoming")
2023-12-26 11:19:42 +07:00
end
function Accept_merge_all_incoming()
2024-06-14 08:40:35 +07:00
VSCodeNotify("merge-conflict.accept.all-incoming")
2023-12-26 11:19:42 +07:00
end
function Accept_merge_selection()
2024-06-14 08:40:35 +07:00
VSCodeNotify("merge-conflict.accept.selection")
2023-12-26 11:19:42 +07:00
end
function Codesnap()
2024-06-14 08:40:35 +07:00
VSCodeNotify("codesnap.start", true)
2023-12-26 11:19:42 +07:00
end
function Comment_vis()
2024-06-14 08:40:35 +07:00
VSCodeNotify("editor.action.commentLine", false)
2023-12-26 11:19:42 +07:00
end
function Toggle_breakpoint()
2024-06-14 08:40:35 +07:00
VSCodeNotify("editor.debug.action.toggleBreakpoint")
2023-12-26 11:19:42 +07:00
end
function Copy_path()
2024-06-14 08:40:35 +07:00
VSCodeNotify("copyFilePath")
2023-12-26 11:19:42 +07:00
end
function Copy_relative_path()
2024-06-14 08:40:35 +07:00
VSCodeNotify("copyRelativeFilePath")
2023-12-26 11:19:42 +07:00
end
function Active_whichkey()
2024-06-14 08:40:35 +07:00
VSCodeNotify("whichkey.show")
2023-12-26 11:19:42 +07:00
end
function Navigation_down()
2024-06-14 08:40:35 +07:00
VSCodeNotify("workbench.action.navigateDown")
2023-12-26 11:19:42 +07:00
end
function Navigation_up()
2024-06-14 08:40:35 +07:00
VSCodeNotify("workbench.action.navigateUp")
2023-12-26 11:19:42 +07:00
end
function Navigation_left()
2024-06-14 08:40:35 +07:00
VSCodeNotify("workbench.action.navigateLeft")
2023-12-26 11:19:42 +07:00
end
function Navigation_right()
2024-06-14 08:40:35 +07:00
VSCodeNotify("workbench.action.navigateRight")
2023-12-26 11:19:42 +07:00
end
2023-12-26 13:31:18 +07:00
function Select_all()
2024-06-14 08:40:35 +07:00
VSCodeNotify("editor.action.selectAll")
2023-12-26 13:31:18 +07:00
end
function Copy_clipboard()
2024-06-14 08:40:35 +07:00
VSCodeNotify("editor.action.clipboardCopyAction")
2023-12-26 13:31:18 +07:00
end
function Paste_clipboard()
2024-06-14 08:40:35 +07:00
VSCodeNotify("editor.action.clipboardPasteAction")
2023-12-26 13:31:18 +07:00
end
function Save()
2024-06-14 08:40:35 +07:00
VSCodeNotify("workbench.action.files.save")
VSCodeNotify("workbench.action.files.saveAll")
2023-12-26 13:31:18 +07:00
end
function Close()
2024-06-14 08:40:35 +07:00
VSCodeNotify("workbench.action.closeActiveEditor")
2023-12-26 13:31:18 +07:00
end