From 9ae4ba998bb460f4131f4e8c2450f186e9f1b595 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norman=20K=C3=B6hring?= Date: Mon, 1 Aug 2022 22:59:59 +0200 Subject: [PATCH 1/4] adds foot config and updated kakoune config --- dot.config/foot/foot.ini | 186 +++++++++++++++++++++++++++++ dot.config/kak/filetypes.kak | 23 ++++ dot.config/kak/kakrc | 157 +----------------------- dot.config/kak/personalization.kak | 71 +++++++++++ dot.config/kak/plugins.kak | 41 +++++++ 5 files changed, 324 insertions(+), 154 deletions(-) create mode 100644 dot.config/foot/foot.ini create mode 100644 dot.config/kak/filetypes.kak create mode 100644 dot.config/kak/personalization.kak create mode 100644 dot.config/kak/plugins.kak diff --git a/dot.config/foot/foot.ini b/dot.config/foot/foot.ini new file mode 100644 index 0000000..bc2f4ef --- /dev/null +++ b/dot.config/foot/foot.ini @@ -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= +# font-italic= +# font-bold-italic= +# line-height= +# letter-spacing=0 +# horizontal-letter-offset=0 +# vertical-letter-offset=0 +# underline-offset= +# box-drawings-uses-font-glyphs=no +# dpi-aware=auto + +# initial-window-size-pixels=700x500 # Or, +# initial-window-size-chars= +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= + +[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= +# blink=no +# beam-thickness=1.5 +# 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= +# ... +# dim7= + +## The remaining 256-color palette +# 16 = <256-color palette #16> +# ... +# 255 = <256-color palette #255> + +## Misc colors +# selection-foreground= +# selection-background= +# jump-labels= +# urls= +# scrollback-indicator= + +[csd] +preferred=none +# size=26 +# font= +# color= +# hide-when-typing=no +# border-width=0 +# border-color= +# button-width=26 +# button-color= +# button-minimize-color= +# button-maximize-color= +# button-close-color= + +[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 diff --git a/dot.config/kak/filetypes.kak b/dot.config/kak/filetypes.kak new file mode 100644 index 0000000..821cbe8 --- /dev/null +++ b/dot.config/kak/filetypes.kak @@ -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 +} diff --git a/dot.config/kak/kakrc b/dot.config/kak/kakrc index b7f5dd0..bccda28 100644 --- a/dot.config/kak/kakrc +++ b/dot.config/kak/kakrc @@ -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\S[^\h\n,=;*(){}\[\]]\z'" - 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" -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 Q - map global normal q b - map global normal Q B - map global normal - map global normal - map global normal b ': enter-buffers-mode' -docstring 'buffers' - map global normal B ': enter-user-mode -lock buffers' -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' -} - -########################################################### -# 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 ' ' - -# ← system clipboard -map global user y 'xsel --input --clipboard; :echo -color Information "copied selection to X11 clipboard"' -docstring 'yank from clipboard' -map global user p 'xsel --output --clipboard' -docstring 'replace from clipboard' -map global user P '!xsel --output --clipboard' -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" diff --git a/dot.config/kak/personalization.kak b/dot.config/kak/personalization.kak new file mode 100644 index 0000000..601455a --- /dev/null +++ b/dot.config/kak/personalization.kak @@ -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 ' ' + +# 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' -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""}"' diff --git a/dot.config/kak/plugins.kak b/dot.config/kak/plugins.kak new file mode 100644 index 0000000..6fcef4d --- /dev/null +++ b/dot.config/kak/plugins.kak @@ -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 Q + map global normal q b + map global normal Q B + map global normal + map global normal + map global normal b ': enter-buffers-mode' -docstring 'buffers' + map global normal B ': enter-user-mode -lock buffers' -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 ': kaktree-toggle' -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 +} From b05c11d2f422e12ce40814db1d2231edc7c6507d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norman=20K=C3=B6hring?= Date: Mon, 1 Aug 2022 23:02:01 +0200 Subject: [PATCH 2/4] adds kak-lsp config --- dot.config/kak-lsp/kak-lsp.toml | 399 ++++++++++++++++++++++++++++++++ 1 file changed, 399 insertions(+) create mode 100644 dot.config/kak-lsp/kak-lsp.toml diff --git a/dot.config/kak-lsp/kak-lsp.toml b/dot.config/kak-lsp/kak-lsp.toml new file mode 100644 index 0000000..0c5c89e --- /dev/null +++ b/dot.config/kak-lsp/kak-lsp.toml @@ -0,0 +1,399 @@ +snippet_support = false +verbosity = 2 + +[server] +# exit session if no requests were received during given period in seconds +# works only in unix sockets mode (-s/--session) +# set to 0 to disable +timeout = 1800 # seconds = 30 minutes + +[language.bash] +filetypes = ["sh"] +roots = [".git", ".hg"] +command = "bash-language-server" +args = ["start"] + +[language.c_cpp] +filetypes = ["c", "cpp"] +roots = ["compile_commands.json", ".clangd", ".git", ".hg"] +command = "clangd" + +[language.crystal] +filetypes = ["crystal"] +roots = ["shard.yml"] +command = "scry" + +[language.css] +filetypes = ["css"] +roots = ["package.json", ".git", ".hg"] +command = "css-languageserver" +args = ["--stdio"] + +[language.less] +filetypes = ["less"] +roots = ["package.json", ".git", ".hg"] +command = "css-languageserver" +args = ["--stdio"] + +[language.scss] +filetypes = ["scss"] +roots = ["package.json", ".git", ".hg"] +command = "css-languageserver" +args = ["--stdio"] + +[language.d] +filetypes = ["d", "di"] +roots = [".git", "dub.sdl", "dub.json"] +command = "dls" + +[language.dart] +# start shell to find path to dart analysis server source +filetypes = ["dart"] +roots = ["pubspec.yaml", ".git", ".hg"] +command = "sh" +args = ["-c", "dart $(dirname $(command -v dart))/snapshots/analysis_server.dart.snapshot --lsp"] + +[language.elixir] +filetypes = ["elixir"] +roots = ["mix.exs"] +command = "elixir-ls" +settings_section = "elixirLS" +[language.elixir.settings.elixirLS] +# See https://github.com/elixir-lsp/elixir-ls/blob/master/apps/language_server/lib/language_server/server.ex +# dialyzerEnable = true + +[language.elm] +filetypes = ["elm"] +roots = ["elm.json"] +command = "elm-language-server" +args = ["--stdio"] +settings_section = "elmLS" +[language.elm.settings.elmLS] +# See https://github.com/elm-tooling/elm-language-server#server-settings +runtime = "node" +elmPath = "elm" +elmFormatPath = "elm-format" +elmTestPath = "elm-test" + +[language.erlang] +filetypes = ["erlang"] +# See https://github.com/erlang-ls/erlang_ls.git for more information and +# how to configure. This default config should work in most cases though. +roots = ["rebar.config", "erlang.mk", ".git", ".hg"] +command = "erlang_ls" + +[language.go] +filetypes = ["go"] +roots = ["Gopkg.toml", "go.mod", ".git", ".hg"] +command = "gopls" +settings_section = "gopls" +[language.go.settings.gopls] +# See https://github.com/golang/tools/blob/master/gopls/doc/settings.md +# "build.buildFlags" = [] + +[language.haskell] +filetypes = ["haskell"] +roots = ["Setup.hs", "stack.yaml", "*.cabal"] +command = "haskell-language-server-wrapper" +args = ["--lsp"] +settings_section = "_" +[language.haskell.settings._] +# See https://haskell-language-server.readthedocs.io/en/latest/configuration.html +# haskell.formattingProvider = "ormolu" + +[language.html] +filetypes = ["html"] +roots = ["package.json"] +command = "html-languageserver" +args = ["--stdio"] + +[language.svelte] +filetypes = ["svelte"] +roots = ["package.json"] +command = "svelteserver" +args = ["--stdio"] + +# # Commented out by default because you still need to set the paths in the JDT +# # Language Server arguments below before this can become a valid configuration. +# [language.java] +# filetypes = ["java"] +# roots = [".git", "mvnw", "gradlew"] +# command = "java" +# args = [ +# "-Declipse.application=org.eclipse.jdt.ls.core.id1", +# "-Dosgi.bundles.defaultStartLevel=4", +# "-Declipse.product=org.eclipse.jdt.ls.core.product", +# "-Dlog.level=ALL", +# "-Dfile.encoding=utf-8", +# "--add-modules=ALL-SYSTEM", +# "--add-opens", +# "java.base/java.util=ALL-UNNAMED", +# "--add-opens", +# "java.base/java.lang=ALL-UNNAMED", +# "-noverify", +# "-Xmx1G", +# "-jar", +# "/path/to/eclipse.jdt.ls/repository/plugins/org.eclipse.equinox.launcher_1.6.100.v20201223-0822.jar", +# "-configuration", +# "/path/to/eclipse.jdt.ls/repository/config_linux", +# "-data", +# "/path/to/eclipse-workspace", +# ] +# [language.java.settings] +# # See https://github.dev/eclipse/eclipse.jdt.ls +# # "java.format.insertSpaces" = true + +# [language.javascript] +# filetypes = ["javascript"] +# roots = [".flowconfig"] +# command = "flow" +# args = ["lsp"] + +[language.json] +filetypes = ["json"] +roots = ["package.json"] +command = "json-languageserver" +args = ["--stdio"] + +# Requires Julia package "LanguageServer" +# Run: `julia --project=@kak-lsp -e 'import Pkg; Pkg.add("LanguageServer")'` to install it +# Configuration adapted from https://github.com/neovim/nvim-lspconfig/blob/bcebfac7429cd8234960197dca8de1767f3ef5d3/lua/lspconfig/julials.lua +[language.julia] +filetypes = ["julia"] +roots = ["Project.toml", ".git", ".hg"] +command = "julia" +args = [ + "--startup-file=no", + "--history-file=no", + "-e", + """ + ls_install_path = joinpath(get(DEPOT_PATH, 1, joinpath(homedir(), ".julia")), "environments", "kak-lsp"); + pushfirst!(LOAD_PATH, ls_install_path); + using LanguageServer; + popfirst!(LOAD_PATH); + depot_path = get(ENV, "JULIA_DEPOT_PATH", ""); + buffer_file = ENV["kak_buffile"]; + project_path = let + dirname(something( + # 1. Check if there is an explicitly set project + Base.load_path_expand(( + p = get(ENV, "JULIA_PROJECT", nothing); + p === nothing ? nothing : isempty(p) ? nothing : p + )), + # 2. Check for Project.toml in current working directory + Base.current_project(pwd()), + # 3. Check for Project.toml from buffer's full file path excluding the file name + Base.current_project(dirname(buffer_file)), + # 4. Fallback to global environment + Base.active_project() + )) + end + server = LanguageServer.LanguageServerInstance(stdin, stdout, project_path, depot_path); + server.runlinter = true; + run(server); + """, +] +[language.julia.settings] +# See https://github.com/julia-vscode/LanguageServer.jl/blob/master/src/requests/workspace.jl +# Format options. See https://github.com/julia-vscode/DocumentFormat.jl/blob/master/src/DocumentFormat.jl +# "julia.format.indent" = 4 +# Lint options. See https://github.com/julia-vscode/StaticLint.jl/blob/master/src/linting/checks.jl +# "julia.lint.call" = true +# Other options, see https://github.com/julia-vscode/LanguageServer.jl/blob/master/src/requests/workspace.jl +# "julia.lint.run" = "true" + +[language.latex] +filetypes = ["latex"] +roots = [".git", ".hg"] +command = "texlab" +settings_section = "texlab" +[language.latex.settings.texlab] +# See https://github.com/latex-lsp/texlab/blob/master/docs/options.md +# +# Preview configuration for zathura with SyncTeX search. +# For other PDF viewers see https://github.com/latex-lsp/texlab/blob/master/docs/previewing.md +forwardSearch.executable = "zathura" +forwardSearch.args = [ + "%p", + "--synctex-forward", # Support texlab-forward-search + "%l:1:%f", + "--synctex-editor-command", # Inverse search: use Control+Left-Mouse-Button to jump to source. + """ + sh -c ' + echo " + evaluate-commands -client %opt{texlab_client} %{ + evaluate-commands -try-client %opt{jumpclient} %{ + edit -- %{input} %{line} + } + } + " | kak -p $kak_session + ' + """, +] + +[language.lua] +filetypes = ["lua"] +roots = [".git", ".hg"] +command = "lua-language-server" +[language.lua.settings.Lua] +# See https://github.com/sumneko/vscode-lua/blob/master/setting/schema.json +# diagnostics.enable = true + +[language.nim] +filetypes = ["nim"] +roots = ["*.nimble", ".git", ".hg"] +command = "nimlsp" + +[language.nix] +filetypes = ["nix"] +roots = ["flake.nix", "shell.nix", ".git", ".hg"] +command = "rnix-lsp" + +[language.ocaml] +filetypes = ["ocaml"] +roots = ["Makefile", "opam", "*.opam", "dune"] +command = "ocamllsp" + +[language.php] +filetypes = ["php"] +roots = [".htaccess", "composer.json"] +command = "intelephense" +args = ["--stdio"] +settings_section = "intelephense" +[language.php.settings] +intelephense.storagePath = "/tmp/intelephense" + +[language.python] +filetypes = ["python"] +roots = ["requirements.txt", "setup.py", ".git", ".hg"] +command = "pylsp" +settings_section = "_" +[language.python.settings._] +# See https://github.com/python-lsp/python-lsp-server#configuration +# pylsp.configurationSources = ["flake8"] + +[language.r] +filetypes = ["r"] +roots = ["DESCRIPTION", ".git", ".hg"] +command = "R" +args = ["--slave", "-e", "languageserver::run()"] + +[language.racket] +filetypes = ["racket"] +roots = ["info.rkt"] +command = "racket" +args = ["-l", "racket-langserver"] + +[language.reason] +filetypes = ["reason"] +roots = ["package.json", "Makefile", ".git", ".hg"] +command = "ocamllsp" + +[language.ruby] +filetypes = ["ruby"] +roots = ["Gemfile"] +command = "solargraph" +args = ["stdio"] +[language.ruby.settings] +# See https://github.com/castwide/solargraph/blob/master/lib/solargraph/language_server/host.rb +# "solargraph.completion" = true + +[language.rust] +filetypes = ["rust"] +roots = ["Cargo.toml"] +command = "sh" +args = [ + "-c", + """ + if path=$(rustup which rls 2>/dev/null); then + "$path" + else + rls + fi + """, +] +[language.rust.settings.rust] +# See https://github.com/rust-lang/rls#configuration +# features = [] + +# [language.rust] +# filetypes = ["rust"] +# roots = ["Cargo.toml"] +# command = "sh" +# args = [ +# "-c", +# """ +# if path=$(rustup which rust-analyzer 2>/dev/null); then +# "$path" +# else +# rust-analyzer +# fi +# """, +# ] +# settings_section = "rust-analyzer" +# [language.rust.settings.rust-analyzer] +# # See https://rust-analyzer.github.io/manual.html#configuration +# hoverActions.enable = false # kak-lsp doesn't support this at the moment +# # cargo.features = [] + +[language.terraform] +filetypes = ["terraform"] +roots = ["*.tf"] +command = "terraform-ls" +args = ["serve"] +[language.terraform.settings.terraform-ls] +# See https://github.com/hashicorp/terraform-ls/blob/main/docs/SETTINGS.md +# rootModulePaths = [] + +[language.typescript] # works for typescript as well +filetypes = ["typescript", "javascript"] +roots = ["package.json", "tsconfig.json", ".git", ".hg"] +command = "typescript-language-server" +args = ["--stdio"] + +# [language.typescript] +# filetypes = ["typescript"] +# roots = ["package.json", "tsconfig.json", ".git", ".hg"] +# command = "deno" +# args = ["lsp"] +# [language.typescript.settings.deno] +# enable = true +# lint = true + +[language.yaml] +filetypes = ["yaml"] +roots = [".git", ".hg"] +command = "yaml-language-server" +args = ["--stdio"] +[language.yaml.settings] +# See https://github.com/redhat-developer/yaml-language-server#language-server-settings +# Defaults are at https://github.com/redhat-developer/yaml-language-server/blob/master/src/yamlSettings.ts +# yaml.format.enable = true + +[language.zig] +filetypes = ["zig"] +roots = ["build.zig"] +command = "zls" + +# Semantic tokens support +# See https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_semanticTokens +# for the default list of tokens and modifiers. +# However, many language servers implement their own values. +# Make sure to check the output of `lsp-capabilities` and each server's documentation and source code as well. +# Examples: +# - TypeScript: https://github.com/microsoft/vscode-languageserver-node/blob/main/client/src/common/semanticTokens.ts +# - Rust Analyzer: https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/syntax_highlighting.rs +[semantic_tokens] +faces = [ + {face="documentation", token="comment", modifiers=["documentation"]}, + {face="comment", token="comment"}, + {face="function", token="function"}, + {face="keyword", token="keyword"}, + {face="module", token="namespace"}, + {face="operator", token="operator"}, + {face="string", token="string"}, + {face="type", token="type"}, + {face="default+d", token="variable", modifiers=["readonly"]}, + {face="default+d", token="variable", modifiers=["constant"]}, + {face="variable", token="variable"}, +] From 2add2a86388c92e2f0fd2ad6fbf1e3b4af08500f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norman=20K=C3=B6hring?= Date: Mon, 21 Nov 2022 12:48:38 +0100 Subject: [PATCH 3/4] updates kakoune config --- dot.config/kak/colors/catppuccin_mocha.kak | 83 +++++++++++++++++++++ dot.config/kak/colors/penumbra.kak | 84 ++++++++++++++++++++++ dot.config/kak/filetypes.kak | 4 -- dot.config/kak/personalization.kak | 16 +++-- dot.config/kak/plugins.kak | 14 ++++ 5 files changed, 191 insertions(+), 10 deletions(-) create mode 100644 dot.config/kak/colors/catppuccin_mocha.kak create mode 100644 dot.config/kak/colors/penumbra.kak diff --git a/dot.config/kak/colors/catppuccin_mocha.kak b/dot.config/kak/colors/catppuccin_mocha.kak new file mode 100644 index 0000000..6191160 --- /dev/null +++ b/dot.config/kak/colors/catppuccin_mocha.kak @@ -0,0 +1,83 @@ +# Catppuccin theme for Kakoune + +# Color palette +declare-option str rosewater 'rgb:f5e0dc' +declare-option str red 'rgb:f38ba8' +declare-option str mauve 'rgb:cba6f7' +declare-option str maroon 'rgb:eba0ac' +declare-option str pink 'rgb:f5c2e7' +declare-option str cyan 'rgb:74c7ec' +declare-option str yellow 'rgb:f9e2af' +declare-option str green 'rgb:a6e3a1' +declare-option str white 'rgb:cdd6f4' +declare-option str blue 'rgb:89b4fa' +declare-option str sky 'rgb:89dceb' +declare-option str lavender 'rgb:b4befe' +declare-option str black1 'rgb:181825' +declare-option str black2 'rgb:1e1e2e' +declare-option str black3 'rgb:313244' +declare-option str orange 'rgb:fab387' +declare-option str teal 'rgb:94e2d5' +declare-option str gray0 'rgb:585b70' +declare-option str gray1 'rgb:6c7086' +declare-option str bright_red %opt{red} +declare-option str bright_green %opt{green} +declare-option str bright_yellow %opt{yellow} +declare-option str bright_blue %opt{blue} +declare-option str bright_cyan %opt{cyan} +declare-option str bright_white %opt{white} +declare-option str foreground %opt{white} +declare-option str background %opt{black2} + +# Markup +set-face global title "%opt{rosewater}" +set-face global header "%opt{bright_red}" +set-face global bold "%opt{mauve}" +set-face global italic "%opt{lavender}" +set-face global mono "%opt{green}" +set-face global block "%opt{cyan}" +set-face global link "%opt{green}" +set-face global bullet "%opt{green}" +set-face global list "%opt{white}" + +# Builtins +set-face global Default "%opt{white},%opt{background}" +set-face global PrimarySelection "%opt{gray0},%opt{lavender}" +set-face global SecondarySelection "%opt{lavender},%opt{gray0}" +set-face global PrimaryCursor "%opt{background},%opt{rosewater}" +set-face global SecondaryCursor "%opt{black1},%opt{teal}" +set-face global PrimaryCursorEol "%opt{gray0},%opt{mauve}" +set-face global SecondaryCursorEol "%opt{gray0},%opt{maroon}" +set-face global LineNumbers "%opt{gray1},%opt{background}" +set-face global LineNumberCursor "%opt{lavender},%opt{gray0}+b" +set-face global LineNumbersWrapped "%opt{teal},%opt{black1}+i" +set-face global MenuForeground "%opt{white},%opt{gray0}+b" +set-face global MenuBackground "%opt{white},%opt{black3}" +set-face global MenuInfo "%opt{black1},%opt{blue}" +set-face global Information "%opt{black1},%opt{lavender}" +set-face global Error "%opt{red},%opt{black2}" +set-face global StatusLine "%opt{white},%opt{black1}" +set-face global StatusLineMode "%opt{black2},%opt{yellow}" +set-face global StatusLineInfo "%opt{background},%opt{green}" +set-face global StatusLineValue "%opt{orange},%opt{gray0}" +set-face global StatusCursor "%opt{black1},%opt{lavender}" +set-face global Prompt "%opt{green},%opt{black2}" +set-face global MatchingChar "%opt{maroon},%opt{black2}" +set-face global Whitespace "%opt{gray1},%opt{background}+f" +set-face global WrapMarker Whitespace +set-face global BufferPadding "%opt{background},%opt{background}" + +# Code +set-face global value "%opt{orange}" +set-face global type "%opt{rosewater}" +set-face global variable "%opt{white}" +set-face global module "%opt{maroon}" +set-face global function "%opt{sky}" +set-face global string "%opt{green}" +set-face global keyword "%opt{blue}" +set-face global operator "%opt{blue}" +set-face global attribute "%opt{green}" +set-face global comment "%opt{gray1}" +set-face global documentation comment +set-face global meta "%opt{pink}" +set-face global builtin "%opt{lavender}+b" diff --git a/dot.config/kak/colors/penumbra.kak b/dot.config/kak/colors/penumbra.kak new file mode 100644 index 0000000..eb45c6c --- /dev/null +++ b/dot.config/kak/colors/penumbra.kak @@ -0,0 +1,84 @@ +# Catppuccin theme for Kakoune + +# Color palette +declare-option str rosewater 'rgb:CB7459' +declare-option str red 'rgb:CA7081' +declare-option str mauve 'rgb:CA736C' +declare-option str maroon 'rgb:F2E6D4' +declare-option str pink 'rgb:BD72A8' +declare-option str cyan 'rgb:00A0BE' +declare-option str yellow 'rgb:A38F2D' +declare-option str green 'rgb:46A473' +declare-option str white 'rgb:BEBEBE' +declare-option str blue 'rgb:7E87D6' +declare-option str sky 'rgb:6E8DD5' +declare-option str lavender 'rgb:BC73A4' +declare-option str black1 'rgb:24272B' +declare-option str black2 'rgb:2F3339' +declare-option str black3 'rgb:3E4044' +declare-option str orange 'rgb:C27D40' +declare-option str teal 'rgb:00A2AF' +declare-option str gray0 'rgb:585b70' +declare-option str gray1 'rgb:6c7086' +declare-option str bright_red %opt{red} +declare-option str bright_green %opt{green} +declare-option str bright_yellow %opt{yellow} +declare-option str bright_blue %opt{blue} +declare-option str bright_cyan %opt{cyan} +declare-option str bright_white 'rgb:FFF7ED' +declare-option str foreground %opt{white} +declare-option str background %opt{black2} + +# Markup +set-face global title "%opt{rosewater}" +set-face global header "%opt{bright_red}" +set-face global bold "%opt{mauve}" +set-face global italic "%opt{lavender}" +set-face global mono "%opt{green}" +set-face global block "%opt{cyan}" +set-face global link "%opt{green}" +set-face global bullet "%opt{green}" +set-face global list "%opt{white}" + +# Builtins +set-face global Default "%opt{white},%opt{background}" +set-face global PrimarySelection "%opt{bright_white},%opt{rosewater}" +set-face global SecondarySelection "%opt{lavender},%opt{gray0}" +set-face global PrimaryCursor "%opt{background},%opt{rosewater}" +set-face global SecondaryCursor "%opt{black1},%opt{teal}" +set-face global PrimaryCursorEol "%opt{gray0},%opt{mauve}" +set-face global SecondaryCursorEol "%opt{gray0},%opt{maroon}" +set-face global LineNumbers "%opt{gray1},%opt{background}" +set-face global LineNumberCursor "%opt{rosewater},%opt{background}+b" +set-face global LineNumbersWrapped "%opt{teal},%opt{black1}+i" +set-face global MenuForeground "%opt{white},%opt{gray0}+b" +set-face global MenuBackground "%opt{white},%opt{black3}" +set-face global MenuInfo "%opt{black1},%opt{blue}" +set-face global Information "%opt{black1},%opt{blue}" +set-face global Error "%opt{red},%opt{black2}" +set-face global StatusLine "%opt{white},%opt{black1}" +set-face global StatusLineMode "%opt{black2},%opt{yellow}" +set-face global StatusLineInfo "%opt{background},%opt{green}" +set-face global StatusLineValue "%opt{orange},%opt{gray0}" +set-face global StatusCursor "%opt{black1},%opt{lavender}" +set-face global Prompt "%opt{green},%opt{black2}" +set-face global MatchingChar "%opt{maroon},%opt{black2}" +set-face global Whitespace "%opt{gray1},%opt{background}+f" +set-face global WrapMarker Whitespace +set-face global BufferPadding "%opt{background},%opt{background}" +set-face global MatchingChar "%opt{bright_white},%opt{black1}+b" + +# Code +set-face global value "%opt{orange}" +set-face global type "%opt{mauve}" +set-face global variable "%opt{white}" +set-face global module "%opt{maroon}" +set-face global function "%opt{sky}" +set-face global string "%opt{green}" +set-face global keyword "%opt{blue}" +set-face global operator "%opt{blue}" +set-face global attribute "%opt{green}" +set-face global comment "%opt{gray1}" +set-face global documentation comment +set-face global meta "%opt{pink}" +set-face global builtin "%opt{lavender}+b" diff --git a/dot.config/kak/filetypes.kak b/dot.config/kak/filetypes.kak index 821cbe8..4bc2ce8 100644 --- a/dot.config/kak/filetypes.kak +++ b/dot.config/kak/filetypes.kak @@ -6,10 +6,6 @@ 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' diff --git a/dot.config/kak/personalization.kak b/dot.config/kak/personalization.kak index 601455a..f65aa80 100644 --- a/dot.config/kak/personalization.kak +++ b/dot.config/kak/personalization.kak @@ -1,4 +1,4 @@ -colorscheme warm-pastel +colorscheme penumbra set-option global scrolloff 5,5 set-option global incsearch true set-option global aligntab true @@ -25,12 +25,16 @@ set global modelinefmt %{ · {{context_info}} {{mode_info}} } -#hook global InsertEnd .* %{ -# lint -#} - # spaces instead tabs -map global insert ' ' +hook global InsertChar \t %{ try %{ + execute-keys -draft "h\A\h+\z;%opt{indentwidth}@" +}} +hook global InsertDelete ' ' %{ try %{ + execute-keys -draft 'h\A\h+\zi' +}} + +# Bring back S-x (kind of) +map global normal X 'Jx' # editorconfig support hook global BufCreate .* %{editorconfig-load} diff --git a/dot.config/kak/plugins.kak b/dot.config/kak/plugins.kak index 6fcef4d..f2e6ace 100644 --- a/dot.config/kak/plugins.kak +++ b/dot.config/kak/plugins.kak @@ -39,3 +39,17 @@ plug "andreyorst/kaktree" defer kaktree %{ } kaktree-enable } + +plug "ABuffSeagull/kakoune-vue" + +plug "schemar/kak-jsts" config %{ + hook global WinSetOption filetype=(javascript|typescript|ecmascript) %{ + map window user l -docstring 'lint' ': lint' + map window user f -docstring 'format' ': format-prettier' + hook window BufWritePre .* %{ + evaluate-commands -no-hooks %{ + format-prettier + } + } + } +} From 9fdf6ed4a03b6479e5756012db24c173c3f927c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norman=20K=C3=B6hring?= Date: Mon, 21 Nov 2022 12:55:41 +0100 Subject: [PATCH 4/4] updates dotfiles --- dot.profile | 43 +++++++++++++------------------------------ dot.zshrc | 4 ++-- 2 files changed, 15 insertions(+), 32 deletions(-) diff --git a/dot.profile b/dot.profile index 007da2d..0135b74 100644 --- a/dot.profile +++ b/dot.profile @@ -1,43 +1,15 @@ source /etc/profile export EDITOR=kak -export GOPATH=$HOME/src/go -export CARGO_HOME=$HOME/.cargo -export PATH=$HOME/.local/bin:$HOME/.yarn/bin:$HOME/.local/share/npm-global/bin:$GOPATH/bin:$CARGO_HOME/bin:$HOME/.gem/ruby/2.7.0/bin:$PATH -export MANPATH=$HOME/.local/share/man:/usr/share/man:/usr/local/share/man - -export _JAVA_AWT_WM_NONREPARENTING=1 export FREETYPE_PROPERTIES="truetype:interpreter-version=35 cff:darkening-parameters=500,300,1000,200,1500,100,2000,0 autofitter:warping=1" export INFINALITY_FT_FILTER_PARAMS='10 35 40 35 10' - -export LD_LIBRARY_PATH=$HOME/.local/lib:$HOME/.local/lib/haxe:/lib - -alias xi="sudo xbps-install" -alias xq="xbps-query -Rs" -alias xqi="xbps-query -RS" -alias xql="xbps-query -s" -alias xqf="xbps-query -f" -alias xqo="xbps-query -o" -alias xqre="xbps-query -R --regex -s" -alias howto="howdoi -c" -alias icat="kitty +kitten icat" alias wttr="curl wttr.in" -alias df="duf" -alias du="dust" -alias md="glow -p" alias ls="lsd" alias l="lsd -lha" alias ll="lsd -lh" alias lt="lsd --tree" alias pp="bat" -# twtxt -alias ttt="txtnish tweet" -alias ttl="txtnish timeline" -alias ttf="txtnish follow" -alias ttu="txtnish unfollow" -alias ttr="txtnish reply" - short_url () { curl -F "shorten=$1" https://0x0.st } @@ -50,8 +22,19 @@ if [[ "$TTY" == "/dev/tty"* ]] then setfont drdos8x14 fi +. "$HOME/.cargo/env" + +export CARGO_HOME=$HOME/.cargo +export PNPM_HOME="$HOME/.local/share/pnpm" +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion + +export PATH=$HOME/.local/bin:$HOME/.yarn/bin:$PNPM_HOME:$GOPATH/bin:$CARGO_HOME/bin:$PATH +export MANPATH=$HOME/.local/share/man:/usr/share/man:/usr/local/share/man -if [ "$TTY" = /dev/tty1 -a $USER != root -a ! -e /tmp/.X0-lock ] +TODO="$HOME/TODO/`date '+%Y%m%d'`.todo.txt" +if [ -f "$TODO" ] then - startx && clear && exit + bat $TODO fi diff --git a/dot.zshrc b/dot.zshrc index 119837d..2f457b5 100644 --- a/dot.zshrc +++ b/dot.zshrc @@ -1,5 +1,5 @@ bindkey -v -source ~/src/pkg/zgen/zgen.zsh +source ~/pkg/zgen/zgen.zsh source ~/.zsh/kitty.compl.zsh if ! zgen saved; then @@ -26,7 +26,7 @@ ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern) ZSH_HIGHLIGHT_PATTERNS+=('rm -fr*' 'fg=white,bold,bg=red') ZSH_HIGHLIGHT_PATTERNS+=('rm -rf*' 'fg=white,bold,bg=red') -PROJECT_PATHS=(~/src/wunderdog ~/src/koehr ~/src/pkg/) +PROJECT_PATHS=(~/src/Spenoki ~/src/koehr ~/src/pkg/) # The next line updates PATH for the Google Cloud SDK. if [ -f '/home/nk/src/pkg/google-cloud-sdk/path.zsh.inc' ]; then . '/home/nk/src/pkg/google-cloud-sdk/path.zsh.inc'; fi