質問編集履歴
3
画像の追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -112,4 +112,10 @@
|
|
112
112
|
fi
|
113
113
|
# User specific aliases and functions
|
114
114
|
export PATH=$HOME/.nodebrew/current/bin:$PATH
|
115
|
-
```
|
115
|
+
```
|
116
|
+
nodejsとphpをQuickRunした時の画面結果を2枚ずつ載せます
|
117
|
+

|
118
|
+

|
119
|
+

|
120
|
+

|
121
|
+
ご覧の通りnodeでは動きませんが、phpだと動くのがわかると思います。
|
2
\.bashrc, \.bash_profile 追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -37,6 +37,7 @@
|
|
37
37
|
```
|
38
38
|
|
39
39
|
```linux
|
40
|
+
" .vimrc
|
40
41
|
" 表示設定
|
41
42
|
set number "行番号を表示する
|
42
43
|
set title "編集中のファイル名を表示
|
@@ -88,4 +89,27 @@
|
|
88
89
|
" -------------------------
|
89
90
|
" End Neobundle Settings.
|
90
91
|
" ------------------------- "
|
92
|
+
```
|
93
|
+
|
94
|
+
```linux
|
95
|
+
# .bash_profile
|
96
|
+
|
97
|
+
# Get the aliases and functions
|
98
|
+
if [ -f ~/.bashrc ]; then
|
99
|
+
. ~/.bashrc
|
100
|
+
fi
|
101
|
+
# User specific environment and startup programs
|
102
|
+
PATH=$PATH:$HOME/bin
|
103
|
+
export PATH
|
104
|
+
```
|
105
|
+
|
106
|
+
```linux
|
107
|
+
# .bashrc
|
108
|
+
|
109
|
+
# Source global definitions
|
110
|
+
if [ -f /etc/bashrc ]; then
|
111
|
+
. /etc/bashrc
|
112
|
+
fi
|
113
|
+
# User specific aliases and functions
|
114
|
+
export PATH=$HOME/.nodebrew/current/bin:$PATH
|
91
115
|
```
|
1
情報の追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -16,4 +16,76 @@
|
|
16
16
|
この設定でバッファを開いて「\r」で実行するのですが、全く反応がありません。
|
17
17
|
ちなみに、phpファイルや純粋なjavascriptファイルのquickrun実行はできます。
|
18
18
|
|
19
|
-
quickrunをnode.jsで実行する方法を教えて下さい。
|
19
|
+
quickrunをnode.jsで実行する方法を教えて下さい。
|
20
|
+
|
21
|
+
追加でquickrunで実行するserver.jsと.vimrcのすべてのソースを追記します。
|
22
|
+
```linux
|
23
|
+
//server.js
|
24
|
+
var http = require('http');
|
25
|
+
|
26
|
+
var server = http.createServer();
|
27
|
+
server.on('request', doRequest);
|
28
|
+
server.listen(process.env.PORT, process.env.IP);
|
29
|
+
console.log('Server running!');
|
30
|
+
|
31
|
+
// リクエストの処理
|
32
|
+
function doRequest(req, res) {
|
33
|
+
res.writeHead(200, {'Content-Type': 'text/plain'});
|
34
|
+
res.write('Hello World\n');
|
35
|
+
res.end();
|
36
|
+
}
|
37
|
+
```
|
38
|
+
|
39
|
+
```linux
|
40
|
+
" 表示設定
|
41
|
+
set number "行番号を表示する
|
42
|
+
set title "編集中のファイル名を表示
|
43
|
+
set showmatch "括弧入力時の対応する括弧を表示
|
44
|
+
syntax on "コードの色分け
|
45
|
+
set tabstop=4 "インデントをスペース4つ分に設定
|
46
|
+
set smartindent "オートインデント
|
47
|
+
|
48
|
+
" 行番号の色を設定
|
49
|
+
hi LineNr ctermbg=none ctermfg=8
|
50
|
+
hi CursorLineNr ctermbg=10 ctermfg=255
|
51
|
+
set cursorline
|
52
|
+
hi clear CursorLine
|
53
|
+
|
54
|
+
" 検索設定
|
55
|
+
set ignorecase "大文字/小文字の区別なく検索する
|
56
|
+
set smartcase "検索文字列に大文字が含まれている場合は区別して検索する
|
57
|
+
set wrapscan "検索時に最後まで行ったら最初に戻る
|
58
|
+
"
|
59
|
+
"
|
60
|
+
"---------------------------
|
61
|
+
" Start Neobundle Settings.
|
62
|
+
"---------------------------
|
63
|
+
" bundleで管理するディレクトリを指定
|
64
|
+
set runtimepath+=~/.vim/bundle/neobundle.vim/
|
65
|
+
"
|
66
|
+
" Required:
|
67
|
+
call neobundle#begin(expand('~/.vim/bundle/'))
|
68
|
+
"
|
69
|
+
NeoBundleFetch 'Shougo/neobundle.vim'
|
70
|
+
" quickrumを設定
|
71
|
+
NeoBundle 'thinca/vim-quickrun'
|
72
|
+
let g:quickrun_config = {
|
73
|
+
\ "node": {
|
74
|
+
\ "command": "node",
|
75
|
+
\ "tempfile": "{tempname()}.js"
|
76
|
+
\ }
|
77
|
+
\ }
|
78
|
+
"
|
79
|
+
" autocloseを設定
|
80
|
+
NeoBundle 'Townk/vim-autoclose'
|
81
|
+
"
|
82
|
+
call neobundle#end()
|
83
|
+
"
|
84
|
+
" Required:
|
85
|
+
filetype plugin indent on
|
86
|
+
"
|
87
|
+
NeoBundleCheck
|
88
|
+
" -------------------------
|
89
|
+
" End Neobundle Settings.
|
90
|
+
" ------------------------- "
|
91
|
+
```
|