Results 1 to 3 of 3

Thread: .swp file

  1. #1
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367

    Unanswered: .swp file

    When opening a file using vi, a hidden file .<file name>.swp gets created in the current dir

    vi test -> .test.swp is created.

    If I use -n option with vi, then .swp is not created. If there a way to configure AIX/Linux to create .swp files in another location (ie. /tmp)?

  2. #2
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    Found the following: Vim Swap Files | Winterdom

    Tried on Linux:

    - created .vimrc in my current dir:

    ~> more .vimrc
    set directory=/tmp


    vi test -> test.swp got created in /tmp (not a hidden file anymore).


    Please let me know if there are any other options to redirect .swp file to another location

  3. #3
    Join Date
    Sep 2009
    Location
    Ontario
    Posts
    1,057
    Provided Answers: 1
    Well, I found out that the following does not work the way you want it to.
    Code:
    cd /tmp
    vim /home/jack/test
    creates a .test.swp in /home/jack

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •