remove most "editor" edge cases
This commit is contained in:
parent
50dc11df7e
commit
1c0ae12c47
10
config.yaml
10
config.yaml
|
@ -9,6 +9,8 @@ variables:
|
|||
username: lelgenio
|
||||
mail: disroot.org
|
||||
cursor_size: 24
|
||||
editor: kak
|
||||
key_layout: colemak
|
||||
launcher: bmenu
|
||||
terminal: kitty
|
||||
file_manager: thunar
|
||||
|
@ -139,16 +141,8 @@ config: # {{{
|
|||
func_file:
|
||||
- funcs.py
|
||||
dynvariables:
|
||||
key_layout: |
|
||||
if test -n "$_KEYBOARD_LAYOUT"; then
|
||||
echo "$_KEYBOARD_LAYOUT"
|
||||
else
|
||||
grep lelgenio /etc/passwd &>/dev/null &&
|
||||
echo colemak || echo qwerty
|
||||
fi
|
||||
color_type: test -n "$_COLOR_TYPE" && echo "$_COLOR_TYPE" || echo dark
|
||||
accent_color_name: test -n "$_ACCENT_COLOR" && echo "$_ACCENT_COLOR" || echo red
|
||||
editor: test -n "$EDITOR" && echo "$EDITOR" || echo nvim
|
||||
blender_version: blender --version | head -n1 | sed -E 's|^Blender (.*)\..*|\1|g'
|
||||
# }}}
|
||||
dotfiles: # {{{
|
||||
|
|
|
@ -24,14 +24,6 @@
|
|||
map global normal <a-{{@@ NEW @@}}> <a-{{@@ OLD @@}}>
|
||||
{%@@ endfor @@%}
|
||||
|
||||
{%@@ for old, new in {
|
||||
"j": key.down,
|
||||
"k": key.up,
|
||||
}.items() @@%}
|
||||
map global normal <a-{{@@ new @@}}> 10{{@@ old @@}}
|
||||
map global normal <a-{{@@ new.upper() @@}}> 10{{@@ old.upper() @@}}
|
||||
{%@@ endfor @@%}
|
||||
|
||||
{%@@ if key.layout == 'colemak' @@%}
|
||||
map global normal k s
|
||||
map global normal K S
|
||||
|
|
|
@ -1,15 +1,8 @@
|
|||
{{@@ key.up @@}} back-line
|
||||
{{@@ key.down @@}} forw-line
|
||||
|
||||
|
||||
# {%@@ if editor == "kak" @@%} #
|
||||
\e{{@@ key.up @@}} back-scroll
|
||||
\e{{@@ key.down @@}} forw-scroll
|
||||
# {%@@ else @@%} #
|
||||
{{@@ key.up .upper() @@}} back-scroll
|
||||
{{@@ key.down.upper() @@}} forw-scroll
|
||||
# {%@@ endif @@%} #
|
||||
|
||||
|
||||
{{@@ key.next @@}} repeat-search
|
||||
{{@@ key.next.upper() @@}} reverse-search
|
||||
|
|
|
@ -25,14 +25,6 @@ class key:
|
|||
next = "{{@@ key.next @@}}"
|
||||
|
||||
|
||||
def edbind(k, v):
|
||||
if "{{@@ editor @@}}" == "kak":
|
||||
config.bind("<Alt-{}>".format(k), v)
|
||||
config.bind(k.upper(), "nop")
|
||||
else:
|
||||
config.bind(k.upper(), v)
|
||||
|
||||
|
||||
##########################################################
|
||||
# Usermode
|
||||
##########################################################
|
||||
|
@ -43,6 +35,7 @@ config.bind(",r", "spawn --userscript readability")
|
|||
config.bind(";e", "hint links spawn deemix '{hint-url}'")
|
||||
config.bind(";m", "hint links spawn mpv --fs {hint-url}")
|
||||
|
||||
|
||||
##########################################################
|
||||
# Layout specific
|
||||
##########################################################
|
||||
|
@ -52,8 +45,8 @@ if key_layout == "colemak":
|
|||
config.bind("t", "hint all")
|
||||
config.bind("h", "set-cmd-text -s :open")
|
||||
|
||||
edbind("T", "hint all tab")
|
||||
edbind("H", "set-cmd-text -s :open -t")
|
||||
config.bind("T".upper(), "hint all tab")
|
||||
config.bind("H".upper(), "set-cmd-text -s :open -t")
|
||||
|
||||
c.hints.chars = "arstwfuyneio"
|
||||
|
||||
|
@ -81,7 +74,8 @@ for k, v in {
|
|||
key.tabL: "tab-prev",
|
||||
key.tabR: "tab-next",
|
||||
}.items():
|
||||
edbind(k, v)
|
||||
config.bind(k.upper(), v)
|
||||
|
||||
|
||||
##########################################################
|
||||
# Insert mode
|
||||
|
@ -91,6 +85,7 @@ config.bind(key.insert, "enter-mode insert")
|
|||
|
||||
c.input.insert_mode.auto_leave = False
|
||||
|
||||
|
||||
##########################################################
|
||||
# Caret mode
|
||||
##########################################################
|
||||
|
@ -100,6 +95,7 @@ config.bind(key.up, "move-to-prev-line", mode="caret")
|
|||
config.bind(key.down, "move-to-next-line", mode="caret")
|
||||
config.bind(key.right, "move-to-next-char", mode="caret")
|
||||
|
||||
|
||||
##########################################################
|
||||
# devtools
|
||||
##########################################################
|
||||
|
|
|
@ -9,13 +9,8 @@ map {{@@ key.down @@}} scroll down
|
|||
map {{@@ key.up @@}} scroll up
|
||||
map {{@@ key.right @@}} scroll right
|
||||
|
||||
# {%@@ if editor == "kak" @@%} #
|
||||
map <A-{{@@ key.down @@}}> navigate next
|
||||
map <A-{{@@ key.up @@}}> navigate previous
|
||||
# {%@@ else @@%} #
|
||||
map {{@@ key.down.upper() @@}} navigate next
|
||||
map {{@@ key.up .upper() @@}} navigate previous
|
||||
# {%@@ endif @@%} #
|
||||
|
||||
map {{@@ key.next @@}} search forward
|
||||
map {{@@ key.next.upper() @@}} search backward
|
||||
|
|
Reference in New Issue