https://github.com/funnyboy-roks/vi3
A program to generate vi-style keystrokes for i3 using modes.
https://github.com/funnyboy-roks/vi3
c i3 i3-config vi vim
Last synced: about 2 months ago
JSON representation
A program to generate vi-style keystrokes for i3 using modes.
- Host: GitHub
- URL: https://github.com/funnyboy-roks/vi3
- Owner: funnyboy-roks
- Created: 2024-01-10T19:15:26.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-24T14:45:12.000Z (over 2 years ago)
- Last Synced: 2025-05-18T07:39:01.232Z (about 1 year ago)
- Topics: c, i3, i3-config, vi, vim
- Language: C
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vi3
A program to generate vi-style keystrokes for i3 using modes.
## Usage
To run the program just run `./vi3 `.
Both `input-file` and `output-file` can be substituted with `-` to use
STDIN and STDOUT respectively.
## Example
Input file:
```cfg
exit Escape
exit Ctrl+j
; volume up
v,u exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5%
; volume down
v,d exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5%
; volume mute
v,m exec exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle
```
Output:
```i3config
mode "Vim: " {
bindsym v mode "Vim: v"
bindsym Escape mode "default"
bindsym Ctrl+j mode "default"
}
mode "Vim: v" {
bindsym u exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5%; mode "default"
bindsym d exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5%; mode "default"
bindsym m exec exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle; mode "default"
bindsym Escape mode "default"
bindsym Ctrl+j mode "default"
}
```
## Building
This project uses libc and no other dependencies.
To build, just run `make` in the root directory. (or just use your C
compiler to compile the `main.c` file)