Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
be98b94f97 | |||
0dbfa8f422 | |||
ad454d9cf8 |
10
.timer.toml
10
.timer.toml
@ -1,7 +1,13 @@
|
|||||||
## dates and their corresponding seconds been here :)
|
## dates and their corresponding seconds been here :)
|
||||||
|
[24-10-07]
|
||||||
|
u80864958_at_u80864958 = 432
|
||||||
[24-10-08]
|
[24-10-08]
|
||||||
u80864958_at_u80864958 = 425
|
u80864958_at_u80864958 = 425
|
||||||
[24-10-11]
|
[24-10-11]
|
||||||
u80864958_at_u80864958 = 6021
|
u80864958_at_u80864958 = 6021
|
||||||
[24-10-07]
|
[24-10-15]
|
||||||
u80864958_at_u80864958 = 432
|
schreifuchs_at_archlinux = 128
|
||||||
|
[24-11-06]
|
||||||
|
schreifuchs_at_archibald = 18
|
||||||
|
[24-12-25]
|
||||||
|
schreifuchs_at_archibald = 204
|
||||||
|
@ -22,6 +22,15 @@ If it doesn't Timer searches the next 10 higher directories for one. If there is
|
|||||||
|
|
||||||
```:TimerSave```: saves the current time to ```.timer.toml```. If the file doesn't exist it gets created.
|
```:TimerSave```: saves the current time to ```.timer.toml```. If the file doesn't exist it gets created.
|
||||||
|
|
||||||
|
## Dependencies
|
||||||
|
|
||||||
|
You must have the ```hostname``` util installed on your system.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
## on Arch based distros:
|
||||||
|
sudo pacmn -S inetutils
|
||||||
|
```
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Lunar vim:
|
Lunar vim:
|
||||||
|
@ -10,7 +10,7 @@ local clean_to = 1
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
local function clean_from(from, events)
|
local function clean_from(from, events) -- cleans the events
|
||||||
local clean_events = {}
|
local clean_events = {}
|
||||||
|
|
||||||
-- coppy until from
|
-- coppy until from
|
||||||
@ -46,7 +46,7 @@ local function clean_from(from, events)
|
|||||||
return clean_events
|
return clean_events
|
||||||
end
|
end
|
||||||
|
|
||||||
local function summ_time()
|
local function summ_time() --returns time in seconds from the fous events
|
||||||
focus_events = clean_from(clean_to + 1, focus_events)
|
focus_events = clean_from(clean_to + 1, focus_events)
|
||||||
clean_to = #focus_events
|
clean_to = #focus_events
|
||||||
|
|
||||||
|
12
lua/toml.lua
12
lua/toml.lua
@ -564,7 +564,15 @@ TOML.encode = function(tbl)
|
|||||||
local cache = {}
|
local cache = {}
|
||||||
|
|
||||||
local function parse(tbl)
|
local function parse(tbl)
|
||||||
for k, v in pairs(tbl) do
|
local tbl_keys = {}
|
||||||
|
for k in pairs(tbl) do
|
||||||
|
table.insert(tbl_keys, k)
|
||||||
|
end
|
||||||
|
table.sort(tbl_keys)
|
||||||
|
|
||||||
|
|
||||||
|
for _, k in pairs(tbl_keys) do
|
||||||
|
local v = tbl[k]
|
||||||
if type(v) == "boolean" then
|
if type(v) == "boolean" then
|
||||||
toml = toml .. k .. " = " .. tostring(v) .. "\n"
|
toml = toml .. k .. " = " .. tostring(v) .. "\n"
|
||||||
elseif type(v) == "number" then
|
elseif type(v) == "number" then
|
||||||
@ -572,7 +580,7 @@ TOML.encode = function(tbl)
|
|||||||
elseif type(v) == "string" then
|
elseif type(v) == "string" then
|
||||||
local quote = '"'
|
local quote = '"'
|
||||||
v = v:gsub("\\", "\\\\")
|
v = v:gsub("\\", "\\\\")
|
||||||
|
--
|
||||||
-- if the string has any line breaks, make it multiline
|
-- if the string has any line breaks, make it multiline
|
||||||
if v:match("^\n(.*)$") then
|
if v:match("^\n(.*)$") then
|
||||||
quote = quote:rep(3)
|
quote = quote:rep(3)
|
||||||
|
Loading…
Reference in New Issue
Block a user