Skip to content

Commit

Permalink
feat(plugins): shorten directory path output in printer plugin to mat…
Browse files Browse the repository at this point in the history
…ch git cwd
  • Loading branch information
ecosse3 committed Oct 3, 2023
1 parent 85e8940 commit 5a96b1a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lua/plugins/printer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ require('printer').setup({
end,
},
-- function which modifies the text inside string in the print statement, by default it adds the path and line number
-- add_to_inside = function(text)
-- return string.format("[%s:%s] %s", vim.fn.expand("%"), vim.fn.line("."), text)
-- end,
add_to_inside = function(text)
return string.format("[%s:%s] %s", vim.fn.expand("%:h"):gsub(GIT_CWD(), ''), vim.fn.line("."), text)
end,
-- set to to indenity function to turn off the default behaviour
-- add_to_inside = function(text)
-- return text
Expand Down

0 comments on commit 5a96b1a

Please sign in to comment.