Skip to content
This repository has been archived by the owner on Jun 15, 2021. It is now read-only.

Move to a vim like config #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ serde = "1.0.89"
serde_derive = "1.0"
serde_json = "1.0"
termion = "1.5.1"
toml = "0.5.0"

[dependencies.clap]
features = ["suggestions", "color", "wrap_help"]
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Vim used by 80% of users.

## Configuration

All the keybinding presented below can be overriden via the `keyboard.toml`
configuration file. You can find an [example of keyboard.toml config](./resources/keyboard.toml)
All the keybinding presented below can be overriden via the `keyboard.vim`
configuration file. You can find an [example of keyboard.toml config](./resources/keyboard.vim)
which will overrid all the default values with the exact same values.

Those configuration files should live inside a `vixi` folder placed into the
Expand Down
63 changes: 0 additions & 63 deletions resources/keyboard.toml

This file was deleted.

70 changes: 70 additions & 0 deletions resources/keyboard.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
" This is a sample of vixi keyboard configuration.
"
" It redefine all the default configurations with the same values. This
" content should be set into:
" - Linux => /etc/vixi/keyboard.vim or ~/.config/vixi/keyboard.vim
" - Windows => C:\Users\Alice\AppData\vixi\keyboard.vim
" - MacOS => /Users/Alice/Library/Preferences/vixi/keyboard.vim
"
"
" The configuration format is: {cmd} {lhs} {rhs}
" where:
" {cmd} is one of 'map', 'nmap', 'vmap', 'imap'
" {lhs} left hand side, is a sequence of one or more keys that you will use
" in your new shortcut.
" {rhs} right hand side, is the sequence of keys that the {lhs} shortcut keys
" will execute when entered. A shortcut starting with ':' indicate a
" command.
"
"
" {cmd} defines the mode in which you keymap will be available:
"
" | Command | Modes |
" |:-------:|:--------------:|
" | map | Normal, Visual |
" | nmap | Normal |
" | vmap | Visual |
" | imap | Insert |


" Leader key definition
set leader <Space>

" List of key available the Normal and Visual mode
map <Esc> :switch_to_normal_mode
map <Up> :move_up
map <Down> :move_down
map <Left> :move_left
map <Right> :move_right
map <PageUp> :page_up
map <PageDown> :page_down
map <Leader>q :quit
map <Leader>w :write_to_file

" Normal mode
nmap h :move_left
nmap j :move_down
nmap k :move_up
nmap l :move_right
nmap i :switch_to_insert_mode
nmap v :switch_to_visual_mode
nmap p :paste
nmap o :open_line_below
nmap O :open_line_above

" Visual mode
vmap <Esc> :switch_to_normal_mode
vmap y :yank_selection
vmap d :delete_selection
vmap p :past

" Insert mode mode
imap <Del> :delete_forward
imap <BS> :delete_backward
imap <Esc> :switch_to_normal_mode
imap <Up> :move_up
imap <Down> :move_down
imap <Left> :move_left
imap <Right> :move_right
imap <PageUp> :page_up
imap <PageDown> :page_down
136 changes: 0 additions & 136 deletions src/input_controller/actions/mod.rs

This file was deleted.

Loading