Add kakoune dotfiles
parent
a10609d2b0
commit
41a1181350
|
@ -1,182 +0,0 @@
|
|||
Awesome WM Copycats
|
||||
===================
|
||||
|
||||
-------------------------
|
||||
Themes for Awesome WM 4.x
|
||||
-------------------------
|
||||
|
||||
:Author: Luca CPZ
|
||||
:Version: git
|
||||
:License: BY-NC-SA_
|
||||
:Source: https://github.com/lcpz/awesome-copycats
|
||||
|
||||
Description
|
||||
===========
|
||||
|
||||
A set of themes for the Awesome_ window manager, version 4.x.
|
||||
|
||||
See branches_ for previous versions.
|
||||
|
||||
Purpose
|
||||
=======
|
||||
|
||||
The main purpose of this repository is to spread ready to use configurations, which can also serve as a cookbook for customisation.
|
||||
|
||||
A secondary aim is to add new themes only when they constitute different UI/UX designs.
|
||||
|
||||
Features
|
||||
========
|
||||
|
||||
- Modularity
|
||||
- Autohide widgets
|
||||
- Autostart windowless processes
|
||||
- Fast MPD and volume shortcuts (first time this trick has been used in Awesome)
|
||||
- Shortcuts for copying to the clipboard, toggle wiboxes, widgets popups, screenshots capture, moving and magnifying clients
|
||||
- Quake drop-down terminal
|
||||
- Calendar with current day highlighted and months switch with a click/scroll
|
||||
- Notifications for new mails, current song, volume level, hdd critical state, low battery
|
||||
- OpenWeatherMap integration
|
||||
- Net carrier status notifier
|
||||
- Symbolic tag names
|
||||
- DWM-like textual layoutbox
|
||||
- Cairo wibar
|
||||
- Custom layouts
|
||||
- No borders when there's only one visible client
|
||||
- Freedesktop.org compliant menu and desktop icons
|
||||
- Vi-like client focus
|
||||
- Non-empty tag browsing
|
||||
- On-the-fly useless gaps resize
|
||||
- Dynamic tagging
|
||||
|
||||
Gallery
|
||||
=======
|
||||
|
||||
**Multicolor**, inspired by lucamanni_
|
||||
|
||||
.. image:: http://dotshare.it/public/images/uploads/650.png
|
||||
|
||||
**Powerarrow**, porting of romockee_'s
|
||||
|
||||
.. image:: http://dotshare.it/public/images/uploads/1453.png
|
||||
|
||||
**Powerarrow Dark**
|
||||
|
||||
.. image:: http://dotshare.it/public/images/uploads/649.jpg
|
||||
|
||||
**Steamburn**, porting of ok100_'s dwm
|
||||
|
||||
.. image:: http://dotshare.it/public/images/uploads/648.png
|
||||
|
||||
**Blackburn**
|
||||
|
||||
.. image:: http://dotshare.it/public/images/uploads/553.png
|
||||
|
||||
**Dremora**
|
||||
|
||||
.. image:: http://dotshare.it/public/images/uploads/652.png
|
||||
|
||||
**Rainbow**
|
||||
|
||||
.. image:: http://dotshare.it/public/images/uploads/606.png
|
||||
|
||||
**Holo**, requested by amouly_
|
||||
|
||||
.. image:: http://dotshare.it/public/images/uploads/651.jpg
|
||||
|
||||
**Copland**, inspired by foozer_
|
||||
|
||||
.. image:: http://dotshare.it/public/images/uploads/655.png
|
||||
|
||||
**Vertex**, requested by swordfischer_
|
||||
|
||||
.. image:: http://dotshare.it/public/images/uploads/1432.jpg
|
||||
|
||||
Installation
|
||||
============
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
git clone --recurse-submodules --remote-submodules --depth 1 -j 2 https://github.com/lcpz/awesome-copycats.git
|
||||
mv -bv awesome-copycats/{*,.[^.]*} ~/.config/awesome; rm -rf awesome-copycats
|
||||
|
||||
In case you do not want the Git files, use the following as the second command:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
mv -bv awesome-copycats/* ~/.config/awesome; rm -rf awesome-copycats
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
The modular structure allows to
|
||||
|
||||
* set variables
|
||||
* define startup processes
|
||||
* change keybindings and layouts
|
||||
* set client properties
|
||||
|
||||
in ``rc.lua``, and
|
||||
|
||||
* configure widgets
|
||||
* define wiboxes and screen settings
|
||||
|
||||
in ``theme.lua``, so that you just need to change ``chosen_theme`` variable in ``rc.lua`` to preserve your preferences *and* switch the theme, instead of having file redundancy.
|
||||
|
||||
Just do the following:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
$ cd ~/.config/awesome
|
||||
$ cp rc.lua.template rc.lua
|
||||
|
||||
Then, set the variable ``chosen_theme`` in ``rc.lua`` to your preferred theme, do your settings, and restart Awesome (``Mod4 + ctrl + r``).
|
||||
|
||||
To customize a theme, head over to ``themes/$chosen_theme/theme.lua``.
|
||||
|
||||
Otherwise, if you want to be synced with upstream, modify the theme path in ``rc.lua`` like this:
|
||||
|
||||
.. code-block:: diff
|
||||
|
||||
-beautiful.init(string.format("%s/.config/awesome/themes/%s/theme.lua", os.getenv("HOME"), chosen_theme))
|
||||
+beautiful.init(string.format("%s/.config/awesome/themes/%s/theme-personal.lua", os.getenv("HOME"), chosen_theme))
|
||||
|
||||
then, copy ``theme.lua`` to ``theme-personal.lua`` and do your customizations there.
|
||||
|
||||
This way, you can safely ``git pull`` anytime.
|
||||
|
||||
Notes
|
||||
=====
|
||||
|
||||
Complements are provided by lain_ and freedesktop_. **Be sure** to satisfy their dependencies_. In particular, mail_ and weather_ widgets have **mandatory** arguments.
|
||||
|
||||
The fonts used in the screenshots are: Terminus_ (Multicolor, Powerarrow, Powerarrow Dark), Roboto_ (Holo, Vertex) and Tamzen_ (other ones).
|
||||
|
||||
As taglist font, Blackburn and Dremora use Icons_, Vertex uses FontAwesome_: be sure to have bitmaps enabled if running under Debian or Ubuntu_.
|
||||
|
||||
Every theme has a colorscheme_.
|
||||
|
||||
Additional default software used: ::
|
||||
|
||||
amixer dmenu librewolf mpc mpd scrot unclutter xbacklight xsel slock
|
||||
|
||||
.. _BY-NC-SA: http://creativecommons.org/licenses/by-nc-sa/4.0
|
||||
.. _Awesome: http://github.com/awesomeWM/awesome
|
||||
.. _branches: https://github.com/lcpz/awesome-copycats/branches
|
||||
.. _lucamanni: https://github.com/lucamanni/awesome
|
||||
.. _romockee: https://github.com/romockee/powerarrow
|
||||
.. _ok100: http://ok100.deviantart.com/art/DWM-January-2013-348656846
|
||||
.. _amouly: https://bbs.archlinux.org/viewtopic.php?pid=1307158#p1307158
|
||||
.. _swordfischer: https://github.com/lcpz/awesome-copycats/issues/53
|
||||
.. _foozer: http://dotshare.it/dots/499
|
||||
.. _lain: https://github.com/lcpz/lain
|
||||
.. _freedesktop: https://github.com/lcpz/awesome-freedesktop
|
||||
.. _Terminus: http://terminus-font.sourceforge.net
|
||||
.. _Roboto: https://fonts.google.com/specimen/Roboto
|
||||
.. _Tamzen: https://github.com/sunaku/tamzen-font
|
||||
.. _Icons: https://github.com/lcpz/dots/tree/master/.fonts
|
||||
.. _FontAwesome: https://github.com/FortAwesome/Font-Awesome
|
||||
.. _Ubuntu: https://wiki.ubuntu.com/Fonts#Enabling_Bitmapped_Fonts
|
||||
.. _colorscheme: https://github.com/lcpz/dots/tree/master/.colors
|
||||
.. _dependencies: https://github.com/lcpz/lain/wiki#dependencies
|
||||
.. _mail: https://github.com/lcpz/lain/wiki/mail
|
||||
.. _weather: https://github.com/lcpz/lain/wiki/weather
|
|
@ -0,0 +1,52 @@
|
|||
# Kakoune default color scheme
|
||||
|
||||
# For Code
|
||||
face global value red
|
||||
face global type yellow
|
||||
face global variable green
|
||||
face global module green
|
||||
face global function cyan
|
||||
face global string magenta
|
||||
face global keyword blue
|
||||
face global operator yellow
|
||||
face global attribute green
|
||||
face global comment cyan
|
||||
face global documentation comment
|
||||
face global meta magenta
|
||||
face global builtin default+b
|
||||
|
||||
# For markup
|
||||
face global title blue
|
||||
face global header cyan
|
||||
face global mono green
|
||||
face global block magenta
|
||||
face global link cyan
|
||||
face global bullet blue
|
||||
face global list yellow
|
||||
|
||||
# builtin faces
|
||||
face global Default default,default
|
||||
face global PrimarySelection black,blue+fg
|
||||
face global SecondarySelection black,rgb:9a9a9a
|
||||
face global PrimaryCursor black,blue+fg
|
||||
face global SecondaryCursor black,rgb:9a9a9a
|
||||
face global PrimaryCursorEol black,blue+fg
|
||||
face global SecondaryCursorEol black,rgb:9a9a9a
|
||||
face global LineNumbers default,default
|
||||
face global LineNumberCursor rgb:8581e0,rgb:313131
|
||||
face global MenuForeground rgb:151515,blue
|
||||
face global MenuBackground blue,rgb:151515
|
||||
face global MenuInfo blue,rgb:151515 ## was cyan
|
||||
face global Information blue,rgb:232323
|
||||
face global Error default
|
||||
face global DiagnosticError red
|
||||
face global DiagnosticWarning yellow
|
||||
face global StatusLine blue,rgb:313131
|
||||
face global StatusLineMode rgb:313131,blue
|
||||
face global StatusLineInfo blue,rgb:313131
|
||||
face global StatusLineValue blue,rgb:313131
|
||||
face global StatusCursor default+r
|
||||
face global Prompt white,default
|
||||
face global MatchingChar default,default+b
|
||||
face global Whitespace default,default+fd
|
||||
face global BufferPadding blue,default
|
|
@ -0,0 +1,486 @@
|
|||
#________ Options ___________
|
||||
# Keep status bar in the default place
|
||||
set-option -add global ui_options terminal_status_on_top=false
|
||||
|
||||
# Set an invisible padding char
|
||||
set-option -add global ui_options terminal_padding_char=
|
||||
|
||||
# Always keep two lines and two columns displayed around the cursor
|
||||
set-option global scrolloff 2,2
|
||||
|
||||
# No assistant
|
||||
set-option -add global ui_options terminal_assistant=cat
|
||||
|
||||
hook global ModuleLoaded x11 %{
|
||||
set-option global termcmd 'st -e bash -c '
|
||||
} # Set st as default terminal
|
||||
|
||||
# __________ Commands __________
|
||||
define-command -override lf-open \
|
||||
-docstring 'pick a file with lf' %{
|
||||
terminal bash -c %{
|
||||
# Local variables
|
||||
kak_buffile=$1 kak_session=$2 kak_client=$3
|
||||
|
||||
# Create temporary file for selection
|
||||
lf_tmp=$(mktemp "${TMPDIR:-/tmp}"/lf-open.XXXXXXXXXX)
|
||||
|
||||
# Get working directory of current buffer
|
||||
kak_pwd=$(dirname "${kak_buffile}")
|
||||
|
||||
# Pick a file with lf
|
||||
$(lf -selection-path "${lf_tmp}" "${kak_pwd}")
|
||||
|
||||
# Get first line of selection file (ignoring multiple selections)
|
||||
filename=$(head -n 1 "${lf_tmp}")
|
||||
|
||||
# Only echo a command back if there was a selection
|
||||
if [ -n "$filename" ]; then
|
||||
# Construct the command to pass to kakoune
|
||||
kak_cmd="evaluate-commands -client $kak_client edit $filename"
|
||||
|
||||
# Echo the command back to the parent session
|
||||
echo $kak_cmd | kak -p $kak_session
|
||||
fi
|
||||
} -- %val{buffile} %val{session} %val{client}
|
||||
}
|
||||
|
||||
define-command -override cron \
|
||||
-docstring 'edit cron services' %{
|
||||
execute-keys ': e ~/.config/cron/'
|
||||
}
|
||||
|
||||
define-command -override colorscheme-config \
|
||||
-docstring 'edit colorscheme configuration file' %{
|
||||
edit "%val{config}/autoload/colorscheme.kak"
|
||||
}
|
||||
|
||||
define-command -override config \
|
||||
-docstring 'edit kakoune main configuration file' %{
|
||||
edit "%val{config}/kakrc"
|
||||
}
|
||||
|
||||
define-command -override rss \
|
||||
-docstring 'edit rss feeds file' %{
|
||||
edit '~/.config/newsraft/feeds'
|
||||
}
|
||||
|
||||
define-command -override latin \
|
||||
-docstring 'edit latin-portuguese dictionary' %{
|
||||
edit '~/Projects/markdown/latim-portugues.md'
|
||||
}
|
||||
define-command -override remind \
|
||||
-docstring 'Edit reminders' %{
|
||||
execute-keys ': e /home/radio/.local/share/reminders/'
|
||||
}
|
||||
|
||||
define-command -override parse-latin \
|
||||
-docstring 'Parse latin text, replacing ^ for short and ~ for long' %{
|
||||
execute-keys '|sed y/ãẽĩõũ/āēīōū/<ret>'
|
||||
execute-keys '|sed y/âêîôû/ăěĭŏŭ/<ret>'
|
||||
}
|
||||
|
||||
define-command -params 1 -override tex-project \
|
||||
-docstring 'edit or create a new tex-project' %{
|
||||
evaluate-commands 'cd ~/Projects/latex/'
|
||||
nop %sh{ mkdir -p "$1" }
|
||||
evaluate-commands 'cd "%arg{1}"'
|
||||
nop %sh{
|
||||
[ -s $1.tex ] || cat ../example/example.tex \
|
||||
| sed "s/example/$1/" > "$1.tex";
|
||||
}
|
||||
edit "%arg{1}.tex"
|
||||
execute-keys '16gA<esc>'
|
||||
}
|
||||
|
||||
define-command -override open-buffer-picker \
|
||||
-docstring 'open-buffer-picker: Opens buffer picker.' %{
|
||||
prompt buffer: -buffer-completion %{ buffer %val{text} }
|
||||
}
|
||||
|
||||
define-command -override toggle-readonly \
|
||||
-docstring 'changes buffer readonly option current state' %{
|
||||
set-option buffer readonly %sh{ "$kak_opt_readonly" && echo false || echo true }
|
||||
}
|
||||
|
||||
define-command -override qalc \
|
||||
-params .. %{echo %sh{qalc ${@}}} \
|
||||
-docstring 'compute equation with Qalculate!'
|
||||
complete-command qalc shell-script-candidates %{
|
||||
{ echo $(qalc --list-functions | head -n -3)
|
||||
echo $(qalc --list-variables | head -n -3) } | tr ' ' '\n' | sort | uniq
|
||||
}
|
||||
|
||||
define-command diff-buffers -override -params 2 \
|
||||
-docstring 'show the diff of two buffers'%{
|
||||
evaluate-commands %sh{
|
||||
file1=$(mktemp)
|
||||
file2=$(mktemp)
|
||||
echo "
|
||||
evaluate-commands -buffer '$1' write -force $file1
|
||||
evaluate-commands -buffer '$2' write -force $file2
|
||||
edit! -scratch *diff-buffers*
|
||||
set buffer filetype diff
|
||||
set-register | 'diff -u $file1 $file2; rm $file1 $file2'
|
||||
execute-keys !<ret>gg
|
||||
"
|
||||
}}
|
||||
complete-command diff-buffers buffer
|
||||
|
||||
# __________ Hidden commands __________
|
||||
define-command -override -hidden edit-from-file %{
|
||||
execute-keys ":edit %sh{dirname $kak_buffile}/"
|
||||
}
|
||||
|
||||
define-command -override -hidden spawn-terminal-from-file %{
|
||||
set-register b "%sh{pwd}"
|
||||
change-directory "%sh{dirname $kak_buffile}"
|
||||
evaluate-commands 'terminal bash'
|
||||
change-directory "%reg{b}"
|
||||
} # Spawn a terminal in the current buffer's file directory
|
||||
|
||||
# __________ Mappings __________
|
||||
map global normal <c-j> ': buffer-previous<ret>'
|
||||
map global normal Y ': yank-helper<ret>u' \
|
||||
-docstring 'yank non-selections'
|
||||
|
||||
map global normal D '"ad%d"a<a-P>' \
|
||||
-docstring 'yank and delete non-selections'
|
||||
|
||||
map global normal <a-D> '"ad%<a-d>"a<a-P>' \
|
||||
-docstring 'delete non-selections (not yanking)'
|
||||
|
||||
map global user <ret> ': spawn-terminal-from-file<ret>' \
|
||||
-docstring "open a new terminal within the current file's directory"
|
||||
|
||||
map global user c ': comment-line<ret>' \
|
||||
-docstring 'comment-line'
|
||||
|
||||
map global user <a-c> ': comment-block<ret>' \
|
||||
-docstring 'comment-block'
|
||||
|
||||
map global user D '| date +"%d %b %Y %a" -f -<ret>' \
|
||||
-docstring 'parse date to 01 Feb 2001 Tue format'
|
||||
|
||||
map global user d ': lf-open<ret>' \
|
||||
-docstring 'pick a file with lf'
|
||||
|
||||
map global user e ":edit-from-file<ret>" \
|
||||
-docstring "edit a file, searching from current file's directory"
|
||||
|
||||
map global user l ': enter-user-mode lsp<ret>' \
|
||||
-docstring 'enter lsp user mode'
|
||||
|
||||
try %{ declare-user-mode open-sel }
|
||||
map global user o ': enter-user-mode open-sel<ret>' \
|
||||
-docstring 'enter open-sel user mode'
|
||||
|
||||
map global user r ': remind<ret>' \
|
||||
-docstring 'edit reminders'
|
||||
|
||||
map global user s ': enter-user-mode surround<ret>' \
|
||||
-docstring 'enter surround user mode'
|
||||
|
||||
map global user u ': echo -markup "{Information}U+%sh{printf ''%04x'' ""$kak_cursor_char_value""}"<ret>' \
|
||||
-docstring 'show the value of the selected unicode char'
|
||||
|
||||
map global user q ': delete-buffer<ret>' \
|
||||
-docstring 'delete current buffer'
|
||||
|
||||
map global user Q ': delete-buffer!<ret>' \
|
||||
-docstring 'delete current buffer'
|
||||
|
||||
map global open-sel b '$ icecat $kak_reg_dot & disown<ret>' \
|
||||
-docstring 'on browser'
|
||||
|
||||
map global open-sel m '$ mpv $kak_reg_dot & disown<ret>' \
|
||||
-docstring 'on mpv'
|
||||
|
||||
map global goto b '<a-;>: open-buffer-picker<ret>' \
|
||||
-docstring 'buffer'
|
||||
|
||||
map global normal = ': prompt math: %{exec "a %val{text}<lt>esc>|qalc -t +u8 -f -<lt>ret>"}<ret>' \
|
||||
-docstring 'Replace selection by the result of some operation over it'
|
||||
|
||||
map global object <space> 'c<space>,<space><ret>'\
|
||||
-docstring 'whitespaces'
|
||||
|
||||
try %{ declare-user-mode git }
|
||||
map global git l ': git log<ret>' -docstring 'log'
|
||||
map global git c ': git commit<ret>' -docstring 'commit'
|
||||
map global git d ': git diff<ret>' -docstring 'diff'
|
||||
map global git s ': git status<ret>' -docstring 'status'
|
||||
map global git h ': git show-diff<ret>' -docstring 'show diff'
|
||||
map global git H ': git-hide-diff<ret>' -docstring 'hide diff'
|
||||
|
||||
# try %{ declare-user-mode gdb }
|
||||
# map global gdb <ret> ': gdb-session-new-defaults<ret>' -docstring 'new session'
|
||||
# map global gdb <backspace> ': gdb-session-stop<ret>' -docstring 'stop session'
|
||||
# map global gdb r ': gdb-run<ret>' -docstring 'run'
|
||||
# map global gdb R ': gdb-cmd start<ret>' -docstring 'start'
|
||||
# map global gdb k ': gdb-cmd kill<ret>' -docstring 'kill'
|
||||
# map global gdb s ': gdb-step<ret>' -docstring 'step'
|
||||
# map global gdb n ': gdb-next<ret>' -docstring 'next line'
|
||||
# map global gdb f ': gdb-finish<ret>' -docstring 'finish'
|
||||
# map global gdb c ': gdb-continue<ret>' -docstring 'continue' # swap with C?
|
||||
# map global gdb C ': gdb-continue-or-run<ret>' -docstring 'continue/run'
|
||||
# map global gdb j ': gdb-jump-to-location<ret>' -docstring 'jump to IP'
|
||||
# map global gdb J ': gdb-toggle-autojump<ret>' -docstring 'toggle autojump'
|
||||
# map global gdb b ': gdb-toggle-breakpoint<ret>' -docstring 'toggle breakpoint'
|
||||
# map global gdb p ': gdb-print<ret>' -docstring 'print selection expression'
|
||||
# map global gdb t ': gdb-backtrace<ret>' -docstring 'backtrace'
|
||||
# map global gdb <up> ': gdb-backtrace-up<ret>' -docstring 'backtrace ↑'
|
||||
# map global gdb <down> ': gdb-backtrace-down<ret>' -docstring 'backtrace ↓'
|
||||
# map global gdb : ':gdb-cmd ' -docstring 'custom command' # ?
|
||||
# map global gdb <space> ': gdb-to-cursor<ret>' -docstring 'to cursor'
|
||||
# map global gdb m ': gdb-cmd kill; make<ret>' -docstring 'kill and make' # ?
|
||||
|
||||
# __________ Hooks __________
|
||||
hook -group config global BufCreate 'kakrc' %{
|
||||
set-option buffer filetype kak
|
||||
} # Set kakrc's filetype to kak
|
||||
|
||||
hook -group config global BufCreate '.*\.(bash_profile|profile|bashrc|bash_aliases)' %{
|
||||
set-option buffer filetype sh
|
||||
} # Set bash configuration file's filetype to sh
|
||||
|
||||
hook global BufCreate '\*scratch\*' %{
|
||||
execute-keys '%<a-d>'
|
||||
} # Remove the *scratch* message
|
||||
|
||||
hook global BufCreate .* %{
|
||||
add-highlighter buffer/ number-lines -relative -hlcursor
|
||||
} # Set relative line numbers and visual line break
|
||||
|
||||
hook global BufWritePost "%val{config}/kakrc" %{
|
||||
source "%val{config}/kakrc"
|
||||
} # Source kakrc on save
|
||||
|
||||
hook global BufOpenFile '.*\.clj' %{
|
||||
terminal bash -c "cd $(dirname $kak_buffile); lein repl"
|
||||
} # Set defaults for clojure coding
|
||||
|
||||
hook global BufWritePost "%val{config}/autoload/colorscheme.kak" %{
|
||||
source "%val{config}/autoload/colorscheme.kak"
|
||||
evaluate-commands palette-gutter
|
||||
} # Automatically source colorscheme.kak on save
|
||||
|
||||
hook global BufOpenFile "%val{config}/autoload/colorscheme.kak" %{
|
||||
evaluate-commands palette-gutter
|
||||
} # Display faces in the colorscheme file
|
||||
|
||||
hook global BufOpenFile .* %{
|
||||
add-highlighter buffer/ wrap -indent -word -marker '↩'
|
||||
add-highlighter buffer/ show-whitespaces -tab '→'
|
||||
} # Set highlighters for file buffers
|
||||
|
||||
hook global BufCreate '\*scratch\*' %{
|
||||
add-highlighter buffer/ wrap -indent -word -marker '↩'
|
||||
add-highlighter buffer/ show-whitespaces -tab '→'
|
||||
} # Set highlighters for scratch buffers
|
||||
|
||||
hook global InsertCompletionShow .* %{
|
||||
map window insert <tab> <c-n>
|
||||
map window insert <s-tab> <c-p>
|
||||
}
|
||||
hook global InsertCompletionHide .* %{
|
||||
map window insert <tab> <c-n>
|
||||
map window insert <s-tab> <c-p>
|
||||
} # Use tab for completion movement
|
||||
|
||||
hook global BufWritePost ".*[.](tex)" %{
|
||||
evaluate-commands texlab-build
|
||||
} # Build tex-projects on save
|
||||
|
||||
hook -group config global BufSetOption filetype=kak %{
|
||||
set-option buffer indentwidth 2
|
||||
set-option buffer line_comment_token '#'
|
||||
} # Kakscript comment tokens
|
||||
|
||||
hook -group config global BufSetOption filetype=scheme %{
|
||||
#map buffer normal '<c-e>' ': echo %sh{ guile -c "(display $kak_reg_dot)" }<ret>'
|
||||
set-option buffer indentwidth 2
|
||||
set-option buffer line_comment_token ';;'
|
||||
set-option buffer block_comment_tokens '#|' '|#'
|
||||
evaluate-commands 'rainbow-enable'
|
||||
} # Guile Scheme
|
||||
|
||||
hook -group config global BufSetOption filetype=clojure %{
|
||||
set-option buffer indentwidth 2
|
||||
set-option window formatcmd 'zprint'
|
||||
set-option window lintcmd 'clj-kondo'
|
||||
set-option buffer line_comment_t
|
||||
set-option buffer block_comment_tokens '(comment' ')'
|
||||
evaluate-commands 'rainbow-enable'
|
||||
} # Clojure comment tokens
|
||||
|
||||
hook -group config global BufSetOption filetype=(c|cpp) %{
|
||||
set-option window formatcmd 'clazy'
|
||||
set-option buffer line_comment_token '//'
|
||||
set-option buffer block_comment_tokens '/*' '*/'
|
||||
} # C and C++ comment tokens
|
||||
|
||||
hook -group config global BufSetOption filetype=python %{
|
||||
set-option buffer line_comment_token '#'
|
||||
set-option buffer block_comment_tokens '"""' '"""'
|
||||
} # Python comment token tokens
|
||||
|
||||
hook -group config global BufSetOption filetype=lua %{
|
||||
set-option buffer line_comment_token '--'
|
||||
set-option buffer block_comment_tokens '[[--' '--]]'
|
||||
} # Lua comment tokens
|
||||
|
||||
hook -group config global BufSetOption filetype=(sh|bash) %{
|
||||
set-option window formatcmd 'shfmt'
|
||||
set-option window lintcmd 'shellharden'
|
||||
set-option buffer line_comment_token '#'
|
||||
set-option buffer block_comment_tokens "<<'####'" '###'
|
||||
} # Shell comment tokens
|
||||
|
||||
hook -group config global BufSetOption filetype=zig %{
|
||||
set-option buffer line_comment_token '//'
|
||||
} # Zig comment tokens
|
||||
|
||||
#hook global BufWritePre "/home/radio/Projects/Markdown/latim-portugues.md" %{
|
||||
# execute-keys '"aZ' # Save registers
|
||||
# execute-keys '%s`[a-zA-ZâêîôûãẽĩõũÂÊÎÔÛÃẼĨÕŨ]+`<ret>' # Select latin text
|
||||
# evaluate-commands 'parse-latin' # Mark properly longs and shorts
|
||||
# execute-keys '"az' # Restore registers
|
||||
# evaluate-commands 'echo'
|
||||
#} # Use proper signaling for longs and shorts in latin
|
||||
|
||||
hook global BufOpenFile "/home/radio/Projects/markdown/latim-portugues.md" %{
|
||||
hook buffer InsertKey '<ret>' %{
|
||||
execute-keys '<esc>"bZ' # Save registers
|
||||
execute-keys 'kx' # Select entered line
|
||||
execute-keys 's`[a-zA-Z ,âêîôûãẽĩõũÂÊÎÔÛÃẼĨÕŨ]+`<ret>' # Select latin text
|
||||
evaluate-commands 'parse-latin' # Mark properly longs and shorts
|
||||
execute-keys '|par<ret>' # Format line properly
|
||||
execute-keys '"bzi' # Restore registers and return to insert mode
|
||||
evaluate-commands 'echo'
|
||||
}
|
||||
}
|
||||
|
||||
hook global WinSetOption filetype=kak %{
|
||||
hook global NormalIdle .* %{
|
||||
evaluate-commands -save-regs 'a' %{ try %{
|
||||
execute-keys -draft <a-i>w"ay
|
||||
evaluate-commands %sh{ (
|
||||
color="${kak_reg_a}"
|
||||
inverted_color=$(echo "${color}" | perl -pe 'tr/0123456789abcdefABCDEF/fedcba9876543210543210/')
|
||||
printf "%s\n" "evaluate-commands -client $kak_client %{ try %{
|
||||
echo -markup %{{rgb:${inverted_color},rgb:${color}+b} #${color} }
|
||||
}}" | kak -p $kak_session
|
||||
) >/dev/null 2>&1 </dev/null & }
|
||||
}}
|
||||
}}
|
||||
|
||||
# __________ Plugins __________
|
||||
source "%val{config}/plugins/plug.kak/rc/plug.kak"
|
||||
plug "andreyorst/plug.kak" noload # Manually installed plugin manager
|
||||
|
||||
# CONFIGURE THIS
|
||||
plug "occivink/kakoune-phantom-selection" # Work on multiple selections, one at a time
|
||||
|
||||
plug "alexherbo2/surround.kak" # Easily surround selections with parentesis or quotes
|
||||
|
||||
plug "https://gitlab.com/Screwtapello/kakoune-texinfo" # Read info pages inside kakoune
|
||||
|
||||
plug "https://gitlab.com/Screwtapello/kakoune-state-save" config %{
|
||||
hook global KakBegin .* %{
|
||||
evaluate-commands 'state-save-reg-load colon'
|
||||
evaluate-commands 'state-save-reg-load pipe'
|
||||
evaluate-commands 'state-save-reg-load slash'
|
||||
}
|
||||
|
||||
hook global KakEnd .* %{
|
||||
evaluate-commands 'state-save-reg-save colon'
|
||||
evaluate-commands 'state-save-reg-save pipe'
|
||||
evaluate-commands 'state-save-reg-save slash'
|
||||
}
|
||||
} # Save and restore state between sessions
|
||||
|
||||
plug 'delapouite/kakoune-buffers' # Ease navigation between opened buffers.
|
||||
|
||||
plug "NNBnh/coderun.kak" # Run files from within kakoune
|
||||
|
||||
plug "enricozb/wiki.kak" # Preview and interact with markdown
|
||||
|
||||
#plug "https://gitlab.com/john_t/org.kak/" # Org mode for kakoune
|
||||
|
||||
plug "https://gitlab.com/datensenke/prolog.kak/" # Prolog syntax highlight
|
||||
|
||||
plug "https://gitlab.com/Screwtapello/kakoune-texinfo.git" # TexInfo
|
||||
|
||||
#plug "alexherbo2/tmux.kak" # Tmux integration
|
||||
|
||||
plug "TeddyDD/kakoune-lf" # lf integration
|
||||
|
||||
plug "jpcornwell/kakoune-sokoban" # Sokoban because yes
|
||||
|
||||
plug "lePerdu/kakboard" config %{
|
||||
hook global WinCreate .* %{ kakboard-enable }
|
||||
} # Sync clipboards
|
||||
|
||||
plug "gspia/csv.kak" config %{
|
||||
set-option global csv_sep ';'
|
||||
set-option global csv_colors "blue rgb:f1f1f1 blue rgb:f1f1f1 blue rgb:f1f1f1 blue"
|
||||
} # Colorful csv files
|
||||
|
||||
plug "JJK96/kakoune-rainbow"
|
||||
set-option global rainbow_opening "[{[(]"
|
||||
declare-option str-list rainbow_faces "rgb:a790d3" "rgb:6cdae0" "rgb:ff7f50" \
|
||||
"rgb:ffea8c" "rgb:83dcaf" "rgb:eba4d4" \
|
||||
"rgb:8b5be7"
|
||||
#Add coloring to matching parenthesis
|
||||
|
||||
plug "alexherbo2/auto-pairs.kak" config %{
|
||||
set-option global auto_pairs ( ) { } [ ] '"' '"' "'" "'" ` ` “ ” ‘ ’ « » ‹ ›
|
||||
evaluate-commands enable-auto-pairs
|
||||
} # Auto-pairing of characters
|
||||
|
||||
plug "Delapouite/kakoune-palette" config %{
|
||||
hook global BufOpenFile .*colorscheme.kak %{
|
||||
evaluate-commands palette-gutter
|
||||
}
|
||||
} # Preview face colors in kakoune
|
||||
|
||||
plug "kak-lsp/kak-lsp" do %{
|
||||
cargo install --locked --force --path .
|
||||
# optional: if you want to use specific language servers
|
||||
mkdir -p ~/.config/kak-lsp
|
||||
cp -n kak-lsp.toml ~/.config/kak-lsp/
|
||||
} # Language server protocol
|
||||
|
||||
#plug 'delapouite/kakoune-text-objects' %{
|
||||
# map global selectors 's' ': if-cursor s s<ret>'
|
||||
# -docstring 'auto-percent s'
|
||||
# map global selectors 'p' ': if-cursor S S<ret>'
|
||||
# -docstring 'auto-percent S'
|
||||
# map global selectors '<ret>' ': if-cursor <lt>a-s> <lt>a-s> no-hooks<ret>'
|
||||
# -docstring 'auto-percent <a-s>'
|
||||
# map global selectors 'm' ': if-cursor <lt>a-S> <lt>a-S> no-hooks<ret>'
|
||||
# -docstring 'auto-percent <a-S>'
|
||||
# map global selectors 'f' ': if-cursor <lt>a-s><lt>a-k> <lt>a-k><ret>'
|
||||
# -docstring 'auto-percent <a-k>'
|
||||
# map global selectors 'r' ': if-cursor <lt>a-s><lt>a-K> <lt>a-K><ret>'
|
||||
# -docstring 'auto-percent <a-K>'
|
||||
# map global selectors 'v' ': select-view<ret>'
|
||||
# -docstring 'select view'
|
||||
# map global normal s ': enter-user-mode selectors<ret>'
|
||||
# -docstring 'selectors'
|
||||
#} # Add text objects to kakoune
|
||||
|
||||
# __________ LSP __________
|
||||
hook global BufSetOption filetype=(c|clojure|cpp|crystal|css|haskell|html|js|json|lua|python|scheme|sh|sql|latex|zig) %{
|
||||
add-highlighter buffer/ column 80 StatusLine
|
||||
}
|
||||
|
||||
hook global BufSetOption filetype=(c|clojure|cpp|crystal|css|haskell|html|js|json|lua|python|sh|latex|zig) %{
|
||||
evaluate-commands lsp-enable
|
||||
}
|
||||
|
||||
# Latex
|
||||
set-option -add global lsp_server_configuration texlab.build.onSave=true
|
||||
set-option -add global lsp_server_configuration texlab.build.forwardSearchAfter=true
|
||||
set-option -add global lsp_server_configuration texlab.build.args=["-pdf","-new-viewer-","-pdflatex\=pdflatex","-silent","-shell-escape","%f"]
|
|
@ -0,0 +1,10 @@
|
|||
(define-module (radix files kakoune)
|
||||
#:use-module (gnu)
|
||||
#:export (config colorscheme))
|
||||
|
||||
(define config
|
||||
(local-file "../../../files/kak/kakrc"))
|
||||
|
||||
(define colorscheme
|
||||
(local-file "../../../files/kak/autoload/colorscheme.kak"))
|
||||
|
Loading…
Reference in New Issue