-
Notifications
You must be signed in to change notification settings - Fork 4
/
vim-editerm.txt
116 lines (89 loc) · 4.47 KB
/
vim-editerm.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
*vim-editerm* Plugin sets $EDITOR using parent vim in :terminal
==============================================================================
CONTENTS *vim-editerm-contents*
- Introduction |vim-editerm-introduction|
- Install |vim-editerm-install|
- Commands |vim-editerm-commands|
- Cq |:Cq| |:CQ|
- Shell Functions |vim-editerm-shell-functions|
- Options |vim-editerm-options|
- g:editerm_opener |g:editerm_opener|
- g:editerm_defdrop |g:editerm_defdrop|
- g:editerm_defdrop_prefix |g:editerm_defdrop_prefix|
- License |vim-editerm-license|
==============================================================================
INTRODUCTION *vim-editerm-introduction*
Usually, calling `git commit`, `vim` and suchlike commands in |:terminal|,
new vim process starts in their.
But it makes some unfavorable situation depending on the settings.
This plugin, *vim-editerm* will set an environment varialble `$EDITOR` and
override `vim` command with function that drops files in new buffer in parent
vim.
==============================================================================
INSTALL *vim-editerm-install*
Below is a sample using vim-plug >
Plug 'kyoh86/vim-editerm'
<
*vim-editerm-shell-init*
And if you want to override `vim` and create commands `:edit|new|vnew|tabnew`
in `:terminal`, put below lines in `.zshrc` or `.bashrc`. >
if [[ "${VIM_EDITERM_SETUP}" != "" ]]; then
source "${VIM_EDITERM_SETUP}"
fi
<
==============================================================================
COMMANDS *vim-editerm-commands*
Cq *:Cq* *:CQ*
This commands will be respond error to commands calling `$EDITOR`.
e.g. To stop committing by `git commit`.
==============================================================================
SHELL FUNCTIONS *vim-editerm-shell-functions*
`vim-editerm` will create below commands which drop files to vim.
>
:drop <files...>
:edit <files...>
:new <files...>
:vnew <files...>
:tabnew <files...>
<
==============================================================================
OPTIONS *vim-editerm-options*
g:editerm_opener *g:editerm_opener*
Type: |String|
Default: `'n'`
Change behavior to open new buffer.
Options:
`'e'`: open new buffer in current window.
`'n'`: split window horizontally.
`'v'`: split window vertically.
`'t'`: open new tab.
Example: >
let g:editerm_opener = 't' " open new tab
<
This option can be overwritten by the shell variable `$VIM_EDITERM_OPENER`.
Example: >
export VIM_EDITERM_OPENER="v" # split window vertically
<
g:editerm_defdrop *g:editerm_defdrop*
Type: |String|
Default: `'1'`
`vim-editerm` will create special commands which drop files to vim.
(See: |vim-editerm-shell-functions| )
To suppress them, you can set `g:editerm_defdrop` to `0`.
Example: >
let g:editerm_defdrop = '0'
g:editerm_defdrop_prefix *g:editerm_defdrop_prefix*
Type: |String|
Default: `':'`
`vim-editerm` will create special commands which drop files to vim.
(See: |vim-editerm-shell-functions| )
To change their prefix (`:`), you can set `g:editerm_defdrop_prefix`.
Example: >
let g:editerm_defdrop_prefix = 'vim_'
# This will create commands like "vim_drop", "vim_edit" and so on.
<
==============================================================================
LICENSE *vim-editerm-license*
MIT License.
Also see http://www.opensource.org/licenses/MIT for more information.
vim:textwidth=78:tabstop=4:shiftwidth=4:expandtab:filetype=help:norl: