focus.vim


Ⅰ. 插件描述

A Vim plugin that removes clutter and makes working on a widescreen monitor enjoyable.

Ⅱ. 基本信息

创建日期:  2012-09-27
使用用户:  22
Github星:  33
插件作者:  Merlin Rebrović

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'merlinrebrovic/focus-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'merlinrebrovic/focus-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'merlinrebrovic/focus-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/merlinrebrovic/focus.vim

Ⅳ. 文档说明

Focus.vim

Focus mode is a state where you are focusing on one thing and one thing only.
This is what this plugin does for you.

No matter the initial layout of your Vim session, once you activate focus mode
all buffers except for the current one will be closed. Also, the only remaining
buffer will be centered in your Vim window so you can have it in the center of
your viewing area. When you exit focus mode all your previously opened buffers
will be restored for you along with their corresponding windows.

Screenshots

Animated gif of the extension

Requirements

No requirements (except Vim of course). This is a stand-alone plugin with no
outside dependencies.

Installation

  1. [Vundle]
    Add the following line to your .vimrc:
    Bundle "merlinrebrovic/focus.vim"

After this just source your .vimrc and run :BundleInstall inside Vim.

  1. [Pathogen]
    Copy or clone this repository to .vim/bundle folder

(vimfiles\bundle on Windows).

  1. Manually
    Copy focus.vim script to .vim/plugin folder (vimfiles\plugin on

Windows).

Configuration

By default the plugin maps the <leader>fmt combination for toggling the focus

  1. You can set your own combination by adding the following lines in your .vimrc:

    let g:focus_use_default_mapping = 0
    nmap key_combination <Plug>FocusModeToggle

Be sure to use nmap instead of noremap as we are counting on the result
being remapped here. This is to prevent the plugin leaking stuff into the
global namespace as much as possible.

You can set the desired width of the focused buffer while in focus mode. There
are several ways to do this in order of priority:

  1. If the textwidth Vim option is set, it will be used.
  2. If it's not set, you can set g:focusmode_width variable at any time before
    entering the focus mode and Focus.vim will use that. If used regularly,

put it in your .vimrc file. For example:

    let g:focusmode_width = 72
  1. If the previous values were not set, the default value (80) is used.

License

Copyright (c) Merlin Rebrović. Distributed under the [MIT license].

Created by Merlin Rebrović and Zoran Meliš

Contributors:

  • [ict]
  • [joshtch]

添加新评论