Git Product home page Git Product logo

vim-autoswap's Introduction

vim-autoswap

Please Vim, stop with these swap file messages. Just switch to the correct window!

Why autoswap?

Dealing with swap files is annoying. Most of the time you have to deal with a swap file because you either have the same file open in another window or it is a swap file left there by a previous crash.

This plugin does for you what you would do in these cases:

  1. Is file already open in another Vim session in some other window?
  2. If so, swap to the window where we are editing that file.
  3. Otherwise, if swapfile is older than file itself, just get rid of it.
  4. Otherwise, open file read-only so we can have a look at it and may save it.

Damian Conway presented this plugin at OSCON 2013 in his talk "More instantly better Vim".

The original version of this plugin (only for Mac OX) is available at http://is.gd/IBV2013, together with other plugins presented in the same talk. This version has been modified to work also on Linux systems. Both Vim and GVim are supported.

Installation

Copy the autoswap.vim file in your ~/.vim/plugin directory.

Or use pathogen and just clone the git repository:

$ cd ~/.vim/bundle
$ git clone https://github.com/gioele/vim-autoswap.git

Linux users: you must install wmctrl to be able to automatically switch to the Vim window with the open file. wmctrl is already packaged for most distributions.

KDE/Konsole users: in addition to wmctrl you must install also the vim-konsole plugin.

tmux users: if tmux is detected, autoswap can change the current pane to the one where vim is already open. tmux support is disabled by default. To enable support for tmux add let g:autoswap_detect_tmux = 1 to your .vimrc.

If you use Arch Linux you can install via the vim-autoswap-git package in the AUR. The package will install this plugin and all the needed dependencies.

Authors

Development

Code : http://svario.it/vim-autoswap (redirects to GitHub)

Report issues : http://svario.it/vim-autoswap/issues

License

This is free software released into the public domain (CC0 license).

See the COPYING.CC0 file or http://creativecommons.org/publicdomain/zero/1.0/ for more details.

vim-autoswap's People

Contributors

gioele avatar lutostag avatar has2k1 avatar m42e avatar dffischer avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.