# This fzf menu i tried isn't opening new windows or opening in the current window

**URL:** <https://discuss.kakoune.com/t/this-fzf-menu-i-tried-isnt-opening-new-windows-or-opening-in-the-current-window/3029>\
**Category:** Help\
**Created:** [October 22, 2026, 7:39pm UTC](https://discuss.kakoune.com/t/this-fzf-menu-i-tried-isnt-opening-new-windows-or-opening-in-the-current-window/3029 "2026-10-22T19:39:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![username53](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/username53/32/1678_2.png) [@username53](https://discuss.kakoune.com/u/username53)\
**Post date:** [October 22, 2026, 7:39pm UTC](https://discuss.kakoune.com/t/this-fzf-menu-i-tried-isnt-opening-new-windows-or-opening-in-the-current-window/3029/1 "2026-10-22T19:39:06Z")

</div>

```kak
declare-option str fzf_output "" 
declare-option str fzf_open_type "" 
define-command -docstring %|Lets you select a file with fzf then open it in a new split, window, or current buffer| \
fzf-file-open %{
	set-option global fzf_output %sh[
		fd -tf | fzf-tmux -p 60%,80% --style full --border-label "<ret> current window, alt-c new window $kak_session" --margin 1 \
--bind "alt-c:execute-silent(echo 'set-option global fzf_open_type \"new_window\"' | kak -p \"$kak_session\")+accept,\
enter:execute-silent(echo 'set-option global fzf_open_type \"current_window\"' | kak -p \"$kak_session\")+accept,\
alt-b:execute-silent(echo 'set-option global fzf_open_type \"horizontal_split\"' | kak -p \"$kak_session\")+accept,\
alt-v:execute-silent(echo 'set-option global fzf_open_type \"vertical_split\"' | kak -p \"$kak_session\")+accept"
	]
	hook -once global GlobalSetOption fzf_open_type=.* %{
            	evaluate-commands %sh{
        		if [-z "$kak_opt_fzf_output"]; then
            			printf "nop"
        		elif ["$kak_opt_fzf_open_type" = "current_window"]; then
        			printf "nop %sh{ printf \"edit \'$kak_opt_fzf_output\'\" | kak -p $kak_session}"
        		elif ["$kak_opt_fzf_open_type" = "new_window"]; then
        			printf "new %{e \'$kak_opt_fzf_output\'}"
        		elif ["$kak_opt_fzf_open_type" = "horizontal_split"]; then
        			printf "tmux-repl-horizontal 'kak -c $kak_session -e \"edit $kak_opt_fzf_output\"'"
        		elif ["$kak_opt_fzf_open_type" = "vertical_split"]; then
        			printf "tmux-repl-vertical 'kak -c $kak_session -e \"edit $kak_opt_fzf_output\"'"
        		fi
        	}
	}
}

map global user f ':fzf-file-open<ret>'

```
