{ fzf, tmux }: '' # Highlight any files whose names start with "zsh" as sh hook global BufCreate (.*/)?\.?zsh.* %{ set-option buffer filetype sh } # Highlight files ending in .conf as ini # (Will probably be close enough) hook global BufCreate .*\.conf %{ set-option buffer filetype ini } # Highlight files ending in .html.erb as html hook global BufCreate .*\.html.erb %{ set-option buffer filetype html } # Strip trailing whitespace on save hook global BufWritePre .*(?d}} echo } define-command -docstring "import from the system clipboard" clipboard-import %{ set-register dquote %sh{pbpaste} echo -markup "{Information}imported system clipboard to register """ } define-command -docstring "export to the system clipboard" clipboard-export %{ nop %sh{ printf "%s" "$kak_main_reg_dquote" | pbcopy } echo -markup "{Information}exported register "" to system clipboard" } define-command -docstring "open a file using fzf" open %{ edit %sh{ git ls-files -oc --exclude-standard | ${fzf}/bin/fzf-tmux -r 80 --reverse } } alias global o open define-command -params 1.. -docstring "change file modes" chmod %{ nop %sh{ chmod $@ "$kak_buffile" } } declare-option str last_test define-command -docstring "intelligently run code" run %{ evaluate-commands -save-regs x %{ write nop %sh{${tmux}/bin/tmux split-window -hl 80 "$kak_buffile; read"} } } define-command mkdirp %{ nop %sh{mkdir -p "$(dirname "$kak_buffile")"} } define-command mkdirpw %{ mkdirp write } map global normal :clipboard-import map global normal :clipboard-export map global normal / /(?i) # Allow indenting from any position in the line, with the correct indentation. map global insert '' map global insert '' map -docstring "Remove Symbol hashrockets" global user \ 's:\S++=;+c:h:d' map -docstring "Convert single quotes to double quotes" global user \ %{'} %{s'r"} map -docstring "Toggle line comments" global user \ %{#} %{:comment-line} declare-user-mode bookmarks map -docstring "Edit bookmarked file" global user b \ %{:enter-user-mode bookmarks} map -docstring "wiki" global bookmarks w %{:edit-wiki-index} set-option global indentwidth 2 set-option global ui_options ncurses_assistant=none set-option global scrolloff 5,5 set-option global autoreload yes add-highlighter global/ number-lines -hlcursor -separator "│" add-highlighter global/ show-matching ''