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 

Tuesday, September 26, 2023

sunvox color theme

R G B
255 255 255
29 30 22
80 80 32
241 231 236

basic mac shortcuts in csv format

Shortcut Action
ctrl-cmd-f FULLSCREEN
ctrl-cmd-s Opera:toggle sidebar (for RSS viewer)
ctrl-tab next/prev opera tab
cmd-down go into folder(or open program)
cmd-up go to parent director
cmd-right/left go in folder/out folder
cmd-shift o Documents
cmd-shift d Desktop
cmd-shift d Hide/show dock
cmd-opt l Downloads
cmd-shift a Applications
cmd-shift g Go to folder
cmd-shift u Utilities
cmd-shift k Networks
cmd-shift c Computers
cmd-shift i Icloud
cmd-tab switch program focus
cmd-l in browser switch focus to url bar
cmd-[/] back/forward webpages
cmd-shift-t reopen last closed browser tab
opt-cmd-b open bookmarks
cmd-d add bookmark
cmd-shift-h open browser history
cmd-j see browser downloads
cmd-` cycle to next terminal window
cmd-w close tab
cmd-h Hide window
cmd-q Quit
cmd-n New window
cmd-opt tab switch and open program
cmd-space spotlight search
cmd-opt t toggle toolbar on/off
cmd-opt s toggle sidebar on/off
cmd-left/right switch views
fn f3 mission controll
cmd-left/right go to start/end of line
opt-left/right jump to next/prev word
cmd-backspace delete line
alt-backspace delte word
shift-cmd-left/right select line
shift-opt-left/right select word
cmd-s save
cmd-o open
cmd-delete close textedit without saving

schism tracker bash rc alias

alias schism='schismtracker --video-size=640x480'

Wednesday, September 20, 2023

create dir and move everything into it

heres some one liners

mkdir -p todays_songs && mv * todays_songs/

rename to remove that square bracket shit

for f in *; do mv "$f" "$(echo "$f" | sed 's/\[.*\]//')"; done

Thursday, September 14, 2023

raspberry pi adhoc

link to article

sudo nano /etc/network/interfaces

find line:
iface default inet dhcp
put a # character in front of the line to temporarily disable requesting an IP address from a DHCP server.
Then add below:

iface default inet static address 192.168.10.1 netmask 255.255.255.0

pi@raspberrypi ~ $ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

in wpa_supplicant # out all lines of previous wifi


ap_scan=2 network={ ssid="MyHoc" mode=1 frequency=2432 proto=WPA key_mgmt=WPA-NONE pairwise=NONE group=CCMP psk="CaptainHoc!" }

to connect on mac

Next click on the Advanced… button and go to the TCP/IP tab.



Select Manually from the Configure IPv4 drop-down menu.



Now fill in 192.168.10.2 for the IP Address and 255.255.255.0 for the Subnet Mask, then click the OK button.

webm to mp3 bash conversion

 
#!/bin/bash

# Check if ffmpeg is installed
if ! command -v ffmpeg &> /dev/null; then
    echo "ffmpeg is not installed. Please install it."
    exit 1
fi

# Loop through all .webm files in the current directory
for webm_file in *.webm; do
    # Check if there are any .webm files
    if [ -e "$webm_file" ]; then
        # Extract the base filename without extension
        base_filename="${webm_file%.*}"

        # Convert .webm to .mp3 using ffmpeg
        ffmpeg -i "$webm_file" -vn -acodec libmp3lame -q:a 4 "$base_filename.mp3"

        # Check if the conversion was successful
        if [ $? -eq 0 ]; then
            echo "Conversion of $webm_file to $base_filename.mp3 successful."

            # Remove the original .webm file
            rm -f "$webm_file"
            echo "$webm_file deleted."
        else
            echo "Conversion of $webm_file to $base_filename.mp3 failed."
        fi
    fi
done

Wednesday, September 13, 2023

my .vimrc

packloadall
call plug#begin('~/.vim/plugged')
Plug 'vimwiki/vimwiki'
Plug 'vim-airline/vim-airline'
Plug 'matze/vim-move'
Plug 'jceb/vim-orgmode'
Plug 'tpope/vim-speeddating'
Plug 'vim-scripts/utl.vim'
Plug 'mattn/calendar-vim'
Plug 'vim-airline/vim-airline-themes'
Plug 'sainnhe/sonokai'
Plug 'morhetz/gruvbox'
Plug 'tpope/vim-fugitive'
Plug 'plasticboy/vim-markdown'
Plug 'sfztools/sfz.vim'
Plug 'ap/vim-css-color'
Plug '907th/vim-auto-save'
Plug 'jiangmiao/auto-pairs'
Plug 'ajorgensen/vim-markdown-toc'
Plug 'mattn/emmet-vim'
Plug 'kshenoy/vim-signature'
Plug 'mechatroner/rainbow_csv'
Plug 'dhruvasagar/vim-table-mode'
Plug 'godlygeek/tabular'
Plug 'scrooloose/nerdtree'
Plug 'junegunn/goyo.vim'
Plug 'reedes/vim-pencil'
call plug#end()

" Enable folding based on Org mode headings
let g:org_special_headline_highlight = 1
let g:org_headline_fold = 1
" Remap vim-move from alt to shift
let g:move_key_modifier_visualmode = 'S'
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
set background=dark
colorscheme sonokai
syntax enable
set nobackup
set nowb
set noswapfile
set autoread
set wildmenu
set ffs=unix,dos,mac
set encoding=utf8
set showmatch
set backspace=eol,start,indent
set autoread
set wrap
set si
set ai
filetype plugin on
filetype indent on
set tabstop=4
set shiftwidth=4
set smarttab
set expandtab
set nocompatible
filetype plugin on
syntax on
set autowriteall
" Automatically save files on change
let g:auto_save = 1
" Set the interval for auto-saving in milliseconds (optional)
let g:auto_save_silent = 1
" Emmet shortcuts
let g:user_emmet_mode='n'
let g:user_emmet_leader_key=','
nnoremap  :NERDTreeToggle
" Exit Vim if NERDTree is the only window remaining in the only tab.
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
nnoremap  :bnext
nnoremap  :bprev
set tags=./tags,tags;/
" Tmux Navigator integration for Vim
let g:navigator_no_mappings = 1
nnoremap  :TmuxNavigateLeft
nnoremap  :TmuxNavigateDown
nnoremap  :TmuxNavigateUp
nnoremap  :TmuxNavigateRight