質問編集履歴

1

設定ファイルの追加

2020/12/15 07:10

投稿

yoshikoop0924
yoshikoop0924

スコア1

test CHANGED
File without changes
test CHANGED
@@ -10,32 +10,170 @@
10
10
 
11
11
 
12
12
 
13
- ```以下設定ファイルです
13
+ ```~/.vimrc
14
14
 
15
-  2 set nocompatible$
15
+ set nocompatible
16
16
 
17
- 3 set encoding=euc-jp$
17
+ set encoding=euc-jp
18
18
 
19
- 4 set fileencodings=iso-2022-jp,sjis$
19
+ set fileencodings=iso-2022-jp,sjis
20
20
 
21
- 5 set fileformats=unix,dos$
21
+ set fileformats=unix,dos
22
22
 
23
- 6 set backup$
23
+ set backup
24
24
 
25
- 7 set backupdir=~/backup$
25
+ set backupdir=~/backup
26
26
 
27
- 8 set smartcase$
27
+ set smartcase
28
28
 
29
- 9 set incsearch$
29
+ set incsearch
30
30
 
31
- 10 set number$
31
+ set number
32
32
 
33
- 11 set list$
33
+ set list
34
34
 
35
- 12 set showmatch$
35
+ set showmatch
36
36
 
37
- 13 syntax on$
37
+ syntax on
38
38
 
39
- 14 highlight comment ctermfg=LightCyan$
39
+ highlight comment ctermfg=LightCyan
40
40
 
41
41
  ```
42
+
43
+ ```/etc/vimrc
44
+
45
+ if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
46
+
47
+ set fileencodings=iso-2022-jp,sjis
48
+
49
+ endif
50
+
51
+ set fileencoding=euc-jp
52
+
53
+ set nocompatible " Use Vim defaults (much better!)
54
+
55
+ set fileformats=unix,dos
56
+
57
+ set bs=indent,eol,start " allow backspacing over everything in insert mode
58
+
59
+ "set ai " always set autoindenting on
60
+
61
+ set backup " keep a backup file
62
+
63
+ set viminfo='20,\"50 " read/write a .viminfo file, don't store more
64
+
65
+ " than 50 lines of registers
66
+
67
+ set history=50 " keep 50 lines of command line history
68
+
69
+ set ruler " show the cursor position all the time
70
+
71
+ set number
72
+
73
+ set showmatch
74
+
75
+ set wrap
76
+
77
+ " Only do this part when compiled with support for autocommands
78
+
79
+ if has("autocmd")
80
+
81
+ augroup redhat
82
+
83
+ autocmd!
84
+
85
+ " In text files, always limit the width of text to 78 characters
86
+
87
+ " autocmd BufRead *.txt set tw=78
88
+
89
+ " When editing a file, always jump to the last cursor position
90
+
91
+ autocmd BufReadPost *
92
+
93
+ \ if line("'\"") > 0 && line ("'\"") <= line("$") |
94
+
95
+ \ exe "normal! g'\"" |
96
+
97
+ \ endif
98
+
99
+ " don't write swapfile on most commonly used directories for NFS mounts or USB sticks
100
+
101
+ autocmd BufNewFile,BufReadPre /media/*,/run/media/*,/mnt/* set directory=~/tmp,/var/tmp,/tmp
102
+
103
+ " start with spec file template
104
+
105
+ autocmd BufNewFile *.spec 0r /usr/share/vim/vimfiles/template.spec
106
+
107
+ augroup END
108
+
109
+ endif
110
+
111
+
112
+
113
+ if has("cscope") && filereadable("/usr/bin/cscope")
114
+
115
+ set csprg=/usr/bin/cscope
116
+
117
+ set csto=0
118
+
119
+ set cst
120
+
121
+ set nocsverb
122
+
123
+ " add any database in current directory
124
+
125
+ if filereadable("cscope.out")
126
+
127
+ cs add $PWD/cscope.out
128
+
129
+ " else add database pointed to by environment
130
+
131
+ elseif $CSCOPE_DB != ""
132
+
133
+ cs add $CSCOPE_DB
134
+
135
+ endif
136
+
137
+ set csverb
138
+
139
+ endif
140
+
141
+
142
+
143
+ " Switch syntax highlighting on, when the terminal has colors
144
+
145
+ " Also switch on highlighting the last used search pattern.
146
+
147
+ if &t_Co > 2 || has("gui_running")
148
+
149
+ syntax on
150
+
151
+ set hlsearch
152
+
153
+ endif
154
+
155
+
156
+
157
+ filetype plugin on
158
+
159
+
160
+
161
+ if &term=="xterm"
162
+
163
+ set t_Co=8
164
+
165
+ set t_Sb=m
166
+
167
+ set t_Sf=m
168
+
169
+ endif
170
+
171
+
172
+
173
+ " Don't wake up system with blinking cursor:
174
+
175
+ " http://www.linuxpowertop.org/known.php
176
+
177
+ let &guicursor = &guicursor . ",a:blinkon0"
178
+
179
+ ```