teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

設定ファイルの追加

2020/12/15 07:10

投稿

yoshikoop0924
yoshikoop0924

スコア1

title CHANGED
File without changes
body CHANGED
@@ -4,18 +4,87 @@
4
4
  設定しなおしたりしましたが治りませんでした。
5
5
  vimをアンストしたほうがいいのでしょうか。
6
6
 
7
- ```以下設定ファイルです
7
+ ```~/.vimrc
8
-  2 set nocompatible$
8
+ set nocompatible
9
- 3 set encoding=euc-jp$
9
+ set encoding=euc-jp
10
- 4 set fileencodings=iso-2022-jp,sjis$
10
+ set fileencodings=iso-2022-jp,sjis
11
- 5 set fileformats=unix,dos$
11
+ set fileformats=unix,dos
12
- 6 set backup$
12
+ set backup
13
- 7 set backupdir=~/backup$
13
+ set backupdir=~/backup
14
- 8 set smartcase$
14
+ set smartcase
15
- 9 set incsearch$
15
+ set incsearch
16
- 10 set number$
16
+ set number
17
- 11 set list$
17
+ set list
18
- 12 set showmatch$
18
+ set showmatch
19
- 13 syntax on$
19
+ syntax on
20
- 14 highlight comment ctermfg=LightCyan$
20
+ highlight comment ctermfg=LightCyan
21
+ ```
22
+ ```/etc/vimrc
23
+ if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
24
+ set fileencodings=iso-2022-jp,sjis
25
+ endif
26
+ set fileencoding=euc-jp
27
+ set nocompatible " Use Vim defaults (much better!)
28
+ set fileformats=unix,dos
29
+ set bs=indent,eol,start " allow backspacing over everything in insert mode
30
+ "set ai " always set autoindenting on
31
+ set backup " keep a backup file
32
+ set viminfo='20,\"50 " read/write a .viminfo file, don't store more
33
+ " than 50 lines of registers
34
+ set history=50 " keep 50 lines of command line history
35
+ set ruler " show the cursor position all the time
36
+ set number
37
+ set showmatch
38
+ set wrap
39
+ " Only do this part when compiled with support for autocommands
40
+ if has("autocmd")
41
+ augroup redhat
42
+ autocmd!
43
+ " In text files, always limit the width of text to 78 characters
44
+ " autocmd BufRead *.txt set tw=78
45
+ " When editing a file, always jump to the last cursor position
46
+ autocmd BufReadPost *
47
+ \ if line("'\"") > 0 && line ("'\"") <= line("$") |
48
+ \ exe "normal! g'\"" |
49
+ \ endif
50
+ " don't write swapfile on most commonly used directories for NFS mounts or USB sticks
51
+ autocmd BufNewFile,BufReadPre /media/*,/run/media/*,/mnt/* set directory=~/tmp,/var/tmp,/tmp
52
+ " start with spec file template
53
+ autocmd BufNewFile *.spec 0r /usr/share/vim/vimfiles/template.spec
54
+ augroup END
55
+ endif
56
+
57
+ if has("cscope") && filereadable("/usr/bin/cscope")
58
+ set csprg=/usr/bin/cscope
59
+ set csto=0
60
+ set cst
61
+ set nocsverb
62
+ " add any database in current directory
63
+ if filereadable("cscope.out")
64
+ cs add $PWD/cscope.out
65
+ " else add database pointed to by environment
66
+ elseif $CSCOPE_DB != ""
67
+ cs add $CSCOPE_DB
68
+ endif
69
+ set csverb
70
+ endif
71
+
72
+ " Switch syntax highlighting on, when the terminal has colors
73
+ " Also switch on highlighting the last used search pattern.
74
+ if &t_Co > 2 || has("gui_running")
75
+ syntax on
76
+ set hlsearch
77
+ endif
78
+
79
+ filetype plugin on
80
+
81
+ if &term=="xterm"
82
+ set t_Co=8
83
+ set t_Sb=m
84
+ set t_Sf=m
85
+ endif
86
+
87
+ " Don't wake up system with blinking cursor:
88
+ " http://www.linuxpowertop.org/known.php
89
+ let &guicursor = &guicursor . ",a:blinkon0"
21
90
  ```