Home.md
... ...
@@ -2,10 +2,10 @@
2 2
3 3
## tech
4 4
### everyday tools
5
-* [vim](/edt/vim)
6
-* [git](/edt/git)
7
-* [tmux](/edt/tmux)
8
-* [more](/tech-index#everyday-tools)...
5
+* [vim](/software/vim)
6
+* [git](/software/git)
7
+* [tmux](/software/tmux)
8
+* [more...](/tech-index#everyday-tools)
9 9
10 10
### operating systems
11 11
* [linux](linux/index)
... ...
@@ -14,7 +14,7 @@
14 14
15 15
### programming
16 16
* [shell_scripts](/programming/shell_scripts)
17
-* [more](/tech-index#programming)...
17
+* [more...](/tech-index#programming)
18 18
19 19
### other
20 20
* [software](/tech-index#software)
edt/git.md
... ...
@@ -1,105 +0,0 @@
1
-# git
2
-
3
-undo merge that hasn't been pushed
4
-```zsh
5
-git reset --merge HEAD~1
6
-```
7
-
8
-roll back hard
9
-```
10
-git reset --hard <commit/tag>
11
-```
12
-
13
-force push of a previous commit
14
-```
15
-git push -f origin <commit_id>:<branch>
16
-```
17
-
18
-delete remote branch
19
-```
20
-git push --delete origin <branch>
21
-```
22
-
23
-reset local branch after a forced-update (above)
24
-```
25
-git fetch
26
-git reset origin/<branch> --hard
27
-```
28
-
29
-renaming branch and updating remote
30
-```
31
-git branch -m old-name new-name
32
-git push origin --set-upstream new-name
33
-git push origin :old-name
34
-```
35
-
36
-set username for [single repo][]
37
-```
38
-git config user.username 'name'
39
-```
40
-
41
-set signing key for local repo
42
-```
43
-git config user.signingkey <id>
44
-```
45
-
46
-[signing][] commits
47
-```
48
-git commit -S -m 'msg'
49
-```
50
-
51
-compare diff between two commits
52
-```
53
-git diff <commit>...<commit>
54
-```
55
-
56
-stash
57
-```
58
-git stash
59
-git stash show
60
-```
61
-
62
-unstash
63
-```
64
-git stash pop
65
-```
66
-
67
-add remote origin
68
-```
69
-git remote add origin git@gitserver/path/to/repo
70
-```
71
-
72
-add multiple push repos
73
-```
74
-git remote set-url --add --push origin git@gitserver/original/repo
75
-git remote set-url --add --push origin https://gitserver/another/repo
76
-```
77
-
78
-archive branch
79
-```
80
-git archive --format zip --outpu /path/to/output.zip <branch>
81
-```
82
-
83
-## using `hub`
84
-### pull requests
85
-```
86
-hub pr list
87
-hub pr checkout <num>
88
-```
89
-
90
-## helpful links
91
-
92
-[making a pull request][]
93
-
94
-[branching and rebasing][]
95
-
96
-[branching model][]
97
-
98
-[merging and rebasing][]
99
-
100
-[making a pull request]: https://www.atlassian.com/git/tutorials/making-a-pull-request
101
-[branching and rebasing]: https://git-scm.com/book/en/v2/Git-Branching-Rebasing
102
-[branching model]: https://nvie.com/posts/a-successful-git-branching-model/
103
-[single repo]: https://help.github.com/articles/setting-your-username-in-git/
104
-[merging and rebasing]: https://www.atlassian.com/git/tutorials/merging-vs-rebasing
105
-[signing]: https://git-scm.com/book/en/v2/Git-Tools-Signing-Your-Work
edt/irc.md
... ...
@@ -1,49 +0,0 @@
1
-# irc
2
-
3
-[mode list][]
4
-
5
-## freenode
6
-use the following to search channels
7
-```
8
-/msg alis LIST *searchterm*
9
-```
10
-
11
-## irc.highway.net #ebooks
12
-```
13
-@search Author/Title
14
-/dcc get Search
15
-```
16
-
17
-locate correct file
18
-```
19
-!user filename
20
-/dcc get username
21
-```
22
-
23
-## ssl port
24
-```
25
-/connect -tls <irc_server> <port>
26
-```
27
-
28
-## irc.c
29
-* `j <chan>` - join channel
30
-* `l <chan>` - leave channel
31
-* `m <user>` - private message
32
-* `ctrl-n` - next window
33
-* `ctrl-p` - previous window
34
-* `r <cmd>` - send raw
35
- * `r names`
36
- * `r whois`
37
-
38
-### testing
39
-* miniircd (lxc container)
40
- * get ip (10.0.3.133)
41
-* ircc (lxc container)
42
- * `./irc -n guest -u guest -s 10.0.3.133`
43
-
44
-## irssi
45
-### colour table
46
-
47
-use 256 color tables 1-7 preceded with `x` (bg) or `X` foreground, and then a,b,c etc. i.e `%x7g`
48
-
49
-[mode list]: https://madirc.net/irc-channelmodes.html
edt/mail.md
... ...
@@ -1,15 +0,0 @@
1
-```
2
-mail
3
-```
4
-* `+` open next mail
5
-* `-` open prev mail
6
-* `d` delete mail
7
- * `d 6 9` delete mail 6 & 9
8
- * `d 4-40` delete mails 4 to 40
9
- * `d*` delete all
10
-* `reply`
11
-* `h` print messages
12
-
13
-use csv list in ~/.forward to forward mails to external addr. or check /etc/aliases ([stackexchange][])
14
-
15
-[stackexchange]: https://unix.stackexchange.com/a/26670
edt/mutt.md
... ...
@@ -1,47 +0,0 @@
1
-# mutt
2
-
3
-search, limit and tagging [patterns][]
4
-* limit new (unread) messages using `~U`
5
-* limit messages either to: or cc: using ~C (useful for mailing lists)
6
-
7
-## index format
8
-default index format is (taken from [muttrc man][])
9
-```
10
-"%4C %Z %{%b %d} %-15.15L (%?l?%4l&%4c?) %s"
11
-```
12
-
13
-current format is
14
-```
15
-"%Z %-30.30L %M %s"
16
-```
17
-_message status, sender, hidden msgs (in thread), subject_
18
-
19
-## threads
20
-collapse threads using `Esc-v`
21
-
22
-[rebind collapse-thread][] to '-'
23
-```
24
-bind index - collapse-thread
25
-```
26
-
27
-configure threads to be collapsed when mailbox opened ([thread_ref][])
28
-```
29
-folder-hook . "push <collapse-all>\n"
30
-```
31
-
32
-## attachments
33
-download directory macro ([macro source][])
34
-```
35
-macro attach W "<save-entry><bol>~/tmp/<eol>"
36
-```
37
-
38
-pipe pdf
39
-```
40
-| zathura -
41
-```
42
-
43
-[patterns]: http://www.mutt.org/doc/manual/#patterns
44
-[muttrc man]: https://linux.die.net/man/5/muttrc
45
-[rebind collapse-thread]: https://heipei.net/2009/09/10/mutt-threading-like-a-pro/
46
-[thread_ref]: http://compgroups.net/comp.mail.mutt/collapsing-threads-by-default/2550437
47
-[macro source]: https://superuser.com/questions/695541/where-does-mutt-save-attachment
edt/tmux.md
... ...
@@ -1,12 +0,0 @@
1
-# tmux
2
-
3
-all commands used with `prefix`
4
-
5
-| command | description |
6
-| --- | --- |
7
-| `s` | switch tmux sessions |
8
-| `r` | reload config |
9
-| `$` | rename session |
10
-
11
-
12
-
edt/vim.md
... ...
@@ -1,227 +0,0 @@
1
-# vim
2
-
3
-## copy contents to/from files
4
-to copy the contents into a file
5
- ```
6
- :r <filename>
7
- ```
8
-or
9
- ```
10
- :"qY # yank out of first file
11
- :"qP # put into second file
12
- ```
13
-or read range of lines
14
- ```
15
- :r! sed -n <n>,<m>p /path/to/file.md
16
- ```
17
-
18
-to copy the contents to a new file
19
- ```
20
- :<n>,<m> w <filename>
21
- ```
22
- where `<n>` and `<m>` are numbers or symbols that designate range of lines
23
-
24
-
25
-## text wrap
26
-(wrap to column)
27
-wrap current line
28
-```
29
-gqq
30
-```
31
-
32
-wrap entire file
33
-```
34
-gqG
35
-```
36
-
37
-wrap paragraph using visual selection
38
-```
39
-V}gq
40
-```
41
-
42
-also use visual or visual block with `gq`
43
-
44
-## spell
45
-[using_spellcheck][]
46
-check spelling
47
-```
48
-Spell
49
-```
50
-
51
-move to word
52
-```
53
-]s [s
54
-```
55
-
56
-and see results
57
-```
58
-z=
59
-```
60
-
61
-turn off highlighting
62
-```
63
-set nospell
64
-```
65
-
66
-## buffers
67
-- buffer [faq][]
68
-- using [vanilla vim][]
69
-- [buffers over tabs][]
70
-- open buffer
71
- ```
72
- :e <filename>
73
- :new
74
- ```
75
-- view buffers
76
- ```
77
- :ls
78
- ```
79
-- switch buffers
80
- ```
81
- :buffer <num>
82
- ```
83
-- unload buffer
84
- ```
85
- :bd <num>
86
- ```
87
-
88
-## incrementing numbers
89
-post on [reddit][]
90
-
91
-select several lines containing '0' and type `g<C-a>`
92
-
93
-## split
94
-- movement
95
- ```
96
- <Ctrl>-w [h,j,k,l]
97
- <Ctrl>-w w
98
- ```
99
-- rotate
100
- ```
101
- <Ctrl>-w r
102
- ```
103
-- orientate
104
- ```
105
- <Ctrl>-w J
106
- <Ctrl>-w L
107
- ```
108
-- sizing
109
- ```
110
- <Ctrl>-w - # decrease height by 1 line
111
- <Ctrl>-w + # increase height by 1 line
112
- <Ctrl>-w < # change width by 1 line to the left
113
- <Ctrl>-w > # change width by 1 line to the right
114
- <Ctrl>-w 10 - # decrease height by 10 lines, etc...
115
- ```
116
-
117
-## diff
118
-```
119
-:windo diffthis
120
-:windo diffoff
121
-```
122
-
123
-## list recent doc
124
-```
125
-:ol[dfiles]
126
-```
127
-
128
-## replace
129
-- change inner word
130
- ```
131
- ciw
132
- ```
133
-
134
-## delete
135
-- until but not <char>
136
- ```
137
- dt <char>
138
- ```
139
-- until and <char>
140
- ```
141
- df <char>
142
- ```
143
-
144
-## visual
145
-- visual select to end of line excluding whitespace
146
-```
147
-vg_
148
-```
149
-
150
-## using the shell
151
-[vim and the shell][]
152
-
153
-- run current buffer as script
154
-```bash
155
-:!./%
156
-```
157
-
158
-- in script, highlight line and switch to command mode by pressing `:`
159
-```bash
160
-:'<,'>w !bash -
161
-```
162
-
163
-```python
164
-:'<,'>w !python -
165
-```
166
-
167
-## directory of current buffer
168
-open new file in dir of current buffer
169
-```
170
-:e %:h/filename
171
-```
172
-
173
-save file as new file in dir of current buffer
174
-```
175
-:sav %:h/filename
176
-```
177
-
178
-## substitute on multiple lines
179
-https://stackoverflow.com/a/19996145
180
-```
181
-:6,10s/<search_string>/<replace_string>/g | 14,18&&
182
-```
183
-
184
-## reverse substitute
185
-* adds a tab to the beginning of all lines that don't start with `Pattern`
186
-```
187
-:%v/^Pattern/s/^/\t/
188
-```
189
-
190
-## sort visual block
191
-https://vim.fandom.com/wiki/How_to_sort_using_visual_blocks
192
-```
193
-:'<,'>sort /\ze\%V/
194
-```
195
-
196
-## move current line (scroll-cursor)
197
-`z<enter>` or `zt` - move to top of buffer
198
-`z.` or `zz` - move to centre of buffer
199
-`z-` or `zb` - move to bottom of buffer
200
-
201
-(zEnter, z., and z- puts the cursor in the first non blank column. zt, zz, and zb leaves the cursor in the current column)
202
-
203
-```
204
-:help scroll-cursor
205
-```
206
-
207
-## yanking into a register
208
-`"qp` paste the contents of the register to the current cursor position
209
-`i` enter insert mode at the begging of the pasted line
210
-`^` add the missing motion to return to the front of the line
211
-`<escape>` return to visual mode
212
-`"qyy` yank this new modified macro back into the q register
213
-`dd` delete the pasted register from the file your editing
214
-
215
-## editing the register visually
216
-`:let @q='` open the q register
217
-`<cntl-r><cntl-r>q` paste the contents of the q register into the buffer
218
-`^` add the missing motion to return to the front of the line
219
-`'` add a closing quote
220
-`<enter>` finish editing the macro
221
-
222
-[using_spellcheck]: https://www.linux.com/learn/using-spell-checking-vim
223
-[faq]: http://vim.wikia.com/wiki/Vim_buffer_FAQ
224
-[vanilla vim]: https://stackoverflow.com/questions/16082991/vim-switching-between-files-rapidly-using-vanilla-vim-no-plugins
225
-[buffers over tabs]: https://stackoverflow.com/questions/26708822/why-do-vim-experts-prefer-buffers-over-tabs
226
-[reddit]: https://www.reddit.com/r/vim/comments/a1lvb1/til_gca_for_creating_a_column_of_incrementing/
227
-[vim and the shell]: https://vimways.org/2019/vim-and-the-shell/
edt/vimwiki.md
... ...
@@ -1,31 +0,0 @@
1
-# vimwiki
2
-
3
-## commands
4
-| command | description |
5
-| --- | --- |
6
-| `=` | increase header |
7
-| `-` | decrease header |
8
-| `C-space` | check todo box |
9
-| `glh` | step down list |
10
-| `gll` | step up list |
11
-| `glr` | refresh numbered list |
12
-| `\w\t` | day diary in new tab |
13
-| `\w\i` | on diary index generate new links |
14
-| `\wt` | open wiki index in tab (only after mapping `nmap <Leader>wt <Plug>VimwikiTabnewLink`) |
15
-| `\wi` | open diary index |
16
-
17
-## syntax highlighting
18
-```bash
19
-echo hello friend
20
-```
21
-
22
-## convert to html
23
-pandoc -s -f markdown -t html -o uofu/azure_ad_requirements.html uofu/azure_ad_requirements.md && firefox uofu/azure_ad_requirements
24
-.html
25
-
26
-## anchors
27
- use [title] (#anchor#subanchor)
28
- i'm using :tags: under a #ref header to jump to links in page
29
- - switch to [pandoc markdown][]
30
-
31
-[pandoc markdown]: http://pandoc.org/MANUAL.html#pandocs-markdown
software/git.md
... ...
@@ -0,0 +1,105 @@
1
+# git
2
+
3
+undo merge that hasn't been pushed
4
+```zsh
5
+git reset --merge HEAD~1
6
+```
7
+
8
+roll back hard
9
+```
10
+git reset --hard <commit/tag>
11
+```
12
+
13
+force push of a previous commit
14
+```
15
+git push -f origin <commit_id>:<branch>
16
+```
17
+
18
+delete remote branch
19
+```
20
+git push --delete origin <branch>
21
+```
22
+
23
+reset local branch after a forced-update (above)
24
+```
25
+git fetch
26
+git reset origin/<branch> --hard
27
+```
28
+
29
+renaming branch and updating remote
30
+```
31
+git branch -m old-name new-name
32
+git push origin --set-upstream new-name
33
+git push origin :old-name
34
+```
35
+
36
+set username for [single repo][]
37
+```
38
+git config user.username 'name'
39
+```
40
+
41
+set signing key for local repo
42
+```
43
+git config user.signingkey <id>
44
+```
45
+
46
+[signing][] commits
47
+```
48
+git commit -S -m 'msg'
49
+```
50
+
51
+compare diff between two commits
52
+```
53
+git diff <commit>...<commit>
54
+```
55
+
56
+stash
57
+```
58
+git stash
59
+git stash show
60
+```
61
+
62
+unstash
63
+```
64
+git stash pop
65
+```
66
+
67
+add remote origin
68
+```
69
+git remote add origin git@gitserver/path/to/repo
70
+```
71
+
72
+add multiple push repos
73
+```
74
+git remote set-url --add --push origin git@gitserver/original/repo
75
+git remote set-url --add --push origin https://gitserver/another/repo
76
+```
77
+
78
+archive branch
79
+```
80
+git archive --format zip --outpu /path/to/output.zip <branch>
81
+```
82
+
83
+## using `hub`
84
+### pull requests
85
+```
86
+hub pr list
87
+hub pr checkout <num>
88
+```
89
+
90
+## helpful links
91
+
92
+[making a pull request][]
93
+
94
+[branching and rebasing][]
95
+
96
+[branching model][]
97
+
98
+[merging and rebasing][]
99
+
100
+[making a pull request]: https://www.atlassian.com/git/tutorials/making-a-pull-request
101
+[branching and rebasing]: https://git-scm.com/book/en/v2/Git-Branching-Rebasing
102
+[branching model]: https://nvie.com/posts/a-successful-git-branching-model/
103
+[single repo]: https://help.github.com/articles/setting-your-username-in-git/
104
+[merging and rebasing]: https://www.atlassian.com/git/tutorials/merging-vs-rebasing
105
+[signing]: https://git-scm.com/book/en/v2/Git-Tools-Signing-Your-Work
software/irc.md
... ...
@@ -0,0 +1,49 @@
1
+# irc
2
+
3
+[mode list][]
4
+
5
+## freenode
6
+use the following to search channels
7
+```
8
+/msg alis LIST *searchterm*
9
+```
10
+
11
+## irc.highway.net #ebooks
12
+```
13
+@search Author/Title
14
+/dcc get Search
15
+```
16
+
17
+locate correct file
18
+```
19
+!user filename
20
+/dcc get username
21
+```
22
+
23
+## ssl port
24
+```
25
+/connect -tls <irc_server> <port>
26
+```
27
+
28
+## irc.c
29
+* `j <chan>` - join channel
30
+* `l <chan>` - leave channel
31
+* `m <user>` - private message
32
+* `ctrl-n` - next window
33
+* `ctrl-p` - previous window
34
+* `r <cmd>` - send raw
35
+ * `r names`
36
+ * `r whois`
37
+
38
+### testing
39
+* miniircd (lxc container)
40
+ * get ip (10.0.3.133)
41
+* ircc (lxc container)
42
+ * `./irc -n guest -u guest -s 10.0.3.133`
43
+
44
+## irssi
45
+### colour table
46
+
47
+use 256 color tables 1-7 preceded with `x` (bg) or `X` foreground, and then a,b,c etc. i.e `%x7g`
48
+
49
+[mode list]: https://madirc.net/irc-channelmodes.html
software/mail.md
... ...
@@ -0,0 +1,15 @@
1
+```
2
+mail
3
+```
4
+* `+` open next mail
5
+* `-` open prev mail
6
+* `d` delete mail
7
+ * `d 6 9` delete mail 6 & 9
8
+ * `d 4-40` delete mails 4 to 40
9
+ * `d*` delete all
10
+* `reply`
11
+* `h` print messages
12
+
13
+use csv list in ~/.forward to forward mails to external addr. or check /etc/aliases ([stackexchange][])
14
+
15
+[stackexchange]: https://unix.stackexchange.com/a/26670
software/mutt.md
... ...
@@ -0,0 +1,47 @@
1
+# mutt
2
+
3
+search, limit and tagging [patterns][]
4
+* limit new (unread) messages using `~U`
5
+* limit messages either to: or cc: using ~C (useful for mailing lists)
6
+
7
+## index format
8
+default index format is (taken from [muttrc man][])
9
+```
10
+"%4C %Z %{%b %d} %-15.15L (%?l?%4l&%4c?) %s"
11
+```
12
+
13
+current format is
14
+```
15
+"%Z %-30.30L %M %s"
16
+```
17
+_message status, sender, hidden msgs (in thread), subject_
18
+
19
+## threads
20
+collapse threads using `Esc-v`
21
+
22
+[rebind collapse-thread][] to '-'
23
+```
24
+bind index - collapse-thread
25
+```
26
+
27
+configure threads to be collapsed when mailbox opened ([thread_ref][])
28
+```
29
+folder-hook . "push <collapse-all>\n"
30
+```
31
+
32
+## attachments
33
+download directory macro ([macro source][])
34
+```
35
+macro attach W "<save-entry><bol>~/tmp/<eol>"
36
+```
37
+
38
+pipe pdf
39
+```
40
+| zathura -
41
+```
42
+
43
+[patterns]: http://www.mutt.org/doc/manual/#patterns
44
+[muttrc man]: https://linux.die.net/man/5/muttrc
45
+[rebind collapse-thread]: https://heipei.net/2009/09/10/mutt-threading-like-a-pro/
46
+[thread_ref]: http://compgroups.net/comp.mail.mutt/collapsing-threads-by-default/2550437
47
+[macro source]: https://superuser.com/questions/695541/where-does-mutt-save-attachment
software/tmux.md
... ...
@@ -0,0 +1,12 @@
1
+# tmux
2
+
3
+all commands used with `prefix`
4
+
5
+| command | description |
6
+| --- | --- |
7
+| `s` | switch tmux sessions |
8
+| `r` | reload config |
9
+| `$` | rename session |
10
+
11
+
12
+
software/vim.md
... ...
@@ -0,0 +1,227 @@
1
+# vim
2
+
3
+## copy contents to/from files
4
+to copy the contents into a file
5
+ ```
6
+ :r <filename>
7
+ ```
8
+or
9
+ ```
10
+ :"qY # yank out of first file
11
+ :"qP # put into second file
12
+ ```
13
+or read range of lines
14
+ ```
15
+ :r! sed -n <n>,<m>p /path/to/file.md
16
+ ```
17
+
18
+to copy the contents to a new file
19
+ ```
20
+ :<n>,<m> w <filename>
21
+ ```
22
+ where `<n>` and `<m>` are numbers or symbols that designate range of lines
23
+
24
+
25
+## text wrap
26
+(wrap to column)
27
+wrap current line
28
+```
29
+gqq
30
+```
31
+
32
+wrap entire file
33
+```
34
+gqG
35
+```
36
+
37
+wrap paragraph using visual selection
38
+```
39
+V}gq
40
+```
41
+
42
+also use visual or visual block with `gq`
43
+
44
+## spell
45
+[using_spellcheck][]
46
+check spelling
47
+```
48
+Spell
49
+```
50
+
51
+move to word
52
+```
53
+]s [s
54
+```
55
+
56
+and see results
57
+```
58
+z=
59
+```
60
+
61
+turn off highlighting
62
+```
63
+set nospell
64
+```
65
+
66
+## buffers
67
+- buffer [faq][]
68
+- using [vanilla vim][]
69
+- [buffers over tabs][]
70
+- open buffer
71
+ ```
72
+ :e <filename>
73
+ :new
74
+ ```
75
+- view buffers
76
+ ```
77
+ :ls
78
+ ```
79
+- switch buffers
80
+ ```
81
+ :buffer <num>
82
+ ```
83
+- unload buffer
84
+ ```
85
+ :bd <num>
86
+ ```
87
+
88
+## incrementing numbers
89
+post on [reddit][]
90
+
91
+select several lines containing '0' and type `g<C-a>`
92
+
93
+## split
94
+- movement
95
+ ```
96
+ <Ctrl>-w [h,j,k,l]
97
+ <Ctrl>-w w
98
+ ```
99
+- rotate
100
+ ```
101
+ <Ctrl>-w r
102
+ ```
103
+- orientate
104
+ ```
105
+ <Ctrl>-w J
106
+ <Ctrl>-w L
107
+ ```
108
+- sizing
109
+ ```
110
+ <Ctrl>-w - # decrease height by 1 line
111
+ <Ctrl>-w + # increase height by 1 line
112
+ <Ctrl>-w < # change width by 1 line to the left
113
+ <Ctrl>-w > # change width by 1 line to the right
114
+ <Ctrl>-w 10 - # decrease height by 10 lines, etc...
115
+ ```
116
+
117
+## diff
118
+```
119
+:windo diffthis
120
+:windo diffoff
121
+```
122
+
123
+## list recent doc
124
+```
125
+:ol[dfiles]
126
+```
127
+
128
+## replace
129
+- change inner word
130
+ ```
131
+ ciw
132
+ ```
133
+
134
+## delete
135
+- until but not <char>
136
+ ```
137
+ dt <char>
138
+ ```
139
+- until and <char>
140
+ ```
141
+ df <char>
142
+ ```
143
+
144
+## visual
145
+- visual select to end of line excluding whitespace
146
+```
147
+vg_
148
+```
149
+
150
+## using the shell
151
+[vim and the shell][]
152
+
153
+- run current buffer as script
154
+```bash
155
+:!./%
156
+```
157
+
158
+- in script, highlight line and switch to command mode by pressing `:`
159
+```bash
160
+:'<,'>w !bash -
161
+```
162
+
163
+```python
164
+:'<,'>w !python -
165
+```
166
+
167
+## directory of current buffer
168
+open new file in dir of current buffer
169
+```
170
+:e %:h/filename
171
+```
172
+
173
+save file as new file in dir of current buffer
174
+```
175
+:sav %:h/filename
176
+```
177
+
178
+## substitute on multiple lines
179
+https://stackoverflow.com/a/19996145
180
+```
181
+:6,10s/<search_string>/<replace_string>/g | 14,18&&
182
+```
183
+
184
+## reverse substitute
185
+* adds a tab to the beginning of all lines that don't start with `Pattern`
186
+```
187
+:%v/^Pattern/s/^/\t/
188
+```
189
+
190
+## sort visual block
191
+https://vim.fandom.com/wiki/How_to_sort_using_visual_blocks
192
+```
193
+:'<,'>sort /\ze\%V/
194
+```
195
+
196
+## move current line (scroll-cursor)
197
+`z<enter>` or `zt` - move to top of buffer
198
+`z.` or `zz` - move to centre of buffer
199
+`z-` or `zb` - move to bottom of buffer
200
+
201
+(zEnter, z., and z- puts the cursor in the first non blank column. zt, zz, and zb leaves the cursor in the current column)
202
+
203
+```
204
+:help scroll-cursor
205
+```
206
+
207
+## yanking into a register
208
+`"qp` paste the contents of the register to the current cursor position
209
+`i` enter insert mode at the begging of the pasted line
210
+`^` add the missing motion to return to the front of the line
211
+`<escape>` return to visual mode
212
+`"qyy` yank this new modified macro back into the q register
213
+`dd` delete the pasted register from the file your editing
214
+
215
+## editing the register visually
216
+`:let @q='` open the q register
217
+`<cntl-r><cntl-r>q` paste the contents of the q register into the buffer
218
+`^` add the missing motion to return to the front of the line
219
+`'` add a closing quote
220
+`<enter>` finish editing the macro
221
+
222
+[using_spellcheck]: https://www.linux.com/learn/using-spell-checking-vim
223
+[faq]: http://vim.wikia.com/wiki/Vim_buffer_FAQ
224
+[vanilla vim]: https://stackoverflow.com/questions/16082991/vim-switching-between-files-rapidly-using-vanilla-vim-no-plugins
225
+[buffers over tabs]: https://stackoverflow.com/questions/26708822/why-do-vim-experts-prefer-buffers-over-tabs
226
+[reddit]: https://www.reddit.com/r/vim/comments/a1lvb1/til_gca_for_creating_a_column_of_incrementing/
227
+[vim and the shell]: https://vimways.org/2019/vim-and-the-shell/
software/vimwiki.md
... ...
@@ -0,0 +1,31 @@
1
+# vimwiki
2
+
3
+## commands
4
+| command | description |
5
+| --- | --- |
6
+| `=` | increase header |
7
+| `-` | decrease header |
8
+| `C-space` | check todo box |
9
+| `glh` | step down list |
10
+| `gll` | step up list |
11
+| `glr` | refresh numbered list |
12
+| `\w\t` | day diary in new tab |
13
+| `\w\i` | on diary index generate new links |
14
+| `\wt` | open wiki index in tab (only after mapping `nmap <Leader>wt <Plug>VimwikiTabnewLink`) |
15
+| `\wi` | open diary index |
16
+
17
+## syntax highlighting
18
+```bash
19
+echo hello friend
20
+```
21
+
22
+## convert to html
23
+pandoc -s -f markdown -t html -o uofu/azure_ad_requirements.html uofu/azure_ad_requirements.md && firefox uofu/azure_ad_requirements
24
+.html
25
+
26
+## anchors
27
+ use [title] (#anchor#subanchor)
28
+ i'm using :tags: under a #ref header to jump to links in page
29
+ - switch to [pandoc markdown][]
30
+
31
+[pandoc markdown]: http://pandoc.org/MANUAL.html#pandocs-markdown
tech-index.md
... ...
@@ -1,12 +1,12 @@
1 1
# tech
2 2
## everyday tools
3
-* [vim](/edt/vim)
4
-* [git](/edt/git)
5
-* [tmux](/edt/tmux)
6
-* [mutt](/edt/mutt)
7
-* [vimwiki](/edt/vimwiki)
8
-* [irc](/edt/irc)
9
-* [mail](/edt/mail)
3
+* [vim](/software/vim)
4
+* [git](/software/git)
5
+* [tmux](/software/tmux)
6
+* [mutt](/software/mutt)
7
+* [vimwiki](/software/vimwiki)
8
+* [irc](/software/irc)
9
+* [mail](/software/mail)
10 10
11 11
## operating systems
12 12
* [linux](/linux/index)