⌨️ Programming Languages
- ucc: my own C compiler, to learn type systems, code-gen, parsing, etc.
- cg: partially complete intermediate language, as a new backend for ucc
- podsync: podcast syncing server, written in Rust
🛠️ Other Projects
- tim: my vim clone
- uvi: older vim clone
- utop: process monitor
🚧 Pull requests
📚 Cool Blogs
📽️ Favourite Projects
|
🔮 Latest Vim Tricks
| Command |
Description |
:g/^\s*$/;//-1sort |
Sort each block of lines in a file |
:*cmd |
Use last visual range as range for 'cmd' |
:e `=...` |
Evaluate expr in backticks as vim expression |
gI |
Start insert in the first column (i.e. 0, not ^) |
c_<C-R>_<C-[APL]> |
Command line, insert current WORD / path / line |
"1pu., u., ... |
Cycle through deletions (see :h redo-register) |
i_Ctrl-F |
Reindent current line, from insert mode ('cindent') |
:Lex/:Rex |
Explore %:h |
ze/zs |
Horizontal equivalents to zt/zb |
zv/zx |
Visible cursor / reapply 'foldlevel', then zv |
'^ |
Location of last insertion stop |
/...<C-G> |
Next 'incsearch' match (C-T for previous) |
:s/.../\L\u/ |
\u - capitalise first letter, \L lowercase rest |
/\_^/, /\_$/ |
Match /^/, even if ^ isn't at pattern/group start |
g== |
Run the current code block (in a help buffer) |
:w ++p [...] |
Write, creating parent directories |
:h news |
Show release news |
neovim
:echo v:servername # this is $server
:detach
$ nvim --server $server --remote-ui
Substitute
| Command |
Description |
:s [g] / :& [g] / & |
:s//~/ (orig pattern, flags not kept) |
&/:& |
:s |
g& |
:%s//~/& (orig pattern, flags kept) |
:~ |
:s;@/;~; (search pattern, flags not kept) |
:s/.../.../& |
Keep flags |
Netrw
| Command |
Description |
i |
Toggle view mode - tree etc |
- |
cd .. |
qf |
stat current file |
p |
open in preview window |
gh |
toggle dotfiles |
a |
toggle hide list: show, hide, only |
d |
mkdir |
% |
new file |
D |
unlink/rmdir |
R |
rename |
mf |
mark file |
mu |
unmark all |
qF |
mark files in qf |
mA |
mark arguments |
ma |
marked files --> args |
ma |
--> args |
cb |
--> buffer list |
cB |
buffer list --> marked files |
mx |
execute cmd % per marked file (in local list) |
mX |
execute cmd % for all (in global list) |
mt |
mark target (I to toggle banner and view it) |
mm / mc |
move / copy files to target |
Git
| Command |
Description |
log -L :funcname |
Show a log of changes just to funcname (regex) |
blame -C[CC] -w |
-w: skip whitespace commits, -C track across commits |
clone --filter=blob:none |
clone and then fetch only the blobs needed for checkout |
scalar |
separate command for managing large git repos |
--fixup amend/reword:$ci |
amend: commit index & change $ci's msg (reword: no-index) |
More in the archive
🔌 Vim Plugins
- vim-bg: Run
grep, make, etc in the background, lazily populating the quickfix or location list
- javascript.vim: A quick-and-simple goto-tag implementation, for javascript modules
- dotcomplete.vim: Complete after a
., based on what's already in the current buffer
- qf-filter.vim: Add
:QFDrop and :QFKeep to filter the quickfix list
- tabname.vim: Add terminal, modified and filename details to tabs, or the contents of
t:title
- oldbuf.vim: Add
:Oldedit with completion based on vim's oldfiles
- autosave.vim: On
g:autosave_enabled, save all modified buffers on CursorHold/FocusLost
- bufedit.vim: ctrlp.vim-like command line preview for navigating opened buffers
- cmdalias.vim: Create command-line aliases, like
:vsb --> :vs|b, etc
|