Skip to content

Instantly share code, notes, and snippets.

View stringTrimmer's full-sized avatar

Nick Caniglia stringTrimmer

View GitHub Profile
@stefanwatt
stefanwatt / susbstitfution.lua
Last active August 8, 2024 05:03
neovim builtin substitution hack
local opts = { silent = true }
local cursor
--HACK: force redraw
local function redraw_cmdline()
vim.schedule(function()
vim.api.nvim_input("<space><BS>")
end)
end
local function get_substitute_parts(cmdline)
@bassamsdata
bassamsdata / _Notes.md
Last active August 28, 2024 23:45
MiniFiles Git integration

Below is a code for Minifiles Git integration code snippet.

How to use it

Just insert the code below into this function in your Minifiles config:

config = function()
-- add the git code here
end
@romainl
romainl / grep.md
Last active August 29, 2024 17:35
Instant grep + quickfix

FOREWORDS

I don't mean the snippet at the bottom of this gist to be a generic plug-n-play solution to your search needs. It is very likely to not work for you or even break things, and it certainly is not as extensively tested and genericised as your regular third-party plugin.

My goal, here and in most of my posts, is to show how Vim's features can be leveraged to build your own high-level, low-maintenance, workflows without systematically jumping on the plugins bandwagon or twisting Vim's arm.


Instant grep + quickfix

@jamesfreeman959
jamesfreeman959 / keepawake.ps1
Last active September 16, 2024 10:49
A very simple PowerShell script to keep a Windows PC awake and make lync think the user is active on the keyboard
# Useful references:
#
# https://superuser.com/questions/992511/emulate-a-keyboard-button-via-the-command-line
# https://ss64.com/vb/sendkeys.html
# https://social.technet.microsoft.com/Forums/windowsserver/en-US/96b339e2-e9da-4802-a66d-be619aeb21ac/execute-function-one-time-in-every-10-mins-in-windows-powershell?forum=winserverpowershell
# https://learn-powershell.net/2013/02/08/powershell-and-events-object-events/
#
# Future enhancements - use events rather than an infinite loop
$wsh = New-Object -ComObject WScript.Shell
while (1) {