Skip to content

Commit

Permalink
Add "Editing archive files with Vim" note
Browse files Browse the repository at this point in the history
  • Loading branch information
kencx committed Feb 23, 2024
1 parent dc75076 commit 3a7a9d1
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 42 deletions.
36 changes: 20 additions & 16 deletions content/posts/keybinds/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ any keybinds you want to show:
From the gif, I think you can tell the design was heavily inspired by the custom
`sxhkd` + `fzf` script. All hotkeys and their descriptions are presented into a
two column table, delimited by sections (or groups) and their headers in bold.
two column table, separated into sections (or groups) and delimited by their
headers in bold.

The sections were inspired by awesomewm's shortcut menu and help to visually
split all hotkeys by their applications/software. These section and section
Expand All @@ -156,23 +157,25 @@ their plugins.

The other key feature of `keyb` is its fuzzy search. There are two search modes:

- Normal search filters all rows except headers
- Header search filters header rows only
- Normal search: filters all rows except headers
- Header search: filters header rows only

This means there are three different ways of presenting table rows:
This means that there are three different ways of presenting table rows:
non-filtered, normal search filtered and header search filtered. These three
tables must be distinct enough that the user must know which mode they are in,
but also similar enough to maintain a common UX throughout. This proved to be
challenging to develop since I'm not a designer or UX expert.
tables had to be distinct enough that the user should know which mode they are
in without getting lost, but also similar enough to maintain a common UX
throughout. This was challenging to develop since I'm not a designer or UX
expert.

What I went with was this:

- **Non-filtered**: The default table with sections delimited by their headers (in
bold)
- **Normal search filtered**: Table rows are ordered by fuzzy search with no headers
shown in the main table. Instead, headers are present just below the search
bar for quick reference. Headers are still necessary in the event that there
are hotkeys with the same description and/or keybind in different applications
- **Non-filtered**: The default table with sections separated by their headers
(in bold)
- **Normal search filtered**: The table is ordered by fuzzy search with no
section and headers. Instead, headers are present just below the search bar
for quick reference. I found headers to still be necessary to prevent
confusion when there are hotkeys with similar descriptions and/or keybinds for
different applications
- **Header search**: Table headers are ordered by fuzzy search with all their
corresponding section hotkeys

Expand Down Expand Up @@ -201,6 +204,7 @@ is outside the scope of `keyb` and more suited for tools like
keyboard input that can be piped into `xdotool` when the user selects a given
row in the table.

I've been dogfooding `keyb` almost daily for more than a year now. There hasn't
been major bugs or annoyances as far as I'm aware, but please feel free to open
an issue if you do try it out!
I've been dogfooding `keyb` almost daily for more than a year now, so much that
I rarely need to refer to it now, which was kind of the point I guess? There
hasn't been major bugs or annoyances as far as I'm aware, but please feel free
to open an issue if you do try it out!
24 changes: 0 additions & 24 deletions content/til/bash/aliases.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,6 @@ tags:
- bash
---

Aliases allow a string to be substituted for a word:

```bash
$ alias hello="echo hello world"
$ hello
hello world
```

Since aliases are textual substitutions, we can append arguments to them

```bash
$ hello foo
hello world foo
```

## No Recursive Expansion
When a command is tested for aliases, a word that is identical to the alias being expanded is not expanded recursively. For example, the alias

```bash
alias ls='ls -F'
```

is not expanded recursively.

## Bypassing Aliases
If we wish to run a command which we have assigned an alias of the same name, we can bypass them in two ways:

Expand Down
2 changes: 1 addition & 1 deletion content/til/git/tracking-specific-branches.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Tracking Specific Branches.md"
title: "Tracking Specific Branches"
date: 2023-10-30
lastmod: 2023-10-30
draft: true
Expand Down
1 change: 1 addition & 0 deletions content/til/neovim/dynamic-python-interpreter.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ tags:
- neovim
- python
- lua
- lsp
- snippets
---

Expand Down
28 changes: 28 additions & 0 deletions content/til/neovim/editing-tar-files.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: "Editing archive files with Vim"
date: 2024-02-23
lastmod:
draft: false
toc: false
tags:
- vim
- tar
---

Vim can be used to edit archive files of multiple formats directly[^1]:

```bash
$ vim foobar.zip
$ vim foobar.tar.gz
```


## References
```text
:help tar
:help zip
:help gzip
```

[^1]: Interestingly, I discovered this when I accidentally opened an `.epub` file
with vim
2 changes: 1 addition & 1 deletion content/til/python/argparse-boolean-flags.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Argparse - Boolean Flags"
title: "Boolean Flags in argparse"
date: 2023-07-12
lastmod: 2023-07-12
draft: false
Expand Down

0 comments on commit 3a7a9d1

Please sign in to comment.