File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 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() {
1515 [[ " $ORIGINAL_COMMAND " =~ " -S" ]]
1616}
1717
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+
1823main () {
1924 if nvim_session_file_exists; then
2025 echo " nvim -S"
@@ -23,6 +28,10 @@ main() {
2328 # session flag `-S`. This will cause an error, so we're falling back to
2429 # starting plain nvim.
2530 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()'"
2635 else
2736 echo " $ORIGINAL_COMMAND "
2837 fi
You can’t perform that action at this time.
0 commit comments