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