aboutsummaryrefslogtreecommitdiff
path: root/modules/base/fish/functions/k.fish
diff options
context:
space:
mode:
authorKatharina Fey <kookie@spacekookie.de>2019-10-05 22:10:04 +0000
committerKatharina Fey <kookie@spacekookie.de>2019-10-05 22:10:04 +0000
commitf700d4b0404169f7e4beab940890a53de4cb79ba (patch)
tree9b0286f1dbb5515eafd178040282db60e0d26054 /modules/base/fish/functions/k.fish
parentc04d9504fa2ae8f447ef05a1e7ddb3b21ed06af9 (diff)
Adding nix and base modules
Diffstat (limited to 'modules/base/fish/functions/k.fish')
-rw-r--r--modules/base/fish/functions/k.fish18
1 files changed, 18 insertions, 0 deletions
diff --git a/modules/base/fish/functions/k.fish b/modules/base/fish/functions/k.fish
new file mode 100644
index 00000000000..55b43ad5107
--- /dev/null
+++ b/modules/base/fish/functions/k.fish
@@ -0,0 +1,18 @@
+# Spawn a kak daemon in a project directory and fuzzy open a file
+function k --description='Open kakoune via fzf'
+ # Select a file with `fzf`
+ set file (__kakoune_get_file_list | fzf --height=25 --reverse)
+
+ # Open the file
+ __kakoune $file
+end
+
+function ksm --description "Open a file at an exact line of code"
+ set file (sk --ansi -c 'rg --color=always --line-number "{}"')
+ set entry (echo $file | sed 's/\(\:[0-9]*\).*/\1/' | tr ':' ' ')
+
+ echo $entry
+
+ # Then open the file!
+ __kakoune $entry
+end