Skip to content

Commit c465c04

Browse files
committed
Version 1.0.0
0 parents  commit c465c04

File tree

2 files changed

+145
-0
lines changed

2 files changed

+145
-0
lines changed

doc/vim-split-window-mods.txt

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
*vim-split-window-mods.txt* Simple Vim window placement splits
2+
3+
Author: Alexander Skachko <lucerion@example.com>
4+
Homepage: https://github.com/lucerion/vim-split-window-mods
5+
Version: 1.0.0 (2018-05-28)
6+
License: MIT (see vim-split-window-mods-license)
7+
8+
===============================================================================
9+
CONTENTS *vim-split-window-mods-contents*
10+
11+
Install |vim-split-window-mods-install|
12+
Commands |vim-split-window-mods-commands|
13+
Options |vim-split-window-mods-options|
14+
Changelog |vim-split-window-mods-changelog|
15+
License |vim-split-window-mods-license|
16+
17+
===============================================================================
18+
INSTALL *vim-split-window-mods-install*
19+
>
20+
mkdir -p ~/.vim/pack/lucerion/start
21+
cd ~/.vim/pack/lucerion/start
22+
git clone https://github.com/lucerion/vim-executor
23+
<
24+
===============================================================================
25+
COMMANDS *vim-split-window-mods-commands*
26+
27+
*:Tab*
28+
29+
`:Tab {command}` Executes `{command}` in a new tab. The same as
30+
`tab` window placement modifier.
31+
32+
*:Top*
33+
34+
`:Top {command}` Executes `{command}` in a new split above the current
35+
window. The same as `leftabove` window placement
36+
modifier.
37+
38+
*:Bottom*
39+
40+
`:Bottom {command}` Executes `{command}` in a new split below the current
41+
window. The same as `rightbelow` window placement
42+
modifier.
43+
44+
*:Left*
45+
46+
`:Left {command}` Executes `{command}` in a new vertical split to
47+
the left of the current window. The same
48+
`leftabove vertical` window placement modifier.
49+
50+
*:Right*
51+
52+
`:Right {command}` Executes `{command}` in a new vertical split to
53+
the right of the current window. The same as
54+
`rightbelow vertical` window placement modifier.
55+
56+
*:TopFull*
57+
58+
`:TopFull {command}` Executes `{command}` in a new split at the top of
59+
the Vim window. The same as `topleft` window
60+
placement modifier.
61+
62+
*:BottomFull*
63+
64+
`:BottomFull {command}` Executes `{command}` in a new split at the bottom of
65+
the Vim window. The same as `botright` window
66+
placement modifier.
67+
68+
*:LeftFull*
69+
70+
`:LeftFull {command}` Executes `{command}` in a new vertical split at
71+
the far left of the Vim window. The same as
72+
`topleft vertical` window placement modifier.
73+
74+
*:RightFull*
75+
76+
`:RightFull {command}` Executes `{command}` in a new vertical split at
77+
the far right of the Vim window. The same as
78+
`botright vertical` window placement modifier.
79+
80+
===============================================================================
81+
CHANGELOG *vim-split-window-mods-changelog*
82+
83+
1.0.0 (2018-05-28)~
84+
85+
First release
86+
87+
===============================================================================
88+
LICENSE *vim-split-window-mods-license*
89+
90+
Copyright © 2018, Alexander Skachko
91+
All rights reserved.
92+
93+
Permission is hereby granted, free of charge, to any person obtaining a copy
94+
of this software and associated documentation files (the "Software"), to deal
95+
in the Software without restriction, including without limitation the rights
96+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
97+
copies of the Software, and to permit persons to whom the Software is
98+
furnished to do so, subject to the following conditions:
99+
100+
The above copyright notice and this permission notice shall be included in all
101+
copies or substantial portions of the Software.
102+
103+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
104+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
105+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
106+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
107+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
108+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
109+
SOFTWARE.
110+
111+
===============================================================================
112+
vim:tw=78:ts=4:ft=help:norl:

plugin/split_window_mods.vim

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
" ==================================================================================
2+
" Description: Simple Vim window placement splits
3+
" Author: Alexander Skachko <alexander.skachko@gmail.com>
4+
" Homepage: https://github.com/lucerion/vim-split-window
5+
" Version: 1.0.0 (2018-05-28)
6+
" Licence: BSD-3-Clause
7+
" ==================================================================================
8+
9+
let s:positions = {
10+
\ 'tab': 'tab',
11+
\ 'top': 'leftabove',
12+
\ 'bottom': 'rightbelow',
13+
\ 'left': 'leftabove vertical',
14+
\ 'right': 'rightbelow vertical',
15+
\ 'top-full': 'topleft',
16+
\ 'bottom-full': 'botright',
17+
\ 'left-full': 'topleft vertical',
18+
\ 'right-full': 'botright vertical'
19+
\ }
20+
21+
func! split_window_mods#split(position, command) abort
22+
silent exec get(s:positions, a:position, '') . ' ' . a:command
23+
endfunc
24+
25+
comm! -nargs=* -complete=command Tab call split_window_mods#split('tab', <q-args>)
26+
comm! -nargs=* -complete=command Top call split_window_mods#split('top', <q-args>)
27+
comm! -nargs=* -complete=command Bottom call split_window_mods#split('bottom', <q-args>)
28+
comm! -nargs=* -complete=command Left call split_window_mods#split('left', <q-args>)
29+
comm! -nargs=* -complete=command Right call split_window_mods#split('right', <q-args>)
30+
comm! -nargs=* -complete=command TopFull call split_window_mods#split('top-full', <q-args>)
31+
comm! -nargs=* -complete=command BottomFull call split_window_mods#split('bottom-full', <q-args>)
32+
comm! -nargs=* -complete=command LeftFull call split_window_mods#split('left-full', <q-args>)
33+
comm! -nargs=* -complete=command RightFull call split_window_mods#split('right-full', <q-args>)

0 commit comments

Comments
 (0)