I like to split my vim screen in 3. one :vsplit and one :split. I want these windows and the files I worked on to be saved when I close vim. I also want these windows to aut
i use vim for projects and every project have .vim folder in root of my project. and i use startup script for vim
#!/bin/bash
if [[ $# != 1 ]]
then
zenity --title "Vim IDE usage error" --error --text "Usage: vim_ide /path/to/project/dir."
exit 1
fi
if [[ ! -e "$1/.vim/ide.vim" ]]
then
zenity --title "Vim IDE usage error" --error --text "'$1' is not a Vim IDE project directory."
exit 1
fi
cd "$1" || { zenity --title "Vim IDE usage error" --error --text "Can't change current directory to Vim IDE project directory '$1'."; exit 1; }
.vim/ide.vim
set sessionoptions-=options
au VimLeave * :mksession! .vim/ide.session
if getfsize(".vim/ide.session") >= 0
source .vim/ide.session
endif
so i start my vim by next command
$~/ide.sh /path/to/project
All my opened files, tabs and even position cursors are saved before exit and restored after start.