Skip to content

Instantly share code, notes, and snippets.

View jsr-p's full-sized avatar
🎯
Focusing

jsr-p

🎯
Focusing
View GitHub Profile
@jsr-p
jsr-p / before.lua
Last active February 17, 2023 18:15
lua function akin to https://github.com/onsails/lspkind.nvim/pull/30 but for Ultisnips
local cmp = require('cmp')
local lspkind = require('lspkind')
--- Function to preview snippet before completion with nvim-cmp
---@param entry cmp.Entry
---@param vim_item vim.CompletedItem
---@return vim.CompletedItem
function CmpBefore(entry, vim_item)
if entry.completion_item.snippet then
local snippet_value = entry.completion_item.snippet.value
@jsr-p
jsr-p / ghcp
Created June 21, 2024 11:17
Script to get link to github for current file (with optional line number) and either copied to clipboard or printed to stdout
#!/bin/bash
usage() {
echo "Usage: ghcp [--stdout] <file_path> [line_number]"
exit 1
}
# Initialize variables
STDOUT=false