From c86b0606d34eb95deee1e2d2b6bde9c14d0238e0 Mon Sep 17 00:00:00 2001 From: js0ny Date: Mon, 7 Apr 2025 08:46:31 +0100 Subject: [PATCH] feat(key): Better qwerty switch --- common/vimrc+qwerty.vimrc | 60 ++++++++++++++++++++++++++++++++ tools/tmux/+colemak.tmux | 12 +++++++ tools/tmux/+qwerty.tmux | 12 +++++++ {common => tools/tmux}/tmux.conf | 13 ++----- 4 files changed, 87 insertions(+), 10 deletions(-) create mode 100644 common/vimrc+qwerty.vimrc create mode 100644 tools/tmux/+colemak.tmux create mode 100644 tools/tmux/+qwerty.tmux rename {common => tools/tmux}/tmux.conf (84%) diff --git a/common/vimrc+qwerty.vimrc b/common/vimrc+qwerty.vimrc new file mode 100644 index 0000000..2c7a6a2 --- /dev/null +++ b/common/vimrc+qwerty.vimrc @@ -0,0 +1,60 @@ +" $XDG_CONFIG_HOME/vim/vimrc +" This is a minimal setup of vimrc +" ln -sf $DOTFILES/.config/vim/vimrc $XDG_CONFIG_HOME/vim/vimrc + +" Colemak Keys + +" Arrow remap +nnoremap J 5j +nnoremap K 5k +vnoremap H ^ +xnoremap H ^ +onoremap H ^ +vnoremap L $ +xnoremap L $ +onoremap L $ + +" Normal minimal setup + +noremap Y y$ +set expandtab +set tabstop=4 +set shiftwidth=4 +set autoindent +set smartindent +set wrap +set scrolloff=3 +set hlsearch +set incsearch +set ignorecase +set smartcase + +set number +set relativenumber + +set laststatus=2 +set showcmd +set statusline=%<%f\ %h%m%r\ %=\ [%l,%v]\ [%p%%]\ [\ %Y]\ [󱑉\ %{strftime('%H:%M:%S')}] + + +" XDG Directory Specifications +" Reference to https://jorenar.com/blog/vim-xdg + +if empty($XDG_CACHE_HOME) | let $XDG_CACHE_HOME = $HOME."/.cache" | endif +if empty($XDG_CONFIG_HOME) | let $XDG_CONFIG_HOME = $HOME."/.config" | endif +if empty($XDG_DATA_HOME) | let $XDG_DATA_HOME = $HOME."/.local/share" | endif +if empty($XDG_STATE_HOME) | let $XDG_STATE_HOME = $HOME."/.local/state" | endif + +set viminfo+=n$XDG_STATE_HOME/vim/viminfo +set packpath^=$XDG_DATA_HOME/vim +set packpath+=$XDG_DATA_HOME/vim/after +set backupdir=$XDG_STATE_HOME/vim/backup +set directory=$XDG_STATE_HOME/vim/swap +set undodir=$XDG_STATE_HOME/vim/undo +set viewdir=$XDG_STATE_HOME/vim/view +" set shada+=n$XDG_STATE_HOME/vim/shada +" Leader +let mapleader = "\" +nnoremap :FZF +" Misc +syntax on diff --git a/tools/tmux/+colemak.tmux b/tools/tmux/+colemak.tmux new file mode 100644 index 0000000..dd6c195 --- /dev/null +++ b/tools/tmux/+colemak.tmux @@ -0,0 +1,12 @@ +# vim: ft=tmux + +bind h select-pane -L +bind n select-pane -D +bind e select-pane -U +bind i select-pane -R +bind -r H resize-pane -L 5 +bind -r N resize-pane -D 5 +bind -r E resize-pane -U 5 +bind -r I resize-pane -R 5 +bind C-h select-window -t :- +bind C-i select-window -t :+ diff --git a/tools/tmux/+qwerty.tmux b/tools/tmux/+qwerty.tmux new file mode 100644 index 0000000..64b1366 --- /dev/null +++ b/tools/tmux/+qwerty.tmux @@ -0,0 +1,12 @@ +# vim: ft=tmux + +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R +bind -r H resize-pane -L 5 +bind -r J resize-pane -D 5 +bind -r K resize-pane -U 5 +bind -r L resize-pane -R 5 +bind C-h select-window -t :- +bind C-l select-window -t :+ diff --git a/common/tmux.conf b/tools/tmux/tmux.conf similarity index 84% rename from common/tmux.conf rename to tools/tmux/tmux.conf index 53131ce..b16d669 100644 --- a/common/tmux.conf +++ b/tools/tmux/tmux.conf @@ -52,17 +52,10 @@ bind | split-window -h unbind '"' bind - split-window -v unbind % -bind h select-pane -L -bind n select-pane -D -bind e select-pane -U -bind i select-pane -R -bind -r H resize-pane -L 5 -bind -r N resize-pane -D 5 -bind -r E resize-pane -U 5 -bind -r I resize-pane -R 5 -bind C-h select-window -t :- -bind C-i select-window -t :+ bind ` resize-pane -Z +source-file ~/.config/tmux/+colemak.tmux + + # Status Bar # -----------------