#!/bin/sh
#This is a wrapper script for editing files from nnn. It checks if it nnn is running in tmux then calls the appropriate editor.

if ! { [ "$TERM" = "tmux-256color"  ] && [ -n "$TMUX"  ];  } then
# Remove option --tab for new window
	st -e vim $*
else
	# tmux session running
	vim $* #tmux -u split-window "vim \"$*\""
fi