Skip to content

Instantly share code, notes, and snippets.

View saiashirwad's full-sized avatar
🏠
Working from home

texoport saiashirwad

🏠
Working from home
View GitHub Profile
#!/usr/bin/env bun
import { access, mkdir, readdir, stat } from "node:fs/promises";
import { basename, dirname, extname, join, relative } from "node:path";
// ========================================
// Global Configuration
// Edit these values instead of passing command line args
// ========================================
const DEFAULT_CONFIG: SiteConfig = {
contentDir: './content',
-- Function to collect all diagnostic errors and copy them to clipboard
local function copy_errors_to_clipboard()
-- Get the current buffer number
local current_buf = vim.api.nvim_get_current_buf()
-- Get all diagnostics for the current buffer
local diagnostics = vim.diagnostic.get(current_buf)
-- Format each diagnostic into readable lines
local lines = {}

Let me try a completely different approach then. Let's bypass Conform and use Neovim's built-in functions to run a formatter directly on the TypeScript code:

vim.api.nvim_create_user_command('FormatTSMarkdown', function()
  -- Save cursor position
  local cursor_pos = vim.api.nvim_win_get_cursor(0)
  local bufnr = vim.api.nvim_get_current_buf()
  
  -- Find TypeScript code blocks
  local lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false)
Objective: To collaboratively build an extensive and deep understanding of a topic, project, problem, or any subject you wish to explore, starting with minimal initial information.
Your Role (LLM): Act as an Expert Inquisitor and Context Synthesizer. Your primary function is not to provide answers initially, but to ask insightful, targeted questions to systematically elicit all necessary information from me (the user). You are building a comprehensive knowledge base about the subject, piece by piece, driven by your questions.
Process: