Browse Source

Improve vims() docstring

Most notably, add example of Vim configuration needed for the function
to work.
Alois Mahdal 7 years ago
parent
commit
81ba59fc1f
1 changed files with 18 additions and 4 deletions
  1. 18
    4
      dotfiles/bash/main.bashrc

+ 18
- 4
dotfiles/bash/main.bashrc View File

@@ -115,14 +115,28 @@ strip_colors() {
115 115
 
116 116
 vims() {
117 117
     #
118
-    # Show "abandoned" Vim .swp files in a nice table
118
+    # List Vim .swp files in a nice table
119 119
     #
120
-    # Call this after crash or poweroff to get back and recover
121
-    # files open before the fact.  Example:
120
+    # **Note:** For this ro work, you need to set up Vim to
121
+    # use same swap directory as assigned below.  this can
122
+    # be achieved by addoing section such as this to your
123
+    # .vimrc:
124
+    #
125
+    #     if isdirectory($HOME . '/.local/share/vim') == 0
126
+    #       :silent !mkdir -p ~/.vim/swap >/dev/null 2>&1
127
+    #     endif
128
+    #     set directory=./.vim-swap//
129
+    #     set directory+=~/.local/share/vim/swap//
130
+    #     set directory+=~/tmp//
131
+    #     set directory+=.
132
+    #
133
+    # Call this after crash or poweroff to remind yourself what
134
+    # files you were editing before fact.  Example:
122 135
     #
123 136
     #     2015-07-10 06:10:48.603953758 +0200 ~/TODO.todo
124 137
     #
125
-    # Depends on .swp settings defined in my mydots repo.
138
+    # This should make it easier to recover after a little
139
+    # disaster.
126 140
     #
127 141
     local swap="$HOME/.local/share/vim/swap"
128 142
     find "$swap" -type f -print0 \