aboutsummaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--autoload/+init.kak33
-rw-r--r--autoload/cursor.kak13
-rw-r--r--autoload/files.kak6
-rw-r--r--autoload/filetype/justfile.kak1
-rw-r--r--autoload/formatter.kak11
-rw-r--r--autoload/git.kak2
-rw-r--r--autoload/marks.kak5
l---------autoload/plugins1
l---------autoload/standard-library2
-rw-r--r--autoload/surround.kak36
10 files changed, 54 insertions, 56 deletions
diff --git a/autoload/+init.kak b/autoload/+init.kak
index 8044ad7..5169932 100644
--- a/autoload/+init.kak
+++ b/autoload/+init.kak
@@ -1,12 +1,9 @@
# Link builtin autoloads
nop %sh{
+ rm -f "$kak_config/autoload/standard-library" || true
+ rm -f "$kak_config/autoload/plugins" || true
ln -sf "$kak_runtime/rc" "$kak_config/autoload/standard-library" 2>/dev/null || true
- # rm -rf "$kak_config/autoload/stdlib" 2>/dev/null || true
- # mkdir -p "$kak_config/autoload/stdlib" || true
- # ln -sf "$kak_runtime/rc/detection" "$kak_config/autoload/stdlib/detection" 2>/dev/null || true
- # ln -sf "$kak_runtime/rc/filetype" "$kak_config/autoload/stdlib/filetype" 2>/dev/null || true
- # ln -sf "$kak_runtime/rc/tools" "$kak_config/autoload/stdlib/tools" 2>/dev/null || true
- # ln -sf "$kak_runtime/rc/windowing" "$kak_config/autoload/stdlib/windowing" 2>/dev/null || true
+ ln -sf "$kak_runtime/autoload/plugins" "$kak_config/autoload/plugins" 2>/dev/null || true
}
# Disable indent trimming
@@ -15,12 +12,6 @@ set-option global disabled_hooks .*-trim-indent
eval %sh{kak-tree-sitter -dksvv --init "${kak_session}" --with-highlighting --with-text-objects}
eval %sh{kcr init kakoune}
-# hook global BufCreate .*[.]tsx %{
-# set-option buffer filetype tsx
-# set-option buffer tree_sitter_lang tsx
-# set-option buffer lsp_language_id typescriptreact
-# }
-
colorscheme phenax
set-option global autoreload yes
set-option global incsearch true
@@ -49,11 +40,11 @@ add-highlighter global/ regex \h+$ 0:Error # Highlight trailing whitespaces
add-highlighter global/ show-matching -previous
add-highlighter global/ show-whitespaces -spc ' ' -tab '│' -lf '¬' -indent '│'
hook global RegisterModified '/' %{
- # @todo: Highlight current searchterm
- # TODO: Highlight current searchterm
+ # Highlight search
add-highlighter -override global/search regex "%reg{/}" 0:search
}
-add-highlighter global/ regex \b(TODO|FIXME|@todo|@fixme)\b 0:default+rb
+add-highlighter global/ regex \b(TODO|FIXME)\b 0:default+rb
+add-highlighter global/ regex @(todo|fixme) 0:default+rb
# Misc keys
map global user '<esc>' ': set-register slash ""<ret>' -docstring 'Clear search highlighting'
@@ -64,16 +55,18 @@ map global normal <c-j> 15j -docstring '15 down'
map global normal <c-k> 15k -docstring '15 up'
map global user y "<a-|> xclip -selection clipboard<ret>" -docstring "yank the selection into the clipboard"
-map global user p "<a-!> xclip -selection clipboard -o<ret>" -docstring "paste the clipboard"
declare-user-mode system
map global user q ': enter-user-mode system<ret>' -docstring 'System mode'
-map global system o ':echo %opt{}<left>' -docstring 'Print opt'
-map global system v ':echo %val{}<left>' -docstring 'Print value'
+map global system o ':info %opt{}<left>' -docstring 'Print opt'
+map global system v ':info %val{}<left>' -docstring 'Print value'
map global system d ': buffer *debug*<ret>' -docstring 'Switch to debug buffer'
map global system f ':set buffer filetype ' -docstring 'Set filetype'
-map global system m ':set buffer makecmd ""<left>' -docstring 'Set compile command'
+map global system M ':set buffer makecmd ""<left>' -docstring 'Set compile command'
+map global system m ': make<ret>' -docstring 'Compile'
map global system p ': info %val{buffile}<ret>' -docstring 'Print file path'
+map global system ! ':info %sh{}<left>' -docstring 'Run command'
+map global system t ': terminal %sh{ echo "$SHELL" }<ret>' -docstring 'Open new term'
# Wrapping
set-option global autowrap_column 100
@@ -112,5 +105,5 @@ map global ai ! '!ai ""<left>' -docstring 'Insert output'
map global ai | '|ai ""<left>' -docstring 'Replace output'
# Editorconfig
-hook global WinCreate ^[^*]+$ %{editorconfig-load}
+hook global WinCreate ^[^*]+$ %{ editorconfig-load }
diff --git a/autoload/cursor.kak b/autoload/cursor.kak
index a37bb00..3274dec 100644
--- a/autoload/cursor.kak
+++ b/autoload/cursor.kak
@@ -1,16 +1,3 @@
-# declare-option -hidden regex curword
-
-# # Highlight word under cursor
-# add-highlighter global/ dynregex '%opt{curword}' 0:CurWord
-# hook global NormalIdle .* %{
-# eval -draft %{ try %{
-# exec <a-i>w<a-k>\A\w+\z<ret>
-# set-option buffer curword "\b\Q%val{selection}\E\b"
-# } catch %{
-# set-option buffer curword ''
-# } }
-# }
-
# Change cursor face based on mode
hook global ModeChange .*:.*:insert %{
set-face window PrimaryCursor InsertCursor
diff --git a/autoload/files.kak b/autoload/files.kak
index f4ebd9d..ce380ba 100644
--- a/autoload/files.kak
+++ b/autoload/files.kak
@@ -7,14 +7,14 @@ def file-manager -params .. %{
}
def findfzf %{
- terminal-singleton fzf sh -c 'kcr edit $(fd -t f --hidden --color=never -E .git | fzf --multi --min-height=100 --preview=''bat --color=always {}'')'
+ terminal-singleton fzf sh -c 'kcr edit $(fd -t f --hidden --color=never -E .git | fzf --prompt='':find '' --multi --min-height=100 --preview=''bat --color=always {}'')'
}
declare-user-mode file
map global user f ': enter-user-mode file<ret>' -docstring 'File mode'
-map global file f ': find ' -docstring 'Find files'
+map global file F ': find ' -docstring 'Find files'
map global file n ': file-manager %val{buffile}<ret>' -docstring 'File manager'
-map global file F ': findfzf<ret>' -docstring 'Fzf'
+map global file f ': findfzf<ret>' -docstring 'Fzf'
declare-user-mode buffer
map global user b ': enter-user-mode-with-count buffer<ret>' -docstring 'Buffer mode'
diff --git a/autoload/filetype/justfile.kak b/autoload/filetype/justfile.kak
new file mode 100644
index 0000000..0a28a21
--- /dev/null
+++ b/autoload/filetype/justfile.kak
@@ -0,0 +1 @@
+hook global BufCreate .*[.]just %{ set-option buffer filetype just }
diff --git a/autoload/formatter.kak b/autoload/formatter.kak
index 6b8c126..0830164 100644
--- a/autoload/formatter.kak
+++ b/autoload/formatter.kak
@@ -17,8 +17,15 @@ hook global BufSetOption filetype=(?:javascript|typescript|jsx|tsx) %{
fi
}
}
-define-command biome -docstring 'Format file on disk using biome' %{
- nop %sh{ npx biome check --fix --stdin-file-path=$kak_buffile }
+
+define-command biome-buffer -docstring 'Format buffer file on disk using biome' %{
+ biome %val{buffile}
+}
+
+define-command biome -params .. -docstring 'Format project using biome' %{
+ info %sh{
+ npx biome check --fix "$@" && echo "Success" || echo "Failed"
+ }
}
define-command apply-formatting -docstring 'Apply formatting with formatcmd or lsp' %{
diff --git a/autoload/git.kak b/autoload/git.kak
index 2befa83..0745a61 100644
--- a/autoload/git.kak
+++ b/autoload/git.kak
@@ -6,6 +6,8 @@ define-command gitui -params .. %{
gitu %arg{@}
}
+# TODO: Script to open git remote url (github/srht/gitlab/etc)
+
declare-user-mode git
declare-user-mode git-r
map global user g ': enter-user-mode git<ret>' -docstring 'Git mode'
diff --git a/autoload/marks.kak b/autoload/marks.kak
index e1f7d72..d7aea04 100644
--- a/autoload/marks.kak
+++ b/autoload/marks.kak
@@ -37,9 +37,14 @@ define-command marks-show %{
}
}
+define-command marks-edit-all %{
+ edit %sh{ "$kak_config/scripts/marks.fnl" show-path }
+}
+
declare-user-mode marks
map global user a ': enter-user-mode-with-count marks<ret>' -docstring 'Marks mode'
map global user <space> ': marks-select %val{count}<ret>' -docstring 'Select marks'
map global marks a ': marks-add %val{buffile} %opt{user_mode_count}<ret>' -docstring 'Create new mark from buffer'
map global marks d ': marks-delete %val{buffile}<ret>' -docstring 'Delete mark'
map global marks C ': marks-clear<ret>' -docstring 'Clear mark'
+map global marks e ': marks-edit-all<ret>' -docstring 'Open buffer to edit marks'
diff --git a/autoload/plugins b/autoload/plugins
new file mode 120000
index 0000000..2db5386
--- /dev/null
+++ b/autoload/plugins
@@ -0,0 +1 @@
+/nix/store/fh4r60z346kassl8iq39095kb5kf57jg-kakoune-2025.06.03/share/kak/autoload/plugins \ No newline at end of file
diff --git a/autoload/standard-library b/autoload/standard-library
index 53a840a..e13edf4 120000
--- a/autoload/standard-library
+++ b/autoload/standard-library
@@ -1 +1 @@
-/nix/store/1hf7ngjm8rs2swq2300sa7zn45cjzz9g-kakoune-2025.06.03/share/kak/rc \ No newline at end of file
+/nix/store/fh4r60z346kassl8iq39095kb5kf57jg-kakoune-2025.06.03/share/kak/rc \ No newline at end of file
diff --git a/autoload/surround.kak b/autoload/surround.kak
index 3ce248d..5c691ef 100644
--- a/autoload/surround.kak
+++ b/autoload/surround.kak
@@ -1,22 +1,24 @@
-# declare-user-mode surround
-# declare-user-mode surround-append
-# declare-user-mode surround-delete
-# map global user k ': enter-user-mode surround<ret>'
-# map global surround a ': enter-user-mode surround-append<ret>'
-# map global surround d ': enter-user-mode surround-delete<ret>'
+declare-user-mode surround
+declare-user-mode surround-append
+declare-user-mode surround-delete
+declare-user-mode surround-select
+map global user k ': enter-user-mode surround<ret>'
+map global surround a ': enter-user-mode surround-append<ret>'
+map global surround s ': enter-user-mode surround-select<ret>'
-# define-command define-surround -params 4 -docstring ': <trigger> <surrounddesc> <start> <end>' %{
-# map global surround-append %arg{1} %sh{ echo "i${3}<esc>a${4}" }
-# map global surround-delete %arg{1} %sh{ echo "<a-a>${2}<a-S>d," }
-# }
+define-command define-surround -params 4 -docstring ': <trigger> <surrounddesc> <start> <end>' %{
+ map global surround-append %arg{1} %sh{ echo "i${3}<esc>a${4}" }
+ map global surround-delete %arg{1} %sh{ echo "<a-a>${2}<a-S>d," }
+ map global surround-select %arg{1} %sh{ echo "<a-a>${2}<a-S>" }
+}
-# define-surround '(' '(' '(' ')'
-# define-surround '[' '[' '[' ']'
-# define-surround '{' '{' '{' '}'
-# define-surround '`' '`' '`' '`'
-# define-surround '"' '"' '"' '"'
-# define-surround "'" "'" "'" "'"
-# define-surround t "c<lt>div,<lt>/div<gt><ret>" "<lt>div<gt>" "<lt>/div<gt>"
+define-surround '(' '(' '(' ')'
+define-surround '[' '[' '[' ']'
+define-surround '{' '{' '{' '}'
+define-surround '`' '`' '`' '`'
+define-surround '"' '"' '"' '"'
+define-surround "'" "'" "'" "'"
+define-surround t "c<lt>div,<lt>/div<gt><ret>" "<lt>div<gt>" "<lt>/div<gt>"
# declare-option range-specs ghost_completion;