Commit Graph

74 Commits

Author SHA1 Message Date
Marty Oehme 0e77624689
BREAKING: Unify lua and plug API mappings
ci/woodpecker/push/woodpecker Pipeline was successful Details
Made the names of the functions to invoke the plugin the same.
This is a BREAKING change if using the lua mappings.

On the other hand, it should stay pretty stable for the foreseeable
future, with only new ones added and possibly vim commands added.
2022-01-21 18:37:35 +01:00
Marty Oehme 49f0b10fde
Update README.md
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-01-21 18:32:51 +01:00
Marty Oehme f1059c6581
Add integration pipeline
ci/woodpecker/push/woodpecker Pipeline was successful Details
Added woodpecker pipeline for linting and unit testing.
2022-01-21 17:59:05 +01:00
Marty Oehme 6b65c5085f
Fix small test errors 2022-01-21 17:15:32 +01:00
Marty Oehme c9e490e042
Escape file name for file to edit
Use `fnameescape` before trying to edit a file when you open it through
a link.
2022-01-21 17:13:44 +01:00
Marty Oehme bd2481d41e
Rename index opening function
Renamed function to fit in line with other exposed lua API, putting
object before action, i.e. zettel_index_open instead of open_index.
2021-10-20 16:38:58 +02:00
Marty Oehme fc54052d2c
Update README
Improve descriptions for accesible API and reword some examples.
2021-10-20 16:38:10 +02:00
Marty Oehme 46df48be3f
Update README
Updated some examples, wordings and ideas.
2021-07-26 22:30:11 +02:00
Marty Oehme aad77cff07
Add function to open root index file
Call up `require 'zettelkasten'.open_index()` to open the file.
Pass along a file name `require 'zettelkasten'.open_index('home')` to
open said file at the zettel root instead.
2021-07-26 22:30:11 +02:00
Marty Oehme 98eeaf6fc7
Update README
Add some simple usage instructions.
2021-05-20 15:06:57 +02:00
Marty Oehme 0cf4516048
Remove debug.vim from repository 2021-05-20 14:20:41 +02:00
Marty Oehme 20d8edb800
Update README 2021-05-20 14:13:09 +02:00
Marty Oehme 892c1c9edb
Move tests to test directory 2021-05-04 20:42:26 +02:00
Marty Oehme a3b03461ab
Remove autoload
Directory or loading functions not required.
2021-05-04 20:39:58 +02:00
Marty Oehme eaa7b589d2
Add anchor duplicate checking before creation 2021-05-04 20:23:07 +02:00
Marty Oehme 5345b6c345
Add tests to text module 2021-05-04 17:13:48 +02:00
Marty Oehme a4aa3f825b
Add get_line api wrapper method
Should enable somewhat easier testing and reasoning
about my code.
2021-05-04 14:50:56 +02:00
Marty Oehme f67c22bfa7
Move debug plugin setup to separate debug.vim file
Begin to prepare using the plugin by moving debug stuff away from the
normal mode of operation.
2021-05-04 14:08:05 +02:00
Marty Oehme 477ec45d22
Add follow link command to go to or create link
Automatically chooses whether to create a new link or go to an existing
file, depending on the existence of a link in the current context (i.e.
under the cursor or in selection).
2021-05-04 14:06:59 +02:00
Marty Oehme 1a58909e94
Rename create_link to make_link
Should prepare the differentiation between a 'new' link and linking an
existing zetttel -- one is 'new_link' and one just 'makes_link' to
something else.
2021-05-04 09:46:18 +02:00
Marty Oehme 2ff3a0b299
Move functions working on buffer text to own module 2021-05-03 23:21:58 +02:00
Marty Oehme 4e3d364d17
Add word under cursor and (manual) mode selection 2021-05-03 23:02:59 +02:00
Marty Oehme 2310f4a2d0
Implement initial selection link creation 2021-05-03 17:31:28 +02:00
Marty Oehme 7c6882ac16
Rename imports and local vars to unify more 2021-05-03 17:29:42 +02:00
Marty Oehme 3f3e5ec7c2
Remove bignumber allocation, refactor open function
Switched out manual BIGNUMBER creation for the lua inbuilt `math.huge`.
Refactored `open_selected` a tiny bit in preparation for automatic link
creation.
2021-04-30 17:32:03 +02:00
Marty Oehme f615dd0fbd
Update readme 2021-04-30 16:46:03 +02:00
Marty Oehme 3eccd67b21
Fix option precedence buffer over global 2021-04-30 16:45:48 +02:00
Marty Oehme fdcb0f2a93
Add opening zettel by reference if no anchor found
Opens zettel by linked value, most often a direct path link, but will
also look through the root dir to find a(n exactly) matching basename to
open.

If nothing is found in the root dir will open a new file to write with
the corresponding name. Careful, if the reference is a full path
definition, and the file does not exist, it will still open the
corresponding file at the correct location but when attempting to save
will generally complain if parts of the path are missing. They have to
be created manually or in some other place, this is outside the scope of
this plugin.
2021-04-30 16:30:52 +02:00
Marty Oehme 43673aaf35
Change zettel anchor getting function definition
Unify the definitions of the two function to take a set of files instead
of different arguments. The list of files has the form:
files = { "full/path/name.md" = "name.md" }

I.e. the complete path is the key and the file basename the value,
leading to a set of files, even if basenames are the same.

Usually it will be created by the get_all_files function of the same
module, but it can be passed in manually as well (e.g. to avoid
duplicate filesystem lookups, etc).
2021-04-30 16:19:07 +02:00
Marty Oehme 4aa9d98818
Add Zettel ref getting defaulting to root dir 2021-04-30 16:10:35 +02:00
Marty Oehme e2a97570e0
Add zettel opening by base name matching 2021-04-30 16:02:13 +02:00
Marty Oehme 325be3c500
Split zettel getting into by anchor and by ref
Prepare for creating a lookup of zettels through the root directory by
file name as well as zettel id.
2021-04-30 15:52:54 +02:00
Marty Oehme 9dcd2556ba
Rename list module to files module
Renamed to 'files.lua' since it is the only module actively working on
the underlying filesystem so far -- gathering existing files and zettel
in the directories.
2021-04-30 15:30:43 +02:00
Marty Oehme e31630a8c4
Fix function formatting getting zettel from dir 2021-04-30 15:26:32 +02:00
Marty Oehme 5228a3b49e
Refactor file listing and zettel picking 2021-04-30 15:09:07 +02:00
Marty Oehme 94ff554d8d
Update readme and debug mappings 2021-04-30 13:28:39 +02:00
Marty Oehme e4e6fca765
Fix unused variables and useless pending test 2021-04-30 13:28:00 +02:00
Marty Oehme 5a0a258658
Fix local variable overwrites 2021-04-30 13:26:40 +02:00
Marty Oehme 9a58deafb6
Fix tmux session nvim command 2020-11-11 22:30:07 +01:00
Marty Oehme 93a1dfbae4
Add zettel opening by anchor 2020-11-06 17:28:05 +01:00
Marty Oehme 382b0bef72
Add anchor extraction to link string extraction 2020-11-06 16:52:57 +01:00
Marty Oehme 30e0519a1f
Refactor action open_selected function 2020-11-06 16:44:55 +01:00
Marty Oehme 162057f149
Add configurable zettel root directory
Plugin will by default recursively look in this directory for any
zettel.
2020-11-06 16:44:55 +01:00
Marty Oehme 20a1eef2e4
Remove undocument and unused options parameter 2020-11-06 16:12:00 +01:00
Marty Oehme 101a15c8c9
Refactor link options into their own category 2020-11-06 16:01:51 +01:00
Marty Oehme 44a985cce6
Add anchor extraction function
`anchor.extract(string, anchor)` will find and extract a zettel anchor
from any string passed in.

It can be given an optional anchor regex which will supersede any regex
set in the plugin options.
2020-11-06 15:53:01 +01:00
Marty Oehme 65e3b0bc1c
Add anchor regex ceontent as changeable option 2020-11-06 15:46:33 +01:00
Marty Oehme d29d92cc0a
Remove hardcoded options, do repo house-cleaning
Update readme and tmux.session file.

Remove unused tests, update option calling.
2020-11-04 22:27:30 +01:00
Marty Oehme e95bcf53b4
Refactor link creation into parser style_func 2020-11-04 22:16:21 +01:00
Marty Oehme 2a3e213ac8
Move link extraction to link module
Both link creation and extraction, all derived from parser
functionality, should run within the link module and actions should only
make use of it to invoke editor functionality.
2020-11-04 22:04:31 +01:00