Vim Recall繁體中文

Set mouse and selection behavior

:behave

Example

Normal 0 / 2

Set mouse and selection behavior.

Mouse and selection options

selectmode
mousemodel
extend
keymodel
selection
inclusive
Before & after

Before

Mouse and selection options

selectmode
mousemodel
extend
keymodel
selection
inclusive

After

Mouse and selection options

selectmode
mouse,key
mousemodel
popup
keymodel
startsel,stopsel
selection
exclusive

Documentation-backed illustration. the initial options match :behave xterm; :behave is supported. :behave mswin changes the four options to the documented MS-Windows selection behavior. Primary help: :behave.

Sample buffer
alpha
beta
gamma
Cursor on line 1, column 1
Details & Vim help

Set mouse and selection behavior. This Ex reference uses the full command name; the alphabetical index omits arguments. Supply the ranges, arguments, flags and prerequisite state documented in the linked help. Press Enter to submit a complete command. The index spelling :be[have] puts the optional abbreviation suffix in square brackets; those brackets are not typed. Availability and exact behavior can depend on Vim build features, options, mappings and editor state; the linked help is authoritative.