Customizing Templates #101
Replies: 1 comment
-
Many things to discuss here... 😄 First of all, regarding Secondly, regarding the change of Regarding if dinfo.month ~= 1 then
prevmonth monthmap[dinfo.month-1]
else
prevmonth = monthmap[12]
end For quarter calculation, it is different. As discussed in #90, some people (business) may decide that the Q1 is not Jan-March, but something else. Now for the modification of stuff and general contribution, here is how I do it. First of all, you can not just add random stuff in your configuration file and expect it to pass through telekasten. The configuration is in essence just a table with values for some parameters. Adding code in it will not do anything. What you need to do to start adding features/improving Telekasten (or any other nvim plugin) is this (at least this is how I do it, I am not the most experienced software dev in the world, there are probably simpler/easier/cleaner ways to proceed):
-- With packer, it is simply
use '~/projects/personal/hover.nvim'
Regarding the more practical aspect, to expose something to the user (i.e. make it modifiable through the config):
As you are looking to start with a very basic stuff, you could move the current code for Thank you very much for wanting to get involved and good luck. We can chat here if you need a bit more help. |
Beta Was this translation helpful? Give feedback.
-
Hello, the basic idea, as @lambtho12 stated, would be to „refactor“ the telekasten plugin in terms of custom templates, to have such settings in one folder.
My first goal is to modify the „long date“ variable,
hdate
, in order to show German names for day of the week and months.hdate
is defined byThese definitions of
daymap
andmonthmap
are what I am searching for:And I changed them to
And how would the month days be calculated, as they are different for each month?
I would also like to define a variable to be used for the new months template, I have found these for week,
So, could I simply add variables for the month?
Also, here just a month variable could be added easily, are there any methods for quarter date calculations too?
I would also like to know how I could modify other basic variable naming conventions, e.g. for images:
So my most basic question I have in terms of customizing I have for the start:
How would it be possible to modify a locally defined variable like
local pngname
, orlocal daymap
in one's configuration lua file`?If I just insert such modified lines, e.g.
, this did not work for me. How does it work?
My apologies for bad lua knowledge. The ideas in (1. #90 (comment) , 2. #94 , 3. #99 were very nice!
@lambtho12
What would be an easy way to create templates and snippets
like that
? I would really like to know how to contribute / where to start for knowing how to, or where to look for as a beginner …I hope these questions are not too far fetched!
Kind regards :)
Beta Was this translation helpful? Give feedback.
All reactions