Showing posts with label VimScript. Show all posts
Showing posts with label VimScript. Show all posts

20251116

VimHaradaMethod - gimme a grid

Took a while to get this VibeCoded and still the center swap toggle did not work. Was going for the old iMandalArt iOS functionality but sadly it is lost in the Japanese internets.

Usage

at buffer, :HaradaMethod to get the grid
\z toggles zoom of that focused pane
Move with the usual C-W hjkl movements or splits 1-9 starting from top left  <split number> C-W w
gf works as usual 

Script

" ------------------------------------------------------------------------------

" 1. CONFIGURATION

" ------------------------------------------------------------------------------

set hidden 


" ------------------------------------------------------------------------------

" 2. The Core Grid Logic

" ------------------------------------------------------------------------------

function! s:CreateHaradaMethodGrid()

    botright split | botright split   

    wincmd t | rightbelow vsplit | rightbelow vsplit

    wincmd j | rightbelow vsplit | rightbelow vsplit

    wincmd j | rightbelow vsplit | rightbelow vsplit

    wincmd =

    windo setlocal nocursorline nocursorcolumn

    5wincmd w

    setlocal cursorline cursorcolumn

    let t:zoomed = 0

endfunction

 ------------------------------------------------------------------------------

" 3. Zoom Logic 

" ------------------------------------------------------------------------------

function! s:ToggleZoom()

    if exists("t:zoomed") && t:zoomed

        wincmd =

        let t:zoomed = 0

        redraw

        echo "Zoom: Off"

    else

        wincmd _ | wincmd |

        let t:zoomed = 1

        redraw

        echo "Zoom: On"

    endif

endfunction


" ------------------------------------------------------------------------------

" 4. Mappings

" ------------------------------------------------------------------------------

command! HaradaMethod call s:CreateHaradaMethodGrid()


" The Toggle Switch

nnoremap <Leader>z :call <SID>ToggleZoom()<CR>

nnoremap gf :e <cfile><CR>


" ------------------------------------------------------------------------------

" 5. Direct Pane Navigation (1-9)

" ------------------------------------------------------------------------------

" just use <number> C-W w as in goto center pane with 5C-W w or C-W hjkl


20221226

Bundle that ToolForThoughts

2022-12-27T13:51:29-XXXX Tue HackerNewsComments  Great article and highlights the cyclical hype of PKMS. I use FountainPens and Paper. RandyPausch was/is a TimeManagement guru and inspires. https://www.cs.cmu.edu/~pausch/ KeepItSimple.  PaidFor SubscribedTo literally every MajorPkms DigitalGarden Wiki MindMap GewGaw aka ToolsForThought out there. But thoughts are cheap along with storage (SdCard) and backup (RsyncBackupScript) There is simply no reason not to enjoy ExternalizeThinking with DigitalTools (and have it centralized) Now for the last 9 years feel like I am making my own language and talking to itself.

Literally my Year2022Review sans redaction of personal nodes and most of B-Z [1]: 

010Editor 2022-09-21 2022-12-23 2022-12-24 2022-12-25 21stCenturyHomeHealth 432Hz ABBA ANeuroscientistReflectsOnDeath AboutObsidian AcceptingOldAge Activism Add2Dict AdviceFromSmartPeople AirmeshVsAlphaDirect AjahnSumedho AlbertoMarino AllYouNeedIsLinks AlsiaCrochetSweater AmadeusMozart AmazonOrder AmazonOrders AmericanAirlines Amphora AnInkGuy AndeanTextileArts AndreasScholl Anki AnsiOsc52 Anthropic AntinetZettelkasten AntonioMachado AníbalTroilo AppImage Appelboom AppendOutputToFile AptCacheSearch AptList ArchLinux ArtOfLisp ArtOfPlainText ArtOfTheCommandLine AsahiLinux AsciiArtCodeDiagrams AssamTea AsusC523NLog AttentionToDetail AutoHotKey Awk AwkAndCsv BackupScripts BackupWithRsyncNet BagdadCafe BashAliases BashExportVariables BashHistory BashPatternMatching BashRc BashRcAlternativeBashHistoryLogging BashRcHistoryLogging BashScriptingTemplate BatCat BayesRules BayesianProbabilityWorksheet BearMeetings  ... Be\+

WuWei is the way.

Live in the terminal both in DayJob and Personal; UseVim; no FileExtensions; CamelCase = thought = node; ISO8601 DateTimeStamp every node; Mimimal DataStructure or VimOutliner prn; F*ck Markup MarkDown, PlainText is LazyGenius; FrictionlessSystem, ZeroMaintenance

Capture in GuiBrowser

CaptureBookmark DataUrl

javascript:(function(){let text=""; if(window.getSelection()!=''){text=window.getSelection().toString()+"\n";}prompt("Press Ctrl+C, Escape", text+"\n"+document.title+" "+location.href);})()

[1] Year2022Review Method in local ./.exrc in 128G sd card

Have cursor on 2022 then ,b in NormalMode

where nmap ,b :r !. ./backlinks.sh <C-R><C-W><CR>

and ./backlinks.sh is 

#!/usr/bin/sh

term=$1

for file in $term

do

echo $file

rg -l -i $file -g '!*.*' | sed 's/^/\t/g'

done