Hi,
I have attached a python script file to match your requirement. Please see
the description in the header.
Note: Python feature must be enabled in your vim.
~Vishnu
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf
> Of bill lam
> Sent: Wednesday, April 08, 2009 11:47 AM
> To: vim_use
> Subject: unload buffers
>
> Suppose I open some buffers, how to unload/delete/wipe all buffers
> except the current buffer without saving other even if they had
> changed?
>
> (Thanks to John and vishnu for help on yank. This confirmed my belief
> that I must missing some vim feature if I have to resort to visual
> mode for editing just like the notepad.)
>
> --
> regards,
> ====================================================
> GPG key 1024D/4434BAB3 2008-08-24
> gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
> 唐詩166 崔塗 孤雁
> 幾行歸塞盡 片影獨何之 暮雨相呼失 寒塘欲下遲
> 渚雲低暗渡 關月冷相隨 未必逢矰繳 孤飛自可疑
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---
# Name: Vishnu (vishnube AT yahoo DOT com)
# Date: 08-Apr-2009
# Version: 1.0
# Description: This script will keep the current buffer and delete
# all other buffers (even if it is modified). Be
# carefull while using this script. Modifications will
# be discarded without *notification*
#
# Usage:
# Execute the following in command mode
# :pyfile keep-current-del-other-buffers.py
#
# Requires: Vim with python feature enabled
import vim
for bufx in vim.buffers:
if vim.current.buffer != bufx:
commandString = "bd! " + `bufx.number`
vim.command(commandString)