Unified handling of local / global variables
This commit is contained in:
2
init.lua
2
init.lua
@@ -1,6 +1,6 @@
|
|||||||
-- adjust proxy on Windows
|
-- adjust proxy on Windows
|
||||||
if vim.loop.os_environ().OS == 'Windows_NT' then
|
if vim.loop.os_environ().OS == 'Windows_NT' then
|
||||||
-- TODO move out of the tree and do not check in
|
-- TODO move out of the tree
|
||||||
vim.fn.setenv("http_proxy", "http://10.167.16.21:80")
|
vim.fn.setenv("http_proxy", "http://10.167.16.21:80")
|
||||||
vim.fn.setenv("https_proxy", "http://10.167.16.21:80")
|
vim.fn.setenv("https_proxy", "http://10.167.16.21:80")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
-- define your colorscheme here
|
-- define your colorscheme here
|
||||||
local colorscheme = 'lunaperche-sl'
|
local COLORSCHEME = 'lunaperche-sl'
|
||||||
|
|
||||||
local is_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme)
|
local is_ok, _ = pcall(vim.cmd, "colorscheme " .. COLORSCHEME)
|
||||||
if not is_ok then
|
if not is_ok then
|
||||||
vim.notify('colorscheme ' .. colorscheme .. ' not found!')
|
vim.notify('colorscheme ' .. COLORSCHEME .. ' not found!')
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
|
local DIARY_FOLDER = vim.fs.joinpath(vim.env.HOME, '.diary/asciidoc')
|
||||||
|
|
||||||
local diary_open = function(opts)
|
local diary_open = function(opts)
|
||||||
local date = opts.args ~= '' and opts.args or os.date('%Y-%m-%d')
|
local date = opts.args ~= '' and opts.args or os.date('%Y-%m-%d')
|
||||||
local year, month = date:match('(%d%d%d%d)-(%d%d)')
|
local year, month = date:match('(%d%d%d%d)-(%d%d)')
|
||||||
local folder = vim.fs.joinpath(vim.env.HOME, string.format('.diary/asciidoc/%s', year))
|
local folder = vim.fs.joinpath(DIARY_FOLDER, string.format('%s', year))
|
||||||
vim.fn.mkdir(folder, "p")
|
vim.fn.mkdir(folder, "p")
|
||||||
local file = string.format('%s/diary-%s-%s.adoc', folder, year, month)
|
local file = string.format('%s/diary-%s-%s.adoc', folder, year, month)
|
||||||
print("file is:", file)
|
print("file is:", file)
|
||||||
|
|||||||
@@ -5,10 +5,9 @@
|
|||||||
---------------------------------------------------
|
---------------------------------------------------
|
||||||
|
|
||||||
-- this is specific for a machine
|
-- this is specific for a machine
|
||||||
if vim.loop.os_gethostname() == 'slaptop' then
|
local ORG_BASE_FOLDER = '~/Documents/Eigene (Briefe etc.)/org'
|
||||||
_G.ORG_BASE_FOLDER = '~/Documents/Eigene (Briefe etc.)/org'
|
if vim.loop.os_gethostname() != 'slaptop' then
|
||||||
else
|
ORG_BASE_FOLDER = '~/OneDrive/Desktop/orgfiles'
|
||||||
_G.ORG_BASE_FOLDER = '~/OneDrive/Desktop/orgfiles'
|
|
||||||
end
|
end
|
||||||
sl_opt = {
|
sl_opt = {
|
||||||
org_base_folder = ORG_BASE_FOLDER,
|
org_base_folder = ORG_BASE_FOLDER,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# slaptop local snippets for all modes
|
# local snippets for all modes
|
||||||
|
|
||||||
snippet todo "Add a TODO marker"
|
snippet todo "Add a TODO marker"
|
||||||
// TODO.`strftime("%Y-%m-%d -")`
|
// TODO.`strftime("%Y-%m-%d -")`
|
||||||
|
|||||||
Reference in New Issue
Block a user