jones-nvim-config/lua/commands.lua

20 lines
432 B
Lua
Raw Permalink Normal View History

2024-05-05 12:55:15 +00:00
local api = vim.api
-- Show file path in command bar
api.nvim_create_user_command("ShowFilePath", function()
print(vim.fn.expand("%:p"))
end, { bang = true })
2024-05-27 22:18:39 +00:00
-- Toggle wrap
vim.api.nvim_create_user_command("ToggleWrap", function()
if vim.wo.wrap then
vim.wo.wrap = false
print("Word wrap disabled")
else
vim.wo.wrap = true
2024-06-05 13:41:55 +00:00
vim.wo.linebreak = true
vim.wo.breakindent = true
2024-05-27 22:18:39 +00:00
print("Word wrap enabled")
end
end, {})