From ed7bbe9a9bfa703533e812e4f5d1e56a489d73af Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Sat, 27 Sep 2025 18:03:36 +0900 Subject: updated nvim configurations and created snippet for journal --- .../TheSiahxyz/lua/TheSiahxyz/plugins/lsp.lua | 15 ++-- .../TheSiahxyz/lua/TheSiahxyz/snippets/journal.lua | 85 ++++++++++++++++++++++ 2 files changed, 94 insertions(+), 6 deletions(-) create mode 100644 mac/.config/TheSiahxyz/lua/TheSiahxyz/snippets/journal.lua (limited to 'mac/.config/TheSiahxyz/lua') diff --git a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/lsp.lua b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/lsp.lua index da49976..4520597 100644 --- a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/lsp.lua +++ b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/lsp.lua @@ -230,7 +230,10 @@ return { lint.linters_by_ft = { dockerfile = { "hadolint" }, javascript = { "eslint_d" }, + typescript = { "eslint_d" }, javascriptreact = { "eslint_d" }, + typescriptreact = { "eslint_d" }, + svelte = { "eslint_d" }, python = { "pylint" }, sh = { "shellcheck" }, sql = { "sqlfluff" }, @@ -333,12 +336,12 @@ return { require("conform").setup({ formatters_by_ft = { bash = { "shfmt" }, - css = { "prettier" }, + -- css = { "prettier" }, graphql = { "prettier" }, html = { "prettier" }, - javascript = { "prettier" }, - javascriptreact = { "prettier" }, - json = { "prettier" }, + -- javascript = { "prettier" }, + -- javascriptreact = { "prettier" }, + -- json = { "prettier" }, liquid = { "prettier" }, lua = { "stylua" }, markdown = { "prettier" }, @@ -346,8 +349,8 @@ return { sh = { "shfmt" }, sql = { "sql-formatter" }, svelte = { "prettier" }, - typescript = { "prettier" }, - typescriptreact = { "prettier" }, + -- typescript = { "prettier" }, + -- typescriptreact = { "prettier" }, vimwiki = { "prettier" }, yaml = { "prettier" }, zsh = { "beautysh" }, diff --git a/mac/.config/TheSiahxyz/lua/TheSiahxyz/snippets/journal.lua b/mac/.config/TheSiahxyz/lua/TheSiahxyz/snippets/journal.lua new file mode 100644 index 0000000..e966924 --- /dev/null +++ b/mac/.config/TheSiahxyz/lua/TheSiahxyz/snippets/journal.lua @@ -0,0 +1,85 @@ +local ls = require("luasnip") + +local s = ls.snippet +local i = ls.insert_node +local t = ls.text_node +local c = ls.choice_node +local f = ls.function_node + +local fmt = require("luasnip.extras.fmt").fmta + +-- get weather from wttr.in +local function get_weather() + local q = os.getenv("JOURNAL_WEATHER_QUERY") + local url = q and ("wttr.in/" .. q .. "?format=1") or "wttr.in/?format=1" + local handle = io.popen(("curl -m 2 -s '%s'"):format(url)) + if not handle then + return "" + end + local result = handle:read("*a") or "" + handle:close() + return (result:gsub("[\r\n]", "")) +end + +local journal_snippet = s( + "journal", + fmt( + [[--- +title: