We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 22094c4 commit f8d12b4Copy full SHA for f8d12b4
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,9 @@ local expansions = {
14
16
return vim.fn.expand('%:p')
15
17
end,
18
['%%n'] = function()
- return os.getenv('USER')
19
+ return is_windows
20
+ and os.getenv('USERNAME')
21
+ or os.getenv('USER')
22
23
['%%x'] = function()
24
return vim.fn.getreg('+')
0 commit comments