linux系统安装好后安装必要的软件

1
2
3
yum update
 
sudo yum -y install ncurses-devel flex bison openssl openssl-devel elfutils elfutils-libelf-devel gmp-devel dwarves zstd dejagnu texinfo patch gcc g++ git autoconf gettext-devel automake ctags cscope

  

 

 
1
2
3
4
5
sudo apt update
 
sudo apt upgrade
 
sudo apt install -y vim git gcc g++ make auditd cmake flex autoconf automake libtool dh-autoreconf pkg-config bison libelf-dev libncurses-dev libssl-dev libcap-dev libbfd-dev libgmp-dev texinfo iperf arping dejagnu ctags cscope

  


vimid
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh                                                                                                                                                                                                         
find   $(pwd) -name "*.h" -o -name "*.c" -o -name "*.S"  -o -name "*.s" -o -name "*.cpp"  -o -name "*.cc" >cscope.files
  
#find  -L $(pwd) -name "*.h" -o -name "*.c" -o -name "*.cpp" -o -name "*.S" -o -name "*.s" | xargs realpath > cscope.files
#find  -L $(pwd) -name "*.h" -o -name "*.c" -o -name "*.cpp" -o -name "*.S" -o -name "*.s" | xargs readlink -f > cscope.files
#find   $(pwd) -name "*.[cpp|h|c|S]"  >cscope.files
  
cscope -Rbq -i cscope.files
  
  
  
ctags -R *

  

 

vimrc

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
fedora@bogon:~$ cat .vimrc
" All system-wide defaults are set in $VIMRUNTIME/debian.vim and sourced by
" the call to :runtime you can find below.  If you wish to change any of those
" settings, you should do it in this file (/etc/vim/vimrc), since debian.vim
" will be overwritten everytime an upgrade of the vim packages is performed.
" It is recommended to make changes after sourcing debian.vim since it alters
" the value of the 'compatible' option.
 
" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages available in Debian.
runtime! debian.vim
 
" Vim will load $VIMRUNTIME/defaults.vim if the user does not have a vimrc.
" This happens after /etc/vim/vimrc(.local) are loaded, so it will override
" any settings in these files.
" If you don't want that to happen, uncomment the below line to prevent
" defaults.vim from being loaded.
" let g:skip_defaults_vim = 1
 
" Uncomment the next line to make Vim more Vi-compatible
" NOTE: debian.vim sets 'nocompatible'.  Setting 'compatible' changes numerous
" options, so any other options should be set AFTER setting 'compatible'.
"set compatible
 
" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
"syntax on
 
" If using a dark background within the editing area and syntax highlighting
" turn on this option as well
"set background=dark
 
" Uncomment the following to have Vim jump to the last position when
" reopening a file
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
 
" Uncomment the following to have Vim load indentation rules and plugins
" according to the detected filetype.
"filetype plugin indent on
 
" The following are commented out as they cause vim to behave a lot
" differently from regular Vi. They are highly recommended though.
"set showcmd        " Show (partial) command in status line.
"set showmatch      " Show matching brackets.
"set ignorecase     " Do case insensitive matching
"set smartcase      " Do smart case matching
"set incsearch      " Incremental search
"set autowrite      " Automatically save before commands like :next and :make
"set hidden     " Hide buffers when they are abandoned
"set mouse=a        " Enable mouse usage (all modes)
 
 
" Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
  source /etc/vim/vimrc.local
endif
 
" https://vimjc.com/vimrc.html   and  https://vimjc.com/vimrc-config.html
 
 
 
syntax enable
 
syntax on
 
set nocompatible
 
set number
 
set backspace=2
 
"set tabstop=4
 
set shiftwidth=4
 
set autowrite
 
 
set ruler                       " show the current row and column "
 
set number                      " show line numbers "
 
set nowrap  
        
set showcmd                     " display incomplete commands "
                                                                                          
set showmode                    " display current modes "
 
set showmatch                   " jump to matches when entering parentheses "
 
set matchtime=2                 " tenths of a second to show the matching parenthesis "
 
set laststatus=2
 
 
set hlsearch                    " highlight searches "
set incsearch                   " do incremental searching, search as you type "
 
"加上此项会使ctags跳转变慢
"set ignorecase                  " ignore case when searching "
"set smartcase                   " no ignorecase if Uppercase char present "
 
set encoding=utf8
set fileencodings=utf8,ucs-bom,gbk,cp936,gb2312,gb18030
 
set cursorcolumn
set cursorline
 
"set paste
 set mouse=a  "打开鼠标模式
"set mouse=v  "可是模式下是用鼠标,使用鼠标复制内容到剪切板,可在vim命令行中使用set mouse=a/v进行切换
"set selection=exclusive
"set selectmode=mouse,key
 
 
 
map <F3> :set nonu  mouse=v<CR>
map <F4> :set nu mouse=a<CR>
 
map <F5> :set paste<CR>
map <F6> :set nopaste<CR>
 
 
 
 
 
"--ctags setting--
" 按下F5重新生成tag文件,并更新taglist
"map <F5> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR><CR> :TlistUpdate<CR>
"imap <F5> <ESC>:!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR><CR> :TlistUpdate<CR>
 
"两个一起用,ctags自动寻找tags文件,默认当前路径,其次是父路径,依次向上递归,tags后的;是必须有的
set tags=tags;
set autochdir
"set tags+=./tags "add current directory's generated tags file
"set tags+=.
"set tags+=/home/lhcc/work/tools/kexec.git
 
 
 
"--taglist setting--
 
"不同时显示多个文件的tag,只显示当前文件的
let Tlist_Show_One_File=1
"如果taglist窗口是最后一个窗口,则退出vim
let Tlist_Exit_OnlyWindow=1
"可以用F8打开或关闭Taglist
nnoremap <F8> :TlistToggle<CR>
 
"--NERDTree setting--
 
"文件列表栏显示在右边
let NERDTreeWinPos='right'  
"按键盘上的F9就可以显示和隐藏NERDTree的文件浏览了
noremap <F9> :NERDTreeToggle<CR> 
 
"--cscope setting--
 
       if has("cscope")
 
              set csprg=/usr/bin/cscope
 
         "    set csto=0
               
 
         "    set cst
              set nocst
 
              set nocsverb
 
              " add any database in current directory
 
              if filereadable("cscope.out")
 
                  cs add cscope.out
 
              " else add database pointed to by environment
 
              elseif $CSCOPE_DB != ""
 
                  cs add $CSCOPE_DB
 
              endif
 
              set csverb
           
 
       endif
 
"如果有多个匹配项,cscope会弹出窗口显示多个匹配项,输入数字即可跳转到对应匹配项。而设
"置cscope结果输出到quickfix后,cscope只会显示第一个匹配项,如果想要查看其它匹配项,需要输入cw,
"进入quickfix的窗口进行查看。
"set cscopequickfix=s-,c-,d-,i-,t-,e-
 
"另外追加如下两行可以使用Ctrl-n / Ctrl-P 跳转到后一项和前一项纪录。
nmap <C-n> :cnext<CR>
nmap <C-p> :cprev<CR>
 
 
nmap <C-\>s :cs find s <C-R>=expand("<cword>")<CR><CR>   
nmap <C-\>g :cs find g <C-R>=expand("<cword>")<CR><CR>   
nmap <C-\>c :cs find c <C-R>=expand("<cword>")<CR><CR>   
nmap <C-\>t :cs find t <C-R>=expand("<cword>")<CR><CR>   
nmap <C-\>e :cs find e <C-R>=expand("<cword>")<CR><CR>   
nmap <C-\>f :cs find f <C-R>=expand("<cfile>")<CR><CR>   
nmap <C-\>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <C-\>d :cs find d <C-R>=expand("<cword>")<CR><CR>
 
 
 
nmap <C-_>s :vert scs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>g :vert scs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>c :vert scs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>t :vert scs find t <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>e :vert scs find e <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>f :vert scs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <C-_>i :vert scs find i <C-R>=expand("<cfile>")<CR><CR>
nmap <C-_>d :vert scs find d <C-R>=expand("<cword>")<CR><CR>

  



posted on   lh03061238  阅读(65)  评论(0编辑  收藏  举报

努力加载评论中...
相关博文:
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
历史上的今天:
2023-01-03 Linux中“is not in the sudoers file”解决方法

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示