mirror of
https://github.com/Baipyrus/nvim-config.git
synced 2024-12-25 12:51:45 +00:00
bugfix: fix path keymap to lowercase for edgecases
This commit is contained in:
parent
2758e420cc
commit
bebfb5808f
@ -120,8 +120,8 @@ vim.keymap.set({ 'n', 'v' }, '<leader>gy', global_cmd_yank, { desc = '[G]lobal c
|
|||||||
-- Fix filename keymap
|
-- Fix filename keymap
|
||||||
vim.keymap.set({ 'n', 'v' }, '<leader>fp', function()
|
vim.keymap.set({ 'n', 'v' }, '<leader>fp', function()
|
||||||
-- lua print(string.gsub(vim.api.nvim_buf_get_name(0), vim.fn.getcwd(), ''))
|
-- lua print(string.gsub(vim.api.nvim_buf_get_name(0), vim.fn.getcwd(), ''))
|
||||||
local cwd = vim.fn.getcwd()
|
local cwd = vim.fn.getcwd():lower()
|
||||||
local path = vim.api.nvim_buf_get_name(0)
|
local path = vim.api.nvim_buf_get_name(0):lower()
|
||||||
local file, _ = string.gsub(path, cwd .. '\\', '')
|
local file, _ = string.gsub(path, cwd .. '\\', '')
|
||||||
vim.cmd('0f | file ' .. file)
|
vim.cmd('0f | file ' .. file)
|
||||||
end, { desc = '[F]ile Fix Relative [P]ath' })
|
end, { desc = '[F]ile Fix Relative [P]ath' })
|
||||||
|
Loading…
Reference in New Issue
Block a user