Saturday, November 4, 2023

vim colemak keybinds on a qwerty board

a qwerty board marked up with the vim shortcuts for reference

sunset color pallate

saw this view from the bridge.
couldn’t wait to get home and figure out thise hexcodes.

immediately thought:
make a css template with it
vim/ textastic/ mweb colorschemes
want that terminal rice in i3

Friday, November 3, 2023

notes on vim tables

tables

vimwiki

just make pipes it auto aligns
pipe and 3 dashes will do horizontal lines

== VIMWIKITABLE CMDS ==

  • :VimwikiTableAddRowAbove
  • :VimwikiTableAddRowBelow
  • :VimwikiTableDeleteRow
  • :VimwikiTableAddColBefore
  • :VimwikiTableDeleteCol

== markdown-toc ==

  • ajorgensen/vim-markdown-toc
    :GenMarkdownTOC:
    :UpdateMarkdownTOC:

    • Align by a Delimiter:
      :Tabularize: /: Align lines based on a specified delimiter.
      For example, to align lines by equal signs, use :Tabularize /=.
      Align by Regular Expression:

:Tabularize: /<regular_expression>: Align lines based on a regular expression.
For example, to align lines by spaces or tabs, use :Tabularize /\s+.
Align by a Range:

:Tabularize: / : Align lines within a specified range.
For example, to align lines within a visual selection, use :'<,'>Tabularize /=.
Custom Alignment:

  • You can specify a custom alignment character or string. For example, :Tabularize: / / will align lines using spaces.
    Automatic Alignment with Operators:

  • In normal mode, select the lines you want to align.
    Then, use the :Tabularize: command to automatically align the selected lines based on the delimiter, regex, or alignment character you specify.
    Repeat the Last Tabularize Command:

:Tabularize (without any arguments) will repeat the last Tabularize command with the same arguments.
Visual Mode Alignment:

  • In visual mode, select the text you want to align.
    Then, press :, and Vim will automatically add '<,'> to the command for aligning the selected visual block.
    Custom Mappings:

You can create custom mappings in your .vimrc to quickly apply Tabularize to common delimiters or regex patterns. For example:

nnoremap a :Tabularize /,

  • This mapping allows you to align text by commas by typing a in normal mode.

== table mode ==

| name | price |
| phil | 3 |
| susan | 5 |
| janice | 8 |
| doreen | 39 |
| cordelia | 12 |
| --------------------+------- | |
| total | 67.0 |
%% tmf: $8,2=Sum(2:-1)
leader tt = csv to table
:Tableize

leader tm = :TableModeToggle

  • then you can pipe away
  • double pipe does horiz sep

== moving ==
bracket / curly brace + pipe

== editing ==

ci| = change in cell /
ca| = change around cell
leader tdd = delete row
leader tdc = delete column
leader tic = insert col

== formulas ==
leader tfa =:TableAddFormula
leader tfe = evaluate
leader t? also eval (no need it auto evaluates)

Sum(2:-1) that means col 2 and -1 = row above current line

Sum(2,2:-1) 2,2 is start at col 2 row 2
when you specify a pair of values eg 2,2 its specific to that row
when you just have 1 its the whole column.


:TableModeEnable:
Enables table mode for the current buffer.
:TableModeDisable: Disables table mode for the current buffer.
:TableModeRealign: Realigns the table columns.
:TableModeAutoFormat: Automatically formats the table by aligning columns.
:TableModeToggle: Toggles between enabling and disabling table mode.
:TableModeToggleInsertMode: Toggles between insert mode and normal mode for a table cell.
ta: Toggle table alignment (e.g., left-align, center-align, right-align).
tr: Toggle table row alignment.
tt: Toggle table text wrapping.
Table Navigation:

|: Move to the next cell in the table.
j and k (in Normal mode): Move between rows.
H and L (in Normal mode): Move to the first and last cells in the current row, respectively.
gh and gl (in Normal mode): Navigate between columns.
[[ and ]]: Jump to the previous and next table.
Text Objects:

iat: Select the entire table.
iab: Select the current cell.
a|: Select the current column.
ir: Select the current row.
Other Useful Shortcuts:

ti: Inserts a new row above the current row.
tI: Inserts a new row below the current row.
td: Deletes the current row.
tD: Deletes the current column.
tc: Change the contents of the current cell.

folds and diff

zf - manually define a fold up to motion
zd - delete fold under the cursor
za - toggle fold under the cursor
zo - open fold under the cursor
ze - close fold under the cursor
zr - reduce (open) all folds by one level
zm - fold more (close) all folds by one level
zi - toggle folding functionality


]c - jump to start of next change
[c - jump to start of previous change
do or :diffg[et] - obtain (get) difference (from other buffer)
ap or :diffpu[t] - put difference (to other buffer)
:diffthis - make current window part of diff
:dif[fupdate] - update differences
:diffo[ff] - switch off diff mode for current window


Tip The commands for folding (e.g. za ) operate on one level. To
operate on all levels, use uppercase letters (e.g. zA).

Tip To view the differences of files, one can directly start Vim in diff mode by running vimdiff in a terminal. One can even set this as git difftool

Thursday, November 2, 2023

awk simple 2 col csv sum

awk -F, 'BEGIN { OFS = ","; total = 0; } { if (NR == 1) { print $0; } else { total += $2; lines[NR] = $0; } } END { for (i = 2; i <= NR; i++) { print lines[i]; } print "total," total; }' yourfile.csv > temp.csv && mv temp.csv yourfile.csv

multi cursor editing in vim

ctrl v shift i ctrk v shift x enter visual block mode i to insert x to delete great for commenting out blocks of code

Wednesday, November 1, 2023

textastic theme

codepen themes for textastic

the best theme = "tommorow night eighties" w roboto mono font.

Friday, October 27, 2023

args and buffers

link to an article

faster vim workflow with buffers and args

Args

:args *
:n / :p
:wn
:arga = add
:argd= delete

buffers

:ls
:bn /bp

substitution

  • argdo
  • bufdo
    %s/method1/method2/g | update

autocomplete in vim no plugins needed

HTML

autocmd FileType html set omnifunc=htmlcomplete#CompleteTags

  • then ctrl X ctrl o on tag to show list
  • ctrl n/ ctrl p to move through the list

CSS

autocmd FileType css set omnifunc=csscomplete#CompleteCSS

Javascript

autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS

Filenames

  • ctrl x ctrl f
  • ctrl n/ ctrl p

Monday, October 23, 2023

vim html editing

When editing the contents of an HTML tag or changing the tag type in Vim, there are several useful shortcuts and techniques you can use:

  1. Inside Tag Editing:

    • To edit the contents within the current HTML tag, place your cursor inside the tag and press ci> (change inside >). This will change everything within the tag, but leave the tag itself intact.
  2. Changing the Tag Type:

    • To change the HTML tag itself, place your cursor on the tag you want to change, and use the following commands:
      • To change a <div> to a <span>, for example, you can use cit (change inside tag) and type <span>.
      • If you want to change a <div> to a <p>, you can use cit and type <p>.
      • To change a <span> to a <div>, you can use cit and type <div>.
  3. Tag Surroundings:

    • If you want to surround an element with a new tag, you can use the surround.vim plugin, which allows you to visually select text and then specify a new tag to surround it. For example, you can select a block of text, press S, and then type the new tag you want to wrap around it.
  4. HTML Commenting:

    • To comment out an HTML tag or a block of code, you can use the following shortcuts:
      • gcc to comment a single line.
      • :x,ys/old/new/g to replace old with new in lines x through y (e.g., :1,5s/<div>/<p>/g to replace <div> with <p> in lines 1 through 5).
  5. Changing Case:

    • To change the case of an HTML tag (e.g., from lowercase to uppercase), you can visually select the tag and use the ~ key to toggle the case.
  6. Auto-pairing Plugins:

    • Consider using Vim plugins like auto-pairs or surround.vim, which can assist in auto-closing and modifying HTML tags.

Saturday, October 21, 2023

budget friendly 60 % keyboards I saw that I liked at Canada Computers

Keyboard Price
AULA F3287 Wired TKL $29.99
Redragon K613 Jax $39.99
Redragon Kumara K552 $39.99
Redragon K616 black+red Bluetooth Wireless $49.99
Redragon Jax Pro (K613P) Bluetooth $59.99
Redragon K530 Pro-red switch 60% Wireless $64.99
60% budget keyboards I liked oct 2023

AULA F3287
k613 JAX
Kumara K552
K616 black + red
K613p JAX pro
K530 pro w red switches

Honorable mention

iCAN 87 Key Rainbow Backlit Gaming Keyboard, 1.5M Cable (Black)(Open Box)

17.99 open box

Thursday, October 19, 2023

squarebeat

ios tracker sequencer just released. it can load auv3 plugins!! its so wicked!!

a jungle demo track on youtube

doesnt have keyboard shortcuts but its been well optimized well for the small touch interface of a phone. easier than sunvox, you dont need to be a genius to use. Thats a big deal, most of the time trackers seem too complicated. its alot more like renoise reminds me a bit of lgpt. can load auv3 effects on seperate mix busses and import your own samples. its free to try but doesnt let you save or export the unlock iap is 17 bucks canadian

vim args

In Vim, "args" typically refer to the list of files you're working with, and Vim provides several shortcuts and commands to work with this argument list. Here are some common Vim shortcuts and commands for working with arguments:

  1. :args <file1> <file2> ... - Set the argument list to a specific list of files.

  2. :args *.txt - Set the argument list to all files matching a pattern (e.g., all .txt files in the current directory).

  3. :argadd <file> - Add a file to the argument list.

  4. :argdelete - Remove the current file from the argument list.

  5. :args - List all files in the current argument list.

  6. :argnext (or :an) - Go to the next file in the argument list.

  7. :argprev (or :ap) - Go to the previous file in the argument list.

  8. :argfirst - Go to the first file in the argument list.

  9. :arglast - Go to the last file in the argument list.

  10. :argdo <command> - Execute a command on all files in the argument list. For example, :argdo :%s/foo/bar/g would replace "foo" with "bar" in all files.

  11. :args $mylist - Set the argument list from a variable.

  12. :argopen - Open all files in the argument list in separate windows.

  13. :arglist - Display the argument list and the cursor position within each file.

Wednesday, October 18, 2023

AFP Share: open raspberri pi using mac finder

sudo apt install netatalk

sudo nano /etc/netatalk/afp.conf

** inside that file add to bottom **

[Homes]

  basedir regex = /home

sudo systemctl restart netatalk

how to set up a pip venv

sudo apt install python3-venv python3 -m venv myenv source myenv/bin/activate pip install package-name deactivate

urls

https://www.youtube.com/feeds/videos.xml?channel_id=UCked4Esmdl16F1CwHjiBe3w https://www.youtube.com/feeds/videos.xml?channel_id=%20UCuQRDVBQP6kL5kcgm8s8WQA https://www.youtube.com/feeds/videos.xml?channel_id=UC2Xd-TjJByJyK2w1zNwY0zQ https://www.youtube.com/feeds/videos.xml?channel_id=UCld68syR8Wi-GY_n4CaoJGA https://www.youtube.com/feeds/videos.xml?channel_id=UCngn7SVujlvskHRvRKc1cTw https://www.chch.com/feed/ https://www.youtube.com/feeds/videos.xml?channel_id=UCX6b17PVsYBQ0ip5gyeme-Q https://ecksesontress.blogspot.com/feeds/posts/default https://www.youtube.com/feeds/videos.xml?channel_id=UCbiGcwDWZjz05njNPrJU7jA https://www.youtube.com/feeds/videos.xml?channel_id=UCsBjURrPoezykLs9EqgamOA https://www.youtube.com/feeds/videos.xml?channel_id=UCNmTQerbBm8AFzXYYvs1ywQ https://news.itsfoss.com/latest/rss https://www.youtube.com/feeds/videos.xml?channel_id=UC2eYFnH61tmytImy1mTYvhA https://www.youtube.com/feeds/videos.xml?channel_id=UC7YOGHUfC1Tb6E4pudI9STA https://www.youtube.com/feeds/videos.xml?channel_id=UCKQdc0-Targ4nDIAUrlfKiA https://www.youtube.com/feeds/videos.xml?channel_id=UCYVU6rModlGxvJbszCclGGw https://www.youtube.com/feeds/videos.xml?channel_id=UC8ENHE5xdFSwx71u3fDH5Xw https://www.youtube.com/feeds/videos.xml?channel_id=UCUyeluBRhGPCW4rPe_UvBZQ https://www.youtube.com/feeds/videos.xml?channel_id=UCn8zNIfYAQNdrFRrr8oibKw https://www.youtube.com/feeds/videos.xml?playlist_id=PL-p5XmQHB_JSTaEPygu1DZjuFfb704Uv7 https://www.youtube.com/feeds/videos.xml?channel_id=UCFbNIlppjAuEX4znoulh0Cw https://www.cbc.ca/cmlink/rss-topstories "Canada" https://www.ctvnews.ca/rss/ctvnews-ca-top-stories-public-rss-1.822009 "Canada" https://business.financialpost.com/feed/ "Canada" https://www.lapresse.ca/actualites/rss "Canada" https://nationalpost.com/feed/ "Canada" https://ottawacitizen.com/feed/ "Canada" https://theprovince.com/feed/ "Canada" https://www.thestar.com/content/thestar/feed.RSSManagerServlet.articles.topstories.rss "Canada" https://torontosun.com/category/news/feed "Canada" https://globalnews.ca/feed/ "Canada" https://alistapart.com/main/feed/ "Web Development" https://www.codewall.co.uk/feed/ "Web Development" https://css-tricks.com/feed/ "Web Development" https://davidwalsh.name/feed "Web Development" https://hacks.mozilla.org/feed/ "Web Development" https://gosink.in/rss/ "Web Development" https://developers.google.com/web/updates/rss.xml "Web Development" https://www.youtube.com/feeds/videos.xml?channel_id=UCoOae5nYA7VqaXzerajD0lg https://www.youtube.com/feeds/videos.xml?channel_id=UCvFApMFo_AafXbHRyEJefjA https://www.youtube.com/feeds/videos.xml?channel_id=UCvmINlrza7JHB1zkIOuXEbw https://www.youtube.com/feeds/videos.xml?channel_id=UCIcCXe3iWo6lq-iWKV40Oug https://www.youtube.com/feeds/videos.xml?channel_id=UCZFPiLpzd4cKOsBS9CIu3xg https://www.youtube.com/feeds/videos.xml?channel_id=UCGSGPehp0RWfca-kENgBJ9Q https://www.youtube.com/feeds/videos.xml?channel_id=UC5ZoLwtjX_7Zs8LoqpiLztQ https://www.youtube.com/feeds/videos.xml?channel_id=UCgTNupxATBfWmfehv21ym-g https://www.youtube.com/feeds/videos.xml?channel_id=UCEMe4pwYxWc0O4o7CpDYqEg https://www.youtube.com/feeds/videos.xml?channel_id=UCq297H7Ca98HlB5mVFHGSsQ https://www.youtube.com/feeds/videos.xml?channel_id=UC7QE72cxiBkiwnvGoFfqYOg https://www.youtube.com/feeds/videos.xml?channel_id=UC4xKdmAXFh4ACyhpiQ_3qBw https://www.youtube.com/feeds/videos.xml?channel_id=UC39aOXMqg48qpzEz1l_-7tQ https://www.youtube.com/feeds/videos.xml?channel_id=UCeR0n8d3ShTn_yrMhpwyE1Q

Tuesday, October 17, 2023

alias

set -o vi alias sd='sudo shutdown -h now' alias yta='yt-dlp -x --audio-format mp3' alias ytv='yt-dlp -f mp4' alias vids='yt-dlp -f mp4 -a -i --batch-file=batch.txt' alias music='yt-dlp -x --audio-format mp3 -a -i --batch- file=batch.txt'

batch.txt

https://www.youtube.com/watch?v=Gs1VDYnS-Ac https://www.youtube.com/watch?v=vt33Hp-4RXg https://www.youtube.com/watch?v=jfyt5ueyWN8&pp=ygUFeXRmemY%3D https://www.youtube.com/watch?v=sC9JH-Sr_2Q&pp=ygULdzNtIHZzIGx5bng%3D https://www.youtube.com/watch?v=b8kxdiskGzI&pp=ygULdzNtIHZzIGx5bng%3D https://www.youtube.com/watch?v=6eyFXcyosu8&pp=ygUEdmlmbQ%3D%3D https://www.youtube.com/watch?v=47QYCa8AYG4&pp=ygUEdmlmbQ%3D%3D https://www.youtube.com/watch?v=qgxsduCO1pE&pp=ygUEdmlmbQ%3D%3D https://www.youtube.com/watch?v=_xxTcKJMnWQ&pp=ygUEdmlmbQ%3D%3D

amethyst window manager

shortcut action
ctrl alt shift t toggle amethyst
alt shift t toggle float for active window
ctrl alt shift z refresh amethyst
alt shift j/k cycle active window
alt shift h/l resize windows
ctrl alt shift j/k swap active windows
ctrl alt shift # throws active window to a space

Thursday, October 12, 2023

incrementing in vim

- Ctrl A/ Ctrl Z increments  a single number up and down
- ctrl v, g ctrl a/ ctrl z does all the numbers at once

** it doesnt work on old vim 7