3
3
"""
4
4
import io
5
5
import os
6
- import pkg_resources
7
6
import re
8
7
import sys
9
8
import subprocess
16
15
17
16
EDITOR = 'EDITOR'
18
17
18
+ """Why not include vim or emacs? Because:
19
+
20
+ 1. If you are using it, you know what the EDITOR variable is, and you
21
+ probably has set it already.it
22
+
23
+ 2. If you aren't using it, finding yourself in their UI for the first time
24
+ is going to be super confusing, in fact "How to exit vim" is a common
25
+ Stack Overflow question. Having to google how to set an EDITOR variable is a
26
+ less scary alternative.
27
+
28
+ """
19
29
COMMON_EDITORS = [
20
30
'subl' ,
21
31
'vscode' ,
22
32
'atom' ,
23
33
]
24
34
25
- THE_GREY_ONES = [
26
- 'vim' ,
27
- 'emacs' ,
28
- ]
29
-
30
35
MACOS_EDITORS = [
31
36
# Only in MacOS, the "shell commands" are not installed by default
32
37
'/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl' ,
33
38
'/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code' ,
34
39
'/Applications/Atom.app/Contents/Resources/app/atom.sh' ,
35
40
'/Applications/TextMate.app/Contents/Resources/mate' ,
36
41
'/Applications/Brackets.app/Contents/Resources/brackets.sh' ,
37
- ] + COMMON_EDITORS + THE_GREY_ONES + [
42
+ ] + COMMON_EDITORS + [
38
43
'/Applications/TextEdit.app/Contents/MacOS/TextEdit' ,
39
44
]
40
45
46
51
'geany' ,
47
52
'gedit' ,
48
53
'nano' ,
49
- ] + THE_GREY_ONES
54
+ ]
50
55
51
- WINDOWS_EDITORS = COMMON_EDITORS + THE_GREY_ONES + [
56
+ WINDOWS_EDITORS = COMMON_EDITORS + [
52
57
'notepad++.exe' ,
53
58
'notepad.exe' ,
54
59
]
@@ -67,7 +72,8 @@ def get_possible_editors():
67
72
if sys_platform .startswith (platform ):
68
73
return EDITORS [platform ]
69
74
70
- return COMMON_EDITORS + THE_GREY_ONES
75
+ return COMMON_EDITORS
76
+
71
77
72
78
def split_editor_cmd (cmd ):
73
79
r"""Split by spaces unless escaped.
0 commit comments