Useful snippets

    Autohotkey & replacements

    Mon 28. April 2025 | 2025-04-28

    Windows

    Shift F1 to open http://localhost:5173/

    script.ahk

    +F1::Run "http://localhost:5173/"
    

    pn1 to print 29090816894 (macro)

    script.ahk

    :*:pn1::29090816894 
    

    keyboard shortcut to print characters

    backtick (`) and tilde (~)

    script.ahk

    !1::SendText "``"
    !2::Send "~ "
    

    Mac

    Shift F1 to open http://localhost:5173/

    Shortcuts app

    1. New shortcut
    2. Open URL
    3. Details > Run with: (type Shift F1)

    Shortcut app may be closed

    Shortcut app

    pn1 to print 11113306361

    https://altitudemarketing.com/blog/text-macros-macos/

    Settings app

    keyboard shortcut to print characters

    backtick (`) and tilde (~)

    .config/skhd/skhdrc

    lalt - 1: skhd -t "\`"
    lalt - 2: skhd -t "~"
    

    Ctrl Shift d to print 11113306361

    Follow same approach as printing current date: https://useful-snippets.netlify.app/posts/print-current-date/

    SKHD links

    MSYS2

    Mon 07. April 2025 | 2025-04-07

    msys2.org

    • Node: pacman -S mingw-w64-x86_64-nodejs: https://packages.msys2.org/packages/mingw-w64-x86_64-nodejs

    Use MINGW64 app?

    wezterm pros&cons

    Wed 02. April 2025 | 2025-04-02

    pros

    • enkel å confige, forståelige docs

    cons

    • kan ikke defaulte shell til bash?
    • ctrl c stopper prosess selv i "visual" markering mode. WSL gjorde ikke det
    • treg på windows drive... fordi den fortsatt buker wsl-ubuntu bash?

    Vim multiple cursors / gn

    Mon 17. March 2025 | 2025-03-17

    multi cursor addons


    Vim gn

    cgn: enter change mode for next occurence

    1. / search for word
    2. cgn change word
    3. . repeat for next word

    Search navigate stuff

    Regex & capture groups

    Thu 16. January 2025 | 2025-01-16

    Match ett ord

    • [^\s]+
    • [a-z]+
    • \w+??

    Search replace capture group

    for å replace

    - export default Component;
    + export { Component }
    

    Kan man kjøre

    Search export default (\w+)

    Replace export { $1 }

    Se pål-notater for mer...

    Newline i search replace

    search replace kan legge til newline med \n