Changes to the config

add helix conf
changes somes bindings so they can't be passed to the application.
This commit is contained in:
statzitz 2024-09-16 10:53:18 +02:00
parent 4201b4f102
commit 6efd411c25
4 changed files with 208 additions and 40 deletions

151
dotconfig/helix/config.toml Normal file
View file

@ -0,0 +1,151 @@
theme = "theme_transparent"
[editor]
line-number = "relative"
mouse = true
[editor.cursor-shape]
insert = "bar"
normal = "block"
[editor.file-picker]
hidden = false
[keys.normal]
# Quick iteration on config changes
C-o = ":config-open"
C-r = ":config-reload"
# Some nice Helix stuff
C-h = "select_prev_sibling"
C-j = "shrink_selection"
C-k = "expand_selection"
C-l = "select_next_sibling"
# Personal preference
o = ["open_below", "insert_mode"]
O = ["open_above", "insert_mode"]
# Muscle memory
"{" = ["goto_prev_paragraph", "collapse_selection"]
"}" = ["goto_next_paragraph", "collapse_selection"]
0 = "goto_line_start"
"$" = "goto_line_end"
"^" = "goto_first_nonwhitespace"
G = "goto_file_end"
"%" = "match_brackets"
V = ["select_mode", "extend_to_line_bounds"]
C = ["extend_to_line_end", "yank_main_selection_to_clipboard", "delete_selection", "insert_mode"]
D = ["extend_to_line_end", "yank_main_selection_to_clipboard", "delete_selection"]
S = "surround_add" # Would be nice to be able to do something after this but it isn't chainable
# Clipboards over registers ye ye
x = "delete_selection"
p = ["paste_clipboard_after", "collapse_selection"]
P = ["paste_clipboard_before", "collapse_selection"]
# Would be nice to add ya and yi, but the surround commands can't be chained
Y = ["extend_to_line_end", "yank_main_selection_to_clipboard", "collapse_selection"]
# Uncanny valley stuff, this makes w and b behave as they do Vim
w = ["move_next_word_start", "move_char_right", "collapse_selection"]
W = ["move_next_long_word_start", "move_char_right", "collapse_selection"]
e = ["move_next_word_end", "collapse_selection"]
E = ["move_next_long_word_end", "collapse_selection"]
b = ["move_prev_word_start", "collapse_selection"]
B = ["move_prev_long_word_start", "collapse_selection"]
# If you want to keep the selection-while-moving behaviour of Helix, this two lines will help a lot,
# especially if you find having text remain selected while you have switched to insert or append mode
#
# There is no real difference if you have overridden the commands bound to 'w', 'e' and 'b' like above
# But if you really want to get familiar with the Helix way of selecting-while-moving, comment the
# bindings for 'w', 'e', and 'b' out and leave the bindings for 'i' and 'a' active below. A world of difference!
i = ["insert_mode", "collapse_selection"]
a = ["append_mode", "collapse_selection"]
# Undoing the 'd' + motion commands restores the selection which is annoying
u = ["undo", "collapse_selection"]
# Escape the madness! No more fighting with the cursor! Or with multiple cursors!
esc = ["collapse_selection", "keep_primary_selection"]
# Search for word under cursor
"*" = ["move_char_right", "move_prev_word_start", "move_next_word_end", "search_selection", "search_next"]
"#" = ["move_char_right", "move_prev_word_start", "move_next_word_end", "search_selection", "search_prev"]
# Make j and k behave as they do Vim when soft-wrap is enabled
j = "move_line_down"
k = "move_line_up"
# Extend and select commands that expect a manual input can't be chained
# I've kept d[X] commands here because it's better to at least have the stuff you want to delete
# selected so that it's just a keystroke away to delete
[keys.normal.d]
d = ["extend_to_line_bounds", "yank_main_selection_to_clipboard", "delete_selection"]
t = ["extend_till_char"]
s = ["surround_delete"]
i = ["select_textobject_inner"]
a = ["select_textobject_around"]
j = ["select_mode", "extend_to_line_bounds", "extend_line_below", "yank_main_selection_to_clipboard", "delete_selection", "normal_mode"]
down = ["select_mode", "extend_to_line_bounds", "extend_line_below", "yank_main_selection_to_clipboard", "delete_selection", "normal_mode"]
k = ["select_mode", "extend_to_line_bounds", "extend_line_above", "yank_main_selection_to_clipboard", "delete_selection", "normal_mode"]
up = ["select_mode", "extend_to_line_bounds", "extend_line_above", "yank_main_selection_to_clipboard", "delete_selection", "normal_mode"]
G = ["select_mode", "extend_to_line_bounds", "goto_last_line", "extend_to_line_bounds", "yank_main_selection_to_clipboard", "delete_selection", "normal_mode"]
w = ["move_next_word_start", "yank_main_selection_to_clipboard", "delete_selection"]
W = ["move_next_long_word_start", "yank_main_selection_to_clipboard", "delete_selection"]
g = { g = ["select_mode", "extend_to_line_bounds", "goto_file_start", "extend_to_line_bounds", "yank_main_selection_to_clipboard", "delete_selection", "normal_mode"] }
[keys.normal.y]
y = ["extend_to_line_bounds", "yank_main_selection_to_clipboard", "normal_mode", "collapse_selection"]
j = ["select_mode", "extend_to_line_bounds", "extend_line_below", "yank_main_selection_to_clipboard", "collapse_selection", "normal_mode"]
down = ["select_mode", "extend_to_line_bounds", "extend_line_below", "yank_main_selection_to_clipboard", "collapse_selection", "normal_mode"]
k = ["select_mode", "extend_to_line_bounds", "extend_line_above", "yank_main_selection_to_clipboard", "collapse_selection", "normal_mode"]
up = ["select_mode", "extend_to_line_bounds", "extend_line_above", "yank_main_selection_to_clipboard", "collapse_selection", "normal_mode"]
G = ["select_mode", "extend_to_line_bounds", "goto_last_line", "extend_to_line_bounds", "yank_main_selection_to_clipboard", "collapse_selection", "normal_mode"]
w = ["move_next_word_start", "yank_main_selection_to_clipboard", "collapse_selection", "normal_mode"]
W = ["move_next_long_word_start", "yank_main_selection_to_clipboard", "collapse_selection", "normal_mode"]
g = { g = ["select_mode", "extend_to_line_bounds", "goto_file_start", "extend_to_line_bounds", "yank_main_selection_to_clipboard", "collapse_selection", "normal_mode"] }
[keys.insert]
# Escape the madness! No more fighting with the cursor! Or with multiple cursors!
esc = ["collapse_selection", "normal_mode"]
[keys.select]
# Muscle memory
"{" = ["extend_to_line_bounds", "goto_prev_paragraph"]
"}" = ["extend_to_line_bounds", "goto_next_paragraph"]
0 = "goto_line_start"
"$" = "goto_line_end"
"^" = "goto_first_nonwhitespace"
G = "goto_file_end"
D = ["extend_to_line_bounds", "delete_selection", "normal_mode"]
C = ["goto_line_start", "extend_to_line_bounds", "change_selection"]
"%" = "match_brackets"
S = "surround_add" # Basically 99% of what I use vim-surround for
u = ["switch_to_lowercase", "collapse_selection", "normal_mode"]
U = ["switch_to_uppercase", "collapse_selection", "normal_mode"]
# Visual-mode specific muscle memory
i = "select_textobject_inner"
a = "select_textobject_around"
# Some extra binds to allow us to insert/append in select mode because it's nice with multiple cursors
tab = ["insert_mode", "collapse_selection"] # tab is read by most terminal editors as "C-i"
C-a = ["append_mode", "collapse_selection"]
# Make selecting lines in visual mode behave sensibly
k = ["extend_line_up", "extend_to_line_bounds"]
j = ["extend_line_down", "extend_to_line_bounds"]
# Clipboards over registers ye ye
d = ["yank_main_selection_to_clipboard", "delete_selection"]
x = ["yank_main_selection_to_clipboard", "delete_selection"]
y = ["yank_main_selection_to_clipboard", "normal_mode", "flip_selections", "collapse_selection"]
Y = ["extend_to_line_bounds", "yank_main_selection_to_clipboard", "goto_line_start", "collapse_selection", "normal_mode"]
p = "replace_selections_with_clipboard" # No life without this
P = "paste_clipboard_before"
# Escape the madness! No more fighting with the cursor! Or with multiple cursors!
esc = ["collapse_selection", "keep_primary_selection", "normal_mode"]

View file

@ -0,0 +1,15 @@
[language-server.mylang-lsp]
command = "mylang-lsp"
[[language]]
name = "rust"
auto-format = false
[language-server.ruff]
command = "ruff-lsp"
[[language]]
name = "python"
language-servers = [ "ruff", "pylsp" ]
auto-format = true

View file

@ -0,0 +1,2 @@
inherits = "onedark"
"ui.background" = {}

View file

@ -3,76 +3,76 @@
#bind = $mainMod, C, killactive,
bind = $mainMod SHIFT, M, exit,
#bind = $mainMod, D, exec, thunar
bind = $mainMod, V, togglefloating,
bind = $mainMod, R, exec, wofi --show drun
bindp = $mainMod, V, togglefloating,
bindp = $mainMod, R, exec, wofi --show drun
#bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod SHIFT, V, togglesplit, # dwindle
bindp = $mainMod SHIFT, V, togglesplit, # dwindle
#bind = ,help, exec, eww open keyb
# My new bind
bind = $secondMod, W, exec, firefox
bind = $mainMod, RETURN, exec, alacritty
bind = $secondMod, RETURN, exec, alacritty --class floating_basic
bind = $mainMod SHIFT, A, killactive,
bindp = $mainMod, RETURN, exec, alacritty
bindp = $secondMod, RETURN, exec, alacritty --class floating_basic
bindp = $mainMod SHIFT, A, killactive,
bind = $mainMod SHIFT, R, exec, loginctl reboot
bind = $mainMod SHIFT, E, exec, loginctl poweroff
binde = ,XF86MonBrightnessUp , exec, blight set +5
binde = ,XF86MonBrightnessDown , exec, blight set -5
bind = $mainMod, F, fullscreen, 0
bind = $mainMod SHIFT, F, fullscreen, 1
bindp = $mainMod, F, fullscreen, 0
bindp = $mainMod SHIFT, F, fullscreen, 1
bind = $mainMod, M, exit,
#screenlock
bind = $secondMod, l, exec, loginctl lock-session
bindp = $secondMod, l, exec, loginctl lock-session
#bind = $mainMod SHIFT, t, exec, loginctl lock-session
#screen capture
bind = $secondMod, g, exec, grim -g "$(slurp)"
bindp = $secondMod, g, exec, grim -g "$(slurp)"
# Change volume sink
bind = ,XF86AudioLowerVolume, exec, pactl set-sink-volume $(pactl get-default-sink) -5% #alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp__sink -5%
bind = ,XF86AudioRaiseVolume, exec, pactl set-sink-volume $(pactl get-default-sink) +5% #alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp__sink +5%
bindp = ,XF86AudioLowerVolume, exec, pactl set-sink-volume $(pactl get-default-sink) -5% #alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp__sink -5%
bindp = ,XF86AudioRaiseVolume, exec, pactl set-sink-volume $(pactl get-default-sink) +5% #alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp__sink +5%
# Think of using swayOSD when solving the ma 100% problem.
# Put sink or mic toggle
bind = ,XF86AudioMute, exec, pactl set-sink-mute $(pactl get-default-sink) toggle #alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp__sink toggle
bind = ,XF86AudioMicMute, exec, pactl set-source-mute $(pactl get-default-source) toggle
bindp = ,XF86AudioMute, exec, pactl set-sink-mute $(pactl get-default-sink) toggle #alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp__sink toggle
bindp = ,XF86AudioMicMute, exec, pactl set-source-mute $(pactl get-default-source) toggle
# Change volume mic
bind = $mainMod, XF86AudioLowerVolume, exec, pactl set-source-volume $(pactl get-default-source) -5%
bind = $mainMod, XF86AudioRaiseVolume, exec, pactl set-source-volume $(pactl get-default-source) +5%
bindp = $mainMod, XF86AudioLowerVolume, exec, pactl set-source-volume $(pactl get-default-source) -5%
bindp = $mainMod, XF86AudioRaiseVolume, exec, pactl set-source-volume $(pactl get-default-source) +5%
# Switch workspaces with mainMod + [0-9]
bind = $mainMod, ampersand, workspace, 1
bind = $mainMod, eacute, workspace, 2
bind = $mainMod, quotedbl, workspace, 3
bind = $mainMod, apostrophe, workspace, 4
bind = $mainMod, parenleft, workspace, 5
bind = $mainMod, minus, workspace, 6
bind = $mainMod, egrave, workspace, 7
bind = $mainMod, underscore, workspace, 8
bind = $mainMod, ccedilla, workspace, 9
bind = $mainMod, agrave, workspace, 10
bindp = $mainMod, ampersand, workspace, 1
bindp = $mainMod, eacute, workspace, 2
bindp = $mainMod, quotedbl, workspace, 3
bindp = $mainMod, apostrophe, workspace, 4
bindp = $mainMod, parenleft, workspace, 5
bindp = $mainMod, minus, workspace, 6
bindp = $mainMod, egrave, workspace, 7
bindp = $mainMod, underscore, workspace, 8
bindp = $mainMod, ccedilla, workspace, 9
bindp = $mainMod, agrave, workspace, 10
# Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, ampersand, movetoworkspace, 1
bind = $mainMod SHIFT, eacute, movetoworkspace, 2
bind = $mainMod SHIFT, quotedbl, movetoworkspace, 3
bind = $mainMod SHIFT, apostrophe, movetoworkspace, 4
bind = $mainMod SHIFT, parenleft, movetoworkspace, 5
bind = $mainMod SHIFT, minus, movetoworkspace, 6
bind = $mainMod SHIFT, egrave, movetoworkspace, 7
bind = $mainMod SHIFT, underscore, movetoworkspace, 8
bind = $mainMod SHIFT, ccedilla, movetoworkspace, 9
bind = $mainMod SHIFT, agrave, movetoworkspace, 10
bindp = $mainMod SHIFT, ampersand, movetoworkspace, 1
bindp = $mainMod SHIFT, eacute, movetoworkspace, 2
bindp = $mainMod SHIFT, quotedbl, movetoworkspace, 3
bindp = $mainMod SHIFT, apostrophe, movetoworkspace, 4
bindp = $mainMod SHIFT, parenleft, movetoworkspace, 5
bindp = $mainMod SHIFT, minus, movetoworkspace, 6
bindp = $mainMod SHIFT, egrave, movetoworkspace, 7
bindp = $mainMod SHIFT, underscore, movetoworkspace, 8
bindp = $mainMod SHIFT, ccedilla, movetoworkspace, 9
bindp = $mainMod SHIFT, agrave, movetoworkspace, 10
# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1
bindp = $mainMod, mouse_down, workspace, e+1
bindp = $mainMod, mouse_up, workspace, e-1
# Active script to rotate screen when lid fully open.
#bindl = ,switch:Lenovo Yoga Tablet Mode Control switch,exec, rotate_screen
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
bindmp = $mainMod, mouse:272, movewindow
bindmp = $mainMod, mouse:273, resizewindow
bind = , XF86Calculator, exec, galculator