Skip to content

Instantly share code, notes, and snippets.

@girishji
girishji / vim9cmdline.md
Last active June 6, 2024 09:14
Vim Tip: Vim9script in Command Line

Note: This gist is now part of VimBits plugin.

As a Vim user, you might prefer the new vim9script over the legacy script, and wish to use it in the command line. While there's no direct option to switch the command line to parse vim9script, you can execute vim9script commands by simply prepending each command with vim9.

However, remember that execution occurs in the global context, not the script-local context. This means you need to declare variables with the g: prefix, like g:foo = 'bar'.

Common commands such as visual mode select ('<,'>), shell commands (!), substitution (s//), and global (g//) work as expected, even with vim9 prepended.

@kennypete
kennypete / _gvim-kennypete-toolbar.adoc
Last active February 12, 2024 18:06
Customising a gvim toolbar

My gvim toolbar

@apirogov
apirogov / rsync-prepare
Created September 7, 2022 18:08
Script to fix moved/renamed files before running rsync to avoid useless retransmissions
#!/usr/bin/env python3
"""
Fix moved/renamed files before running rsync to avoid useless retransmissions.
Copyright (C) 2022 Anton Pirogov, licensed under the MIT License
"""
from itertools import chain
from typing import List, Dict, Optional
from dataclasses import dataclass
from pathlib import Path
@PJB3005
PJB3005 / linux_sucks.md
Last active May 30, 2024 06:37
Summary of all problems I have with the Linux Desktop

Linux Desktop Issues

This is basically my manifesto of why Linux sucks and I keep using Windows as a desktop OS. This is both as a developer platform and end-user targeting.

Look: I would love to be able to use Linux as a daily driver. KDE is amazing and they clearly put far more effort into the desktop experience/UI than Windows (just the volume mixer alone). There are simply far too many underlying and infrastructural problems to the Linux desktop that none of KDE's great UI changes can make up for. I want Linux fanboys, developers, etc... to stop sticking their damn head in the sand about these issues and admit that Linux is still decades behind in some basic infrastructure. This shit can't get fixed if people refuse to admit it's broken in the first place, which some people are far too happy to do.

Desktop App Experience & Developer Tools

Windows has far better desktop apps than Linux, and thanks to WSL, I have all the CLI apps of Linux too. While I do believe KDE Plasma is a much better desk

@mklement0
mklement0 / Show-Help.ps1
Last active May 8, 2024 01:02
Wrapper PowerShell function for Get-Help that shows help topics online by default and supports copying URLs of / Markdown links to the online help topics to the clipboard
<#
Prerequisites: PowerShell v5.1 and above (verified; may also work in earlier versions)
License: MIT
Author: Michael Klement <mklement0@gmail.com>
DOWNLOAD and DEFINITION OF THE FUNCTION:
irm https://gist.github.com/mklement0/880624fd665073bb439dfff5d71da886/raw/Show-Help.ps1 | iex
@AndreSteenveld
AndreSteenveld / INSTALL.md
Created April 20, 2021 21:08
Installing pacman on git for windows

Why?

I recently made a fresh install of windows and all the tools I needed to develop software including git-for-windows. Unfortunatnly git-for-windows doesn't come with a packagemanager buildt in and going full cygwin seems a little overkill. After some research I ran in to this post on stackoverflow describing a way to install pacman in to git-for-windows. Unfortuntly only "most of it" worked in my case. This document attempts to describe the entire process I went through to install pacman.

Prepare

The packages in the MSYS2 repositoy seem to be packaged using zstd now and not xz as described. Obviously it would be great to use a package manager to install zstd and un-tar the files... Given that this guide is geared towards windows installs you can install 7zip and add the Modern7z plugins to unpack zstd files.

Downloading and unpacking the neccesary packages

@mahemoff
mahemoff / README.md
Last active April 6, 2024 00:38
Vim Terminal Mode - A short introduction

Vim has a Terminal Mode!

Since v8.1 (May 2018), Vim has shipped with a built-in terminal. See https://vimhelp.org/terminal.txt.html or type :help terminal for more info.

Why use this? Mainly because it saves you jumping to a separate terminal window. You can also use Vim commands to manipulate a shell session and easily transfer clipboard content between the terminal and files you're working on.

Key Bindings

@probonopd
probonopd / Wayland.md
Last active June 8, 2024 01:44
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.

Wayland proponents make it seem like Wayland is "the successor" of Xorg, when in fact it is not. It is merely an incompatible alternative, and not even one that has (nor wants to have) feature parity (missing features). And unlike X11 (the X Window System), Wayland protocol designers actively avoid the concept of "windows" (making up incompr

@GetoXs
GetoXs / HP TPC-P001K - Fn inversion.ahk
Created August 16, 2020 11:48
Workaround for keyboard HP TPC-P001K Fn lock problem
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#InstallKeybdHook
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; F1 key by default, Fn+F1 is now Mute/Unmute
VOLUME_MUTE::F1
F1::VOLUME_MUTE