This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local xxd_dump_cmd = 'xxd -g 1 -u' | |
local xxd_cur_pos = nil | |
local function is_binary_file() | |
local filename = vim.fn.expand('%:t') | |
-- local basename = string.match(filename, "^[a-z]*$") | |
local binary_ext = { 'png', 'jpg', 'jpeg', 'out' } | |
local ext = string.match(filename, "%.([^%.]+)$") | |
if ext == nil and string.match(filename, '[a-z]+') then return true end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- vim.g.last_tab_page_handler = nil | |
-- LastTabPageHandler = nil | |
function TabSwitch(handler) | |
local curr_handler = vim.api.nvim_get_current_tabpage() | |
local next_handler = handler | |
-- if (handler == curr_handler) then | |
-- next_handler = LastTabPageHandler | |
-- LastTabPageHandler = curr_handler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function LspRename() | |
local curr_name = vim.fn.expand("<cword>") | |
local value = vim.fn.input("LSP Rename: ", curr_name) | |
local lsp_params = vim.lsp.util.make_position_params() | |
if not value or #value == 0 or curr_name == value then return end | |
-- request lsp rename | |
lsp_params.newName = value | |
vim.lsp.buf_request(0, "textDocument/rename", lsp_params, function(_, res, ctx, _) |