简体   繁体   中英

how to control the position of new buffer in vim

I write a vim plugin to get the weather info in python, I use print to print weather info, all core code are wrapped in a function Weather() . when I call this function in vim, the weather info will be showed in a new buffer under current buffer, can I control this new buffer in the left of current buffer or any other position.

If you plan to publish this plugin, you should honor the user's preferences (eg the 'splitbelow' setting), and offer a configuration variable to influence the window placement.

Generally, there are prefix commands that influence the window placement: :vertical , :leftabove , :rightbelow , :topleft , :botright . They are used like this:

:topleft new

Sometimes, it may also be necessary to first go to a particular window, :execute winnr . 'wincmd w' :execute winnr . 'wincmd w' can do this. And finally, many commands that split a new window can be passed an initial window height.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM