At a certain point in time we want to lock a CMI period to a forecasted amount.
- A lock already exists
- We lock in the same CMI
- We lock in a different CMI
| -- Automatically enter insert mode when entering a terminal buffer window | |
| vim.api.nvim_create_autocmd({ "BufEnter", "WinEnter" }, { | |
| pattern = "term://*", | |
| callback = function() | |
| vim.cmd("startinsert") | |
| end, | |
| desc = "Enter insert mode when entering terminal buffer window", | |
| }) | |
| -- Set up terminal-specific keymaps for window navigation in terminal mode |
| -- Shared function to create GitHub gists | |
| local function create_gist(opts, is_public) | |
| local lines | |
| local filetype = vim.bo.filetype | |
| -- Check if command was called with a range (visual selection) | |
| if opts.range > 0 then | |
| -- Get visual selection | |
| lines = vim.fn.getline(opts.line1, opts.line2) | |
| else |
| -- Create a Neovim command to run the function | |
| vim.api.nvim_create_user_command("RunBigQuery", function(opts) | |
| run_bigquery(opts.args ~= "" and opts.args or nil) | |
| end, { nargs = "?" }) |
| -- Shared function to create GitHub gists | |
| local function create_gist(opts, is_public) | |
| local lines | |
| local filetype = vim.bo.filetype | |
| -- Check if command was called with a range (visual selection) | |
| if opts.range > 0 then | |
| -- Get visual selection | |
| lines = vim.fn.getline(opts.line1, opts.line2) | |
| else |
| -- Shared function to create GitHub gists | |
| local function create_gist(opts, is_public) | |
| local lines | |
| local filetype = vim.bo.filetype | |
| -- Check if command was called with a range (visual selection) | |
| if opts.range > 0 then | |
| -- Get visual selection | |
| lines = vim.fn.getline(opts.line1, opts.line2) | |
| else |
| -- Written with Claude | |
| -- dbt ref() jump to definition | |
| local function extract_ref_model_name() | |
| local line = vim.api.nvim_get_current_line() | |
| local ref_pattern = "ref%(%s*['\"]([^'\"]+)['\"]%s*%)" | |
| return line:match(ref_pattern) | |
| end | |
| local function find_model_files(model_name) |
| require "js" | |
| # access to the html document, so we can add visual elements like buttons | |
| document = JS.global[:document] | |
| # jq is a library which provides easer to read function to add elements | |
| jq = JS.global['$'] | |
| # write the initial html, we give every element an ID so we can address them later | |
| jq.apply("#main").html( | |
| <<HTML |
| # https://github.com/ryanoasis/nerd-fonts/wiki/Glyph-Sets-and-Code-Points | |
| symbol_map U+E5FA-U+E62B Symbols Nerd Font Mono | |
| # Devicons | |
| symbol_map U+e700-U+e7c5 Symbols Nerd Font Mono | |
| # Font Awesome | |
| symbol_map U+f000-U+f2e0 Symbols Nerd Font Mono | |
| # Font Awesome Extension | |
| symbol_map U+e200-U+e2a9 Symbols Nerd Font Mono | |
| # Material Design Icons | |
| symbol_map U+f0001-U+f1af0 Symbols Nerd Font Mono |