We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 22094c4 commit 4446069Copy full SHA for 4446069
lua/orgmode/capture/template/init.lua
@@ -6,6 +6,8 @@ local Calendar = require('orgmode.objects.calendar')
6
local Promise = require('orgmode.utils.promise')
7
local Input = require('orgmode.ui.input')
8
9
+local is_windows = vim.loop.os_uname().sysname == 'Windows_NT'
10
+
11
local expansions = {
12
['%%f'] = function()
13
return vim.fn.expand('%')
@@ -14,7 +16,7 @@ local expansions = {
14
16
return vim.fn.expand('%:p')
15
17
end,
18
['%%n'] = function()
- return os.getenv('USER')
19
+ return is_windows and os.getenv('USERNAME') or os.getenv('USER')
20
21
['%%x'] = function()
22
return vim.fn.getreg('+')
0 commit comments