This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- this file is only necessary because lune currently does not cache modules properly | |
-- see: https://github.com/lune-org/lune/issues/138 | |
if _G._modulestate == nil then | |
_G._modulestate = {} | |
end | |
local modulestate = {} | |
-- if the state has not been initialized yet, we will use init to set values | |
function modulestate.get_state(s: string, init: { [any]: any }?): { [any]: any } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- reads .luaurc in dir if it exists and returns a table that can be passed to luau-lsp.nvim | |
-- requires plenary: https://github.com/nvim-lua/plenary.nvim | |
function read_luaurc_aliases(dir) | |
local p = require("plenary.path") | |
local luaurc_path = p:new(dir, ".luaurc") | |
if not luaurc_path:exists() then | |
return nil | |
end | |
local luaurc_data = luaurc_path:read() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(coerce_unsized, unsize)] | |
use std::cell::{Ref, RefCell, RefMut}; | |
use std::marker::Unsize; | |
use std::ops::CoerceUnsized; | |
use std::rc::{Rc, Weak}; | |
// immutable garbage-collected pointer | |
#[derive(Debug, Default)] | |
pub struct Gc<T: ?Sized> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- add 2 commands: | |
-- CodeCompanionSave [space delimited args] | |
-- CodeCompanionLoad | |
-- Save will save current chat in a md file named 'space-delimited-args.md' | |
-- Load will use a telescope filepicker to open a previously saved chat | |
-- create a folder to store our chats | |
local Path = require("plenary.path") | |
local data_path = vim.fn.stdpath("data") | |
local save_folder = Path:new(data_path, "cc_saves") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- some place where you define user commands | |
---@type uv_tcp_t? | |
local notify_server = nil | |
vim.api.nvim_create_user_command("StartNotifyServer", function() | |
if notify_server and not notify_server:is_closing() then | |
return | |
end | |
local try_notify_server, err = require("notify_server").start_server() | |
if err then |