File tree 1 file changed +9
-0
lines changed
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,11 @@ original_command_contains_session_flag() {
15
15
[[ " $ORIGINAL_COMMAND " =~ " -S" ]]
16
16
}
17
17
18
+ persistence_nvim_plugin_exists () {
19
+ nvim --headless -c ' lua if not pcall(require, "persistence") then os.exit(1) end' -c ' qa'
20
+ [ $? -ne 1 ]
21
+ }
22
+
18
23
main () {
19
24
if nvim_session_file_exists; then
20
25
echo " nvim -S"
@@ -23,6 +28,10 @@ main() {
23
28
# session flag `-S`. This will cause an error, so we're falling back to
24
29
# starting plain nvim.
25
30
echo " nvim"
31
+ elif persistence_nvim_plugin_exists; then
32
+ # Load folke's persistence.nvim sessions. And Shoutout to ThePrimeagen and TjDevries.
33
+ # Also Shoutout to my favorite youtuber Mr. Hussein Nasser because I'm learning a lot from you.
34
+ echo " nvim -c 'lua require(\" persistence\" ).load()'"
26
35
else
27
36
echo " $ORIGINAL_COMMAND "
28
37
fi
You can’t perform that action at this time.
0 commit comments