回答編集履歴
1
ミスタイプ
answer
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
解決ではないがとりあえずやりたいことはできたので解決とします。
|
2
2
|
|
3
3
|
備考:
|
4
|
-
au BufRead,
|
4
|
+
au BufRead,BufNewFile *.py set &filetype=‘python’
|
5
5
|
とinit.vimに入れるとpython.vim内のecho ‘This is the python’が実行されThis is the pythonと表示される。
|
6
6
|
しかしながら当然エラーが出る。
|
7
7
|
Error detected while processing BufReadPost Autocommands for “*.py”:
|
8
8
|
E518: Unknown option: &filetype=‘python’
|
9
9
|
|
10
10
|
また次の文でもエラーに違いはあるものの、 this is pythonが出る。
|
11
|
-
au BufRead,
|
11
|
+
au BufRead,BufNewFile *.py set &filetype=python
|
12
|
-
au BufRead,
|
12
|
+
au BufRead,BufNewFile *.py &filetype=python
|
13
13
|
|
14
14
|
次の文ではthis is pythonが出ない。
|
15
|
-
au BufRead,
|
15
|
+
au BufRead,BufNewFile *.py setfiletype python
|
16
|
-
au BufRead,
|
16
|
+
au BufRead,BufNewFile *.py echo ‘python’
|
17
17
|
|
18
18
|
とりあえず .pyのときだけして欲しい処理は関数python_configにまとめて
|
19
|
-
au BufRead,
|
19
|
+
au BufRead,BufNewFile *.py call python_config()
|
20
20
|
としました。(初めから大人しくそうしてればよかったですね。)
|