diff --git a/Cargo.lock b/Cargo.lock
index 74fc34f9..cdf920ae 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -433,6 +433,17 @@ dependencies = [
"slab",
]
+[[package]]
+name = "fuzzydate"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7265f35cc1f40c655aad829323a1daef5f21fd38904f6ed9bd5ec3df3cbd851c"
+dependencies = [
+ "chrono",
+ "lazy_static",
+ "thiserror",
+]
+
[[package]]
name = "generic-array"
version = "0.14.7"
@@ -630,6 +641,7 @@ dependencies = [
"anyhow",
"chrono",
"config",
+ "fuzzydate",
"indexmap",
"itertools",
"nanoid",
diff --git a/Cargo.toml b/Cargo.toml
index 0f8dfe0d..70851c5c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,6 +9,7 @@ edition = "2021"
anyhow = "1.0.80"
chrono = "0.4.35"
config = "0.14.0"
+fuzzydate = "0.2.2"
indexmap = "2.2.6"
itertools = "0.10.5"
nanoid = "0.4.0"
diff --git a/README.md b/README.md
index 603f41f8..aaa756ea 100644
--- a/README.md
+++ b/README.md
@@ -99,6 +99,30 @@ Markdown Oxide's features are implemented in the form of a language server aimin
+ -
+ (optional) Enable opening daily notes with natural langauge
+
+ Modify your lsp `on_attach` function to support opening daily notes with, for example, `:Daily two days ago` or `:Daily next monday`. The specification can be found [here](https://docs.rs/fuzzydate/latest/fuzzydate/)
+
+ ```lua
+ -- setup Markdown Oxide daily note commands
+ if client.name == "markdown_oxide" then
+
+ vim.api.nvim_create_user_command(
+ "Daily",
+ function(args)
+ local input = args.args
+
+ vim.lsp.buf.execute_command({command="jump", arguments={input}})
+
+ end,
+ {desc = 'Open daily note', nargs = "*"}
+ )
+ end
+ ```
+
+
+
### VSCode
diff --git a/src/commands.rs b/src/commands.rs
new file mode 100644
index 00000000..8172b63d
--- /dev/null
+++ b/src/commands.rs
@@ -0,0 +1,88 @@
+use std::fs::File;
+use std::path::Path;
+
+use crate::config::Settings;
+use chrono::offset::Local;
+use chrono::NaiveDateTime;
+use fuzzydate::parse;
+use serde_json::Value;
+use tower_lsp::jsonrpc::{Error, Result};
+use tower_lsp::lsp_types::{MessageType, ShowDocumentParams, Url};
+
+fn datetime_to_file(datetime: NaiveDateTime, dailynote_format: &str, root_dir: &Path) -> Option {
+ let filename = datetime.format(dailynote_format).to_string();
+ let path = root_dir.join(&filename);
+
+ println!("path: {:?}", path);
+
+ Url::from_file_path(path.with_extension("md")).ok()
+}
+
+pub async fn jump(
+ client: &tower_lsp::Client,
+ root_dir: &Path,
+ settings: &Settings,
+ jump_to: Option<&str>,
+) -> Result