From 9717d34743abb94d4a21679bf18d7d1d42b511da Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 4 Sep 2021 15:52:20 +0300 Subject: (2) Implemented .vim-session file creation upon pressing F1 key. Also, had to update vim alias to be a function. --- .config/terminator/config | 1 + .globalgitignore | 1 + .vimrc | 3 +++ .zshrc | 11 ++++++++++- 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.config/terminator/config b/.config/terminator/config index 3d79750..ac596ac 100644 --- a/.config/terminator/config +++ b/.config/terminator/config @@ -2,6 +2,7 @@ enabled_plugins = CommandNotify, CustomCommandsMenu, LaunchpadBugURLHandler, LaunchpadCodeURLHandler, APTURLHandler suppress_multiple_term_dialog = True [keybindings] + help = "" [profiles] [[default]] background_color = "#282828" diff --git a/.globalgitignore b/.globalgitignore index 1377554..bf345cf 100644 --- a/.globalgitignore +++ b/.globalgitignore @@ -1 +1,2 @@ *.swp +.vim-session diff --git a/.vimrc b/.vimrc index 9bfbf08..883cbab 100644 --- a/.vimrc +++ b/.vimrc @@ -148,6 +148,9 @@ nnoremap :m+1 execute "set =\ek" nnoremap :m-2 + + " Make session file + nnoremap :mksession! .vim-session " }}} " Omni complition {{{ diff --git a/.zshrc b/.zshrc index 8475a4d..fded803 100644 --- a/.zshrc +++ b/.zshrc @@ -305,7 +305,6 @@ alias lg="lazygit" alias q="exit" alias x="exit" -if [[ -x "$(command -v vimx)" ]]; then alias vim='vimx'; fi alias v="vim" alias cdg="cd ~/Programming/GitHub-repos/ && mcd" @@ -316,6 +315,16 @@ alias cds="cd ~/Programming/source/ && mcd" # Binds and alias-like functions # ------------------------------------------------------------------------------ +if [[ -x "$(command -v vimx)" ]]; then + vim () { + if [ -f ".vim-session" ] && [ -z "$1" ]; then + vimx -S .vim-session + else + vimx $@ + fi + } +fi + mexec () { for cmd in "${@[@]}"; do if ! [ -z "$cmd" ]; then -- cgit v1.2.3