~koehr/configs

9ae4ba998bb460f4131f4e8c2450f186e9f1b595 — Norman Köhring 2 years ago 3288e52
adds foot config and updated kakoune config
A dot.config/foot/foot.ini => dot.config/foot/foot.ini +186 -0
@@ 0,0 1,186 @@
# -*- conf -*-

# shell=$SHELL (if set, otherwise user's default shell from /etc/passwd)
# term=foot (or xterm-256color if built with -Dterminfo=disabled)
# login-shell=no

# app-id=foot
# title=foot
# locked-title=no

font=Monofur Nerd Font:size=11:antialias=true:autohint=true
# font-bold=<bold variant of regular font>
# font-italic=<italic variant of regular font>
# font-bold-italic=<bold+italic variant of regular font>
# line-height=<font metrics>
# letter-spacing=0
# horizontal-letter-offset=0
# vertical-letter-offset=0
# underline-offset=<font metrics>
# box-drawings-uses-font-glyphs=no
# dpi-aware=auto

# initial-window-size-pixels=700x500  # Or,
# initial-window-size-chars=<COLSxROWS>
initial-window-mode=maximized
# pad=2x2                             # optionally append 'center'
# resize-delay-ms=100

# notify=notify-send -a ${app-id} -i ${app-id} ${title} ${body}

# bold-text-in-bright=no
# word-delimiters=,│`|:"'()[]{}<>
# selection-target=primary
# workers=<number of logical CPUs>

[bell]
# urgent=no
# notify=no
# command=
# command-focused=no

[scrollback]
# lines=1000
# multiplier=3.0
# indicator-position=relative
# indicator-format=

[url]
# launch=xdg-open ${url}
# label-letters=sadfjklewcmpgh
# osc8-underline=url-mode
# protocols=http, https, ftp, ftps, file, gemini, gopher
# uri-characters=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.,~:;/?#@!$&%*+="'()[]

[cursor]
# style=block
# color=<inverse foreground/background>
# blink=no
# beam-thickness=1.5
# underline-thickness=<font underline thickness>

[mouse]
# hide-when-typing=no
# alternate-scroll-mode=yes

[colors]
# alpha=1.0
# foreground=dcdccc
# background=111111

## Normal/regular colors (color palette 0-7)
# regular0=222222  # black
# regular1=cc9393  # red
# regular2=7f9f7f  # green
# regular3=d0bf8f  # yellow
# regular4=6ca0a3  # blue
# regular5=dc8cc3  # magenta
# regular6=93e0e3  # cyan
# regular7=dcdccc  # white

## Bright colors (color palette 8-15)
# bright0=666666   # bright black
# bright1=dca3a3   # bright red
# bright2=bfebbf   # bright green
# bright3=f0dfaf   # bright yellow
# bright4=8cd0d3   # bright blue
# bright5=fcace3   # bright magenta
# bright6=b3ffff   # bright cyan
# bright7=ffffff   # bright white

## dimmed colors (see foot.ini(5) man page)
# dim0=<not set>
# ...
# dim7=<not-set>

## The remaining 256-color palette
# 16 = <256-color palette #16>
# ...
# 255 = <256-color palette #255>

## Misc colors
# selection-foreground=<inverse foreground/background>
# selection-background=<inverse foreground/background>
# jump-labels=<regular0> <regular3>
# urls=<regular3>
# scrollback-indicator=<regular0> <bright4>

[csd]
preferred=none
# size=26
# font=<primary font>
# color=<foreground color>
# hide-when-typing=no
# border-width=0
# border-color=<csd.color>
# button-width=26
# button-color=<background color>
# button-minimize-color=<regular4>
# button-maximize-color=<regular2>
# button-close-color=<regular1>

[key-bindings]
# scrollback-up-page=Shift+Page_Up
# scrollback-up-half-page=none
# scrollback-up-line=none
# scrollback-down-page=Shift+Page_Down
# scrollback-down-half-page=none
# scrollback-down-line=none
# clipboard-copy=Control+Shift+c XF86Copy
# clipboard-paste=Control+Shift+v XF86Paste
# primary-paste=Shift+Insert
# search-start=Control+Shift+r
# font-increase=Control+plus Control+equal Control+KP_Add
# font-decrease=Control+minus Control+KP_Subtract
# font-reset=Control+0 Control+KP_0
# spawn-terminal=Control+Shift+n
# minimize=none
# maximize=none
fullscreen=F11
# pipe-visible=[sh -c "xurls | fuzzel | xargs -r firefox"] none
# pipe-scrollback=[sh -c "xurls | fuzzel | xargs -r firefox"] none
# pipe-selected=[xargs -r firefox] none
# show-urls-launch=Control+Shift+u
# show-urls-copy=none
# show-urls-persistent=none
# noop=none

[search-bindings]
# cancel=Control+g Control+c Escape
# commit=Return
# find-prev=Control+r
# find-next=Control+s
# cursor-left=Left Control+b
# cursor-left-word=Control+Left Mod1+b
# cursor-right=Right Control+f
# cursor-right-word=Control+Right Mod1+f
# cursor-home=Home Control+a
# cursor-end=End Control+e
# delete-prev=BackSpace
# delete-prev-word=Mod1+BackSpace Control+BackSpace
# delete-next=Delete
# delete-next-word=Mod1+d Control+Delete
# extend-to-word-boundary=Control+w
# extend-to-next-whitespace=Control+Shift+w
# clipboard-paste=Control+v Control+Shift+v Control+y XF86Paste
# primary-paste=Shift+Insert

[url-bindings]
# cancel=Control+g Control+c Control+d Escape
# toggle-url-visible=t

[text-bindings]
# \x03=Mod4+c  # Map Super+c -> Ctrl+c

[mouse-bindings]
# selection-override-modifiers=Shift
# primary-paste=BTN_MIDDLE
# select-begin=BTN_LEFT
# select-begin-block=Control+BTN_LEFT
# select-extend=BTN_RIGHT
# select-extend-character-wise=Control+BTN_RIGHT
# select-word=BTN_LEFT-2
# select-word-whitespace=Control+BTN_LEFT-2
# select-row=BTN_LEFT-3

# vim: ft=dosini

A dot.config/kak/filetypes.kak => dot.config/kak/filetypes.kak +23 -0
@@ 0,0 1,23 @@
hook -group markdown-highlight global WinSetOption filetype=markdown %{
    add-highlighter window/ wrap -word -width 80
    add-highlighter window/ number-lines -hlcursor -separator '		'
}
hook global WinSetOption filetype=(?!markdown).* %{
    add-highlighter window/ number-lines -hlcursor -separator '  '
}

hook global WinSetOption filetype=(javascript|ecmascript) %{
  set window formatcmd 'prettier-standard'
  #hook window BufWritePre .* format
}
hook global WinSetOption filetype=rust %{
  racer-enable-autocomplete
  set window formatcmd 'rustfmt'
  hook window BufWritePre .* format
  set buffer tabstop 4
  set buffer indentwidth 4
}
hook global WinSetOption filetype=json %{
  set window formatcmd 'jq --indent 2 .'
  hook window BufWritePre .* format
}

M dot.config/kak/kakrc => dot.config/kak/kakrc +3 -154
@@ 1,154 1,3 @@
colorscheme warm-pastel
set-option global scrolloff 5,5
set-option global incsearch true
set-option global aligntab true
set-option global ui_options ncurses_assistant=dilbert
set-option -add global ui_options ncurses_change_colors=true
set-option global grepcmd 'rg --column'
set-option global tabstop 2
set-option global indentwidth 2

# plug.kak plugin manager
source "%val{config}/plugins/plug.kak/rc/plug.kak"


plug "andreyorst/plug.kak" noload

plug "lenormf/kakoune-extra" load %{
  autodownload.kak
  fzy.kak
}

###############################################
# lsp support (https://github.com/ul/kak-lsp) #
# ...but it's not working yet                 #
###############################################

plug "ul/kak-lsp" do %{
  cargo build --release --locked
  cargo install --force --path .
} config %{
  # eval %sh{kak-lsp --kakoune -s $kak_session}
  set-option global lsp_completion_trigger "execute-keys 'h<a-h><a-k>\S[^\h\n,=;*(){}\[\]]\z<ret>'"
  set-option global lsp_diagnostic_line_error_sign '║'
  set-option global lsp_diagnostic_line_warning_sign '┊'

  define-command ne -docstring 'go to next error/warning from lsp' %{ lsp-find-error --include-warnings }
  define-command pe -docstring 'go to previous error/warning from lsp' %{ lsp-find-error --previous --include-warnings }
  define-command ee -docstring 'go to current error/warning from lsp' %{ lsp-find-error --include-warnings; lsp-find-error --previous --include-warnings }

  hook global WinSetOption filetype=(c|cpp|rust|go|javascript|typescript) %{
    map window user "l" ": enter-user-mode lsp<ret>" -docstring "LSP mode"
    set-option window lsp_auto_highlight_references true
    set-option window lsp_hover_anchor true
    set-face window DiagnosticError default+u
    set-face window DiagnosticWarning default+u
    lsp-enable-window
    lsp-auto-hover-enable
    lsp-auto-hover-insert-mode-disable
  }
  hook global WinSetOption filetype=rust %{
    set-option window lsp_server_configuration rust.clippy_preference="on"
  }
  hook global KakEnd .* lsp-exit
}

#eval %sh{kak-lsp --kakoune -s $kak_session}
#hook global WinSetOption filetype=(rust|python|go|javascript|typescript|c|cpp) %{
#  lsp-enable-window
#}

plug "TeddyDD/kakoune-wiki" config %{
  wiki_setup "/home/nk/Wiki"
}

###########################################################
# kakoune-buffers                                         #
# sets former b (word-back) to q and makes b a global key #
# for the new buffers command. I don't use macros anyway. #
###########################################################
plug 'delapouite/kakoune-buffers' config %{
  map global normal ^ q
  map global normal <a-^> Q
  map global normal q b
  map global normal Q B
  map global normal <a-q> <a-b>
  map global normal <a-Q> <a-B>
  map global normal b ': enter-buffers-mode<ret>' -docstring 'buffers'
  map global normal B ': enter-user-mode -lock buffers<ret>' -docstring 'buffers (lock)'
  hook·global·WinDisplay·.*·info-buffers
}

plug "ABuffSeagull/kakoune-vue"
plug "ABuffSeagull/kakoune-wiki"

############################################################
# replace mode                                             #
# that is one thing I missed in Kakoune: writing over text #
############################################################
plug "alexherbo2/replace.kak" noload config %{
  ## currently not working well
  # map global user r -docstring 'Replace' ': replace<ret>'
}

###########################################################
# explore files (https://github.com/alexherbo2/explore.kak)
# use fd instead of find
###########################################################
plug "alexherbo2/explore.kak" config %{
   define-command -hidden -override explore-files-recursive -params 0..1 %{
     explore-files-display "fd %sh(test $kak_opt_explore_files_show_hidden = true && echo --hidden)" %arg(1)
   }
}

# TODO: check out snippets
# plug "alexherbo2/snippets.kak" config %{
# }

# TODO: check out tagbar
# plug "andreyorst/tagbar.kak" config %{
#  set-option global tagbar_sort false
#  set-option global tagbar_size 40
#  set-option global tagbar_display_anon false
#} config %{
# if you have wrap highlighter enamled in you configuration
#  # files it's better to turn it off for tagbar, using this hook:
#  hook global WinSetOption filetype=tagbar %{
#    remove-highlighter window/wrap
#    # you can also disable rendering whitespaces here, line numbers, and
#    # matching characters
#  }
#}

# set-option global fzf_filesearch_cmd "fd '%s'"

# with inspiration from
# https://github.com/Delapouite/dotfiles/blob/master/link/kak/kakrc
set global modelinefmt %{
  %val{bufname} [%opt{filetype}]
· %val{cursor_line}:%val{cursor_char_column}
· {{context_info}} {{mode_info}}
}

hook global InsertEnd .* %{
  lint
}

# defines tabe and vsplit commands
# def -file-completion -params 1 tabe %{ tmux-terminal-window edit %arg{1} }

# spaces instead tabs
map global insert <tab> '  '

# ← system clipboard
map global user y '<a-|>xsel --input --clipboard<ret>; :echo -color Information "copied selection to X11 clipboard"<ret>' -docstring 'yank from clipboard'
map global user p '<a-!>xsel --output --clipboard<ret>' -docstring 'replace from clipboard'
map global user P '!xsel --output --clipboard<ret>' -docstring 'print from clipboard'

# → system clipboard
hook global NormalKey y|d|c %{ nop %sh{
  printf %s "$kak_reg_dquote" | xsel --input --clipboard
}}

# editorconfig support
hook global BufCreate .* %{editorconfig-load}
source "%val{config}/personalization.kak"
source "%val{config}/filetypes.kak"
source "%val{config}/plugins.kak"

A dot.config/kak/personalization.kak => dot.config/kak/personalization.kak +71 -0
@@ 0,0 1,71 @@
colorscheme warm-pastel
set-option global scrolloff 5,5
set-option global incsearch true
set-option global aligntab true
set-option global ui_options terminal_assistant=dilbert
set-option -add global ui_options terminal_change_colors=true
set-option global grepcmd 'rg --with-filename --line-number --column'
set-option global tabstop 2
set-option global indentwidth 2

# hooks to show line numbers, whitespaces and matching brackets
hook -group DefaultHighlights global WinCreate .* %{
    add-highlighter window/ show-whitespaces
    add-highlighter window/ show-matching
    add-highlighter window/ regex '\h+$' 0:default,red # highlight trailing whitepaces
    add-highlighter window/ dynregex '%reg{/}' 0:+u 1:+b
    set-face window Whitespace rgb:555555+b
}

# with inspiration from
# https://github.com/Delapouite/dotfiles/blob/master/link/kak/kakrc
set global modelinefmt %{
  %val{bufname} [%opt{filetype}]
· %val{cursor_line}:%val{cursor_char_column}
· {{context_info}} {{mode_info}}
}

#hook global InsertEnd .* %{
#  lint
#}

# spaces instead tabs
map global insert <tab> '  '

# editorconfig support
hook global BufCreate .* %{editorconfig-load}

# kak-lsp
eval %sh{kak-lsp --kakoune -s $kak_session}  # Not needed if you load it with plug.kak.
hook global WinSetOption filetype=(rust|html|css|svelte|javascript|typescript|c|cpp) %{
  lsp-enable-window
  lsp-auto-hover-enable
  lsp-auto-signature-help-enable
  set-option global lsp_hover_anchor true
  map global user l ': enter-user-mode lsp<ret>' -docstring 'lsp'
}

# theme config for kak-lsp info box
face global InfoDefault               Information
face global InfoBlock                 Information
face global InfoBlockQuote            Information
face global InfoBullet                Information
face global InfoHeader                Information
face global InfoLink                  Information
face global InfoLinkMono              Information
face global InfoMono                  Information
face global InfoRule                  Information
face global InfoDiagnosticError       Information
face global InfoDiagnosticHint        Information
face global InfoDiagnosticInformation Information
face global InfoDiagnosticWarning     Information


# Show various characters
# https://unicode-table.com
add-highlighter -override global/U+2013 regex '–' '0:green+f'
add-highlighter -override global/U+2014 regex '—' '0:green+bf'
add-highlighter -override global/math-symbols regex '[−×]' '0:cyan+f'

# Show the Unicode value under the cursor.
map -docstring 'Unicode' global user u ': echo -markup "{Information}U+%sh{printf ''%04x'' ""$kak_cursor_char_value""}"<ret>'

A dot.config/kak/plugins.kak => dot.config/kak/plugins.kak +41 -0
@@ 0,0 1,41 @@
evaluate-commands %sh{
  plugins="$kak_config/plugins"
  mkdir -p "$plugins"
  [ ! -e "$plugins/plug.kak" ] && \
  git clone -q https://github.com/andreyorst/plug.kak.git "$plugins/plug.kak"
  printf "%s\n" "source '$plugins/plug.kak/rc/plug.kak'"
}
plug "andreyorst/plug.kak" noload

###########################################################
# kakoune-buffers                                         #
# sets former b (word-back) to q and makes b a global key #
# for the new buffers command. I don't use macros anyway. #
###########################################################
plug 'delapouite/kakoune-buffers' config %{
  map global normal ^ q
  map global normal <a-^> Q
  map global normal q b
  map global normal Q B
  map global normal <a-q> <a-b>
  map global normal <a-Q> <a-B>
  map global normal b ': enter-buffers-mode<ret>' -docstring 'buffers'
  map global normal B ': enter-user-mode -lock buffers<ret>' -docstring 'buffers (lock)'
}

plug "andreyorst/kaktree" defer kaktree %{
  set-option global kaktree_double_click_duration '0.5'
  set-option global kaktree_indentation 1
  set-option global kaktree_dir_icon_open  '▾ 🗁 '
  set-option global kaktree_dir_icon_close '▸ 🗀 '
  set-option global kaktree_file_icon      '⠀⠀🖺'
  map global normal <F2> ': kaktree-toggle<ret>' -docstring 'toggle filetree'
} config %{
  hook global WinSetOption filetype=kaktree %{
    remove-highlighter buffer/numbers
    remove-highlighter buffer/matching
    remove-highlighter buffer/wrap
    remove-highlighter buffer/show-whitespaces
  }
  kaktree-enable
}