archlinux 时间设置安装时cfdisk四个选项什么意思

linux、java、c/c++、pytjon、ruby、js、css
archlinux安装(gnome3桌面环境)
注意:由于我的sailing笔记本的secure boot无法关闭,我只能够在虚拟机中安装了,以下是实战
(既然发了博客, 有什么问题qq咨询或者wiki一下吧)
& &&&root@archiso~# cfdisk&&&&& & ----使用这个指令建立分区,cfdisk /dev/sda cfdisk与cgdisk的区别是,cfdisk分出来的区可以与win双重启动。因为他们都依赖于mbr
& & 注意:/ 分区一定要Bootable,如果你单独划分了/boot,那这个也要bootable。
& &&& & --------------------------------------------------------------
& &&& &&& & /boot& &&& & ----100M& &&& & ----主分区
& & & & & & /& &&& & ----8G& & ----逻辑分区
& & & & & &&/home& &&& & ----10G& &&& & ----主分区,考虑到个人软件都安装到这个目录下
& &&& &&& &&swap& &&& & ----524M& &&& & ----逻辑分区
& &&--------------------------------------------------------------
& &&&root@archiso~# mkfs.ext4 /dev/sda1& &&& & ----/boot
& &&&root@archiso~#&mkfs.ext4 /dev/sda2&&&&& & ----/
& &&&root@archiso~#&mkfs.ext4 /dev/sda3&&& && & ----莫名其妙出现这么个1k的分区
& &&&root@archiso~#&mkswap /dev/sda5& &&& & ----/home
& &&&root@archiso~#&mkfs.ext4 /dev/sda6& &&& & ----&swap
& &&&root@archiso~# swapon /dev/sda6& &&& & ----立即使用交换分区(激活交换分区)
& &&&root@archiso~# mount /dev/sda2 /mnt&&& &----必须先挂载根目录(不然后面再/mnt下建立子目录以及挂载都不能成功)
& &&&root@archiso~# mkdir /mnt/boot
& &&&root@archiso~# mkdir /mnt/home
& &&&root@archiso~# mount /dev/sda1 /mnt/boot
& &&&root@archiso~# mount /dev/sda5 /mnt/home
2.网络与源&&
注意:虚拟机中设置NAT相当于DHCP
[root@localhost ~]# ip link show&&&&&&& ----看看网卡的名字,有点诡异,系统捉错了
[root@localhost ~]# ip link set eno name eth0&&&&&&& ----修改网卡的名字
[root@localhost ~]# ping & &&& & ----发现可以上网
& & ---------------------------------------------------------------
& &&&root@archiso~#&ip adds add 我的固定IP/24 dev eth0
& &&&root@archiso~#&ip route add default via 我的网关
& &&&root@archiso~#&vi /etc/resolv.conf& &&& & ----设置DNS
& & ----------------------------------------------------------------
root@archiso~# vi /etc/pacman.d/mirrorlist&&& & ----源列表里面已经有很多源了(一定要自己重新设定,因为后面会联网下载,电信建议163的源
Server = /archlinux/$repo/os/$arch
Server = /archlinux/$repo/os/$arch
Server = http://mirrors./archlinux/$repo/os/$arch
Server = http://repo.archlinux.fr/x86_64
root@localhost ~# pacman -Syu&
root@archiso~#&pacstrap /mnt base base-devel& &&& & ----将基本系统安装到根目录上去(或者也可以自定义,比如pacstrap /mnt bash coreutils file filesystem grub2 linux pacman procps-ng syslog-ng glibc systemd-sysvcompat shawd dhcpcd vi),会等很长时间30分钟-1小时
root@archiso~# &pacstrap /mnt grub-bios& &&& & ----安装启动项管理器,也是要联网地
root@archiso~#&genfstab -p /mnt &&/mnt/etc/fstab& &&& & ----生成磁盘挂载的列表
root@archiso~#&arch-chroot /mnt& &&& & ----切换到新系统中
-------------------------------------------------------------
3.对新系统进行基本设置
& & &sh-4.2# cat /etc/hostname&&&&& & ----查看主机名称
& & &sh-4.2# vi /etc/hosts&&&&& & ----在解析的列表中写入上面的本机名称。不过,2013版的这个镜像文件,已经可以不再执行这步操作了,系统能够自动解析本机的名称
& & &sh-4.2#&vi /etc/vconsole.conf& &&& & ----(新档案)写入键盘布局方案
& &&& &&KEYMAP=us
& && &&&FONT=
& &&& &&FONT_MAP=
& & &sh-4.2#&vi /etc/timezone& &&& & ----(新档案)写入时区
& &&& &&Asia/Shanghai
& & &sh-4.2#&ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime& &&& & ----&建立时区的软链接
& & &sh-4.2#&vi /etc/locale.conf& &&& & ----写入本机的字符编码方式
& &&&&&&LANG=en_US.UTF-8&&&&& & ----等到基本系统完全安装完成之后,再修改这个配置为中文编码LANG=zh_CN.UTF-8
& & &sh-4.2#&vi /etc/locale.gen& &&& & ----去掉en_US.UTF-78和zh_CN.UTF-8前面的注释
& & &sh-4.2#&locale-gen&&&&& & ----对系统的编码进行更新(重新载入字符集)
& & &sh-4.2#&hwclock --systohc --localltime& &&& & ----设定系统将用的时间方案。这个时间方案我是试过很多次,如果是双系统,电脑里还有win系统的话,建议设为:--localtime,否则可设为--utc。
&&&&& 不过,我现在虽然也用双系统,但还是设的utc,因为设为--localtime虽然在win下时间不会出错,但回到linux下,经常系统会有些古怪的问题,比如,升级系统之时,报密钥错误。使用--utc,虽然在linux下时间会慢8个多小时,但毕竟对整个系统没有影响。
& & &sh-4.2#&mkinitcpio -p linux& &&& & ----&生成内核的启动镜象,有两条警告信息(应该没事) &
----------------------------------------------------------------------------------------------------------------
& & &sh-4.2#&grub-install /dev/sda& &&& & ----在这个启动装置的MBR中安装grub(boot loader:启动管理器)
& & &sh-4.2#&grub-mkconfig -o /boot/grub/grub.cfg& &&& & ----并生成系统启动的配置文件
-----------------------------------------------------------------------------------------------------------------
& & &sh-4.2#&vi /boot/grub/grub.cfg& &&& & ----&查看一下启动配置文件
& & &sh-4.2#&passwd& &&& & ----修改root密码
& & &sh-4.2#&exit& &&& & ----退出挂载
& &&&root@archiso~#& umount /mnt/{boot,home}& &&& 或者umount -R /mnt& &&& &&&&----& 卸载挂载的分区,这一步千万不要忘掉,否则等会重启机子会无法进入系统。
& &&&root@archiso~# &reboot& &&& & ----重启机子
4. 新建账户
[root@localhost ~]# useradd -m eli& &&& & ----新建nemo这个账号
[root@localhost ~]# passwd eli& &&& & ----设置密码
[root@localhost ~]# visudo&
& &&%users ALL=(ALL) NOPASSWD: SETENV: ALL&&&&& & ----基本sudo设置,所有users可以全部指今,设置环境等,并略过密码提示。你可以随后再进一步定制sudo.
[root@localhost ~]# visudo&& &&& & ----让eli具备执行一切指令的权限
User_Alias ADMINS=eli
Cmnd_Alias ADMINCOM=ALL
ADMINS ALL=(ALL) ADMINCOM
5.&声卡驱动安装
[root@localhost ~]#&systemctl enable dhcpcd.service && &&&&----网络服务开机自动启动
[root@localhost ~]#&pacman -S alsa-utils& &&& & ----安装alsa-utils软件包:高级Linux声音架构(Advanced Linux Sound Architecture,简称ALSA)是一个Linux内核组件。它替换了原有的开放声音系统(OSS)
[root@localhost~]#&pacman -S alsa-oss&&&& & ----如果alsa有问题,就还是用OSS吧
[root@localhost ~]#&gpasswd -a eli audio& &&& & ----把你的普通用户账号加入到audio用户组中
[root@localhost ~]#&su eli&&&& & ----切换到普通用户
[eli@localhost ~]#&alsamixer&&&& & ----以普通用户身份运行,用左右光标键移动到Master和PCM声道上,按M取消掉静音。用向上键增加音量。(70-90的音量是较合适的范围)按ESC键离开alsamixer。 有Speaker的,需要同时取消静音并调整之.
[eli@localhost ~]#&aplay /usr/share/sounds/alsa/Front_Center.wav&&&& & ----以普通用户身份,使用 /usr/bin/aplay程序来测试你的声音配置.这将创建'/etc/asound.state'文件,用来保存alsamixer的设置。
[eli@localhost ~]# exit& &&
[root@localhost ~]#&/usr/sbin/alsactl& &&& & ----保存声音配置,以root身份运行/usr/sbin/alsactl
[root@localhost ~]#vi /etc/rc.conf& &&& & ----为了每次启动都可以自动恢复混音器设置,可将守护进程alsa加入到你的/etc/rc.conf中的DAEMONS列表
& &&DAEMONS=(syslog-ng network crond alsa)
注意,alsa守护进程在启动过程中仅仅是恢复音量设置。它和alsa音频库(和内核级API)是完全不同的。
6. 图形界面
6.1X Server和display manager以及桌面环境gnome
[root@localhost ~]# pacman -S ntfs-3g&& &&& & ----让nautilus能够正常读写挂载的分区
[root@localhost ~]#&pacman -S xorg&&&& & ----& & X11& &&
[root@localhost ~]#&pacman -S xf86-video-vmware& &&& & ----针对VMware安装显卡驱动
[root@localhost ~]#&pacman -S xf86-input-keyboard&&&& & ----图形界面的键盘驱动
[root@localhost ~]#&pacman -S xf86-input-mouse& &&& & ----鼠标的驱动
[root@localhost ~]#&pacman -S gnome& &&& & ----你必须安装 gnome 软件包组
[root@localhost ~]#&pacman -S gnome-extra&& &&&& ----选择你想要从 gnome-extra 组中想要使用的应用程序,不必安装整个软件包组
[root@localhost~]# pacman -S gdm&&&&& & ----安装GDM作为登陆器
[root@localhost ~]#&vi /etc/X11/xinit/xinitrc& &&& &----安装图形界面之后,可能无法直接启动,需要配置以下文件
exec gnome-session
[root@localhost ~]#&~/.xinitrc
exec gnome-session
[root@localhost ~]# systemctl enable gdm.service&&&& & ----使用GDM作为登陆器,gnome桌面如果不使用GDM作为登陆器将无法使用锁屏功能
[root@localhost ~]# echo "export LANG=zh_CN.UTF-8" & /etc/locale.conf& &&& & ----安装完kde桌面环境后开始安装中文语言包(可能会出现中文汉化不完全的问题)
[root@localhost ~]#&locale-gen&&&&& & ----使中文编码生效
[root@localhost ~]# reboot& &&& & ----重启
6.2gnome美化配置
[eli@localhost ~]# sudopacman -S gnome-tweak-tool& &&&& ----这个工具可以定制字体,主题, 标题栏和其它一些实用的设置
[eli@localhost ~]# pacman -S ntp& &&& & ----设置完时区之后,默认是无法使用网络同步时间的,需要安装ntp服务
[eli@localhost ~]$ sudo&pacman -S wqy-zenhei& &&& & ----安装这个中文字体
7. 安装必备软件
[eli@localhost ~]$&vi /etc/pacman.conf&&&& & ----安装yaourt,在/etc/pacman.conf中添加仓库
&[archlinuxfr]
SigLevel = Optional TrustAll
[eli@localhost ~]$&sudo pacman -Sy yaourt& &&& & ----另外一个包管理工具
[eli@localhost ~]$&sudo&pacman -S lilyterm&& &&& & ----安装台湾的这个终端(透明背景什么的)
[eli@localhost ~]$&sudo&pacman -S bash-complete& &&& & ----增强自动补全功能
[eli@localhost ~]$ pacman -S fortune-mod& &&& & ----让vim更有意思的包(随机显示)(/usr/share/fortune/off)
[eli@localhost ~]$ pacman -S cowsay& &&& & ----牛的二进制图形(/usr/share/cows)
[eli@localhost ~]$ sudo yaourt -S command-not-found& &&& & ----命令找不到时将到aur库中寻找可能的包
[eli@localhost ~]$ sudo yaourt -S vundle-git& &&& & ----安装vim的插件管理器
[eli@localhost ~]$&vim ~/.bashrc& && & ----对bash的功能进行自定义【配置文件 .bashrc】&&
[eli@localhost ~]$ vim ~/.bashrc_logout& &&& & ----编辑退出终端时执行的指令
[eli@localhost ~]#$sudo pacman -S gnome-packagekit&&&& &&& &----Archlinux中pacman的图形化前端,gnome桌面环境中推荐使用packagekit
[eli@localhost ~]$&sudo pacman -S ibus&&&& & ----在gnome桌面环境下,对ibus输入法的支持更好
[eli@localhost ~]$&sudo pacman -S ibus-rime ibus-libpinyin&&&& & ----安装rime和中文输入法,实测中文输入法中googlepinyin以及sunpinyin等老牌输入法对新界面的ibus支持欠佳
[eli@localhost ~]$&pacman -S ibus-qt& &&& & ----获得qt的支持&
[eli@localhost ~]$&qtconfig-qt4 & & &&&& ----打开qt的设置界面,将ibus设置为默认输入法
[eli@localhost~]$&dconf update&&& &&& &----ibus在Archlinux中有bug,无法保存配置,执行以下命令后可以恢复正常,更新dconf配置
[eli@localhost ~]$&ibus-daemon -rdx&&&&&&&&&----重启ibus
[设置&区域与时间&中的&输入源&,添加一条&汉语(Intelligent Pin?n)&]
[eli@localhost ~]$&gnome-session-quit& &&& & ----关闭gnome,重新登录
8. 安装open-vm-tools(vmware tools)
[eli@localhost ~]$&pacman -S open-vm-tools
[eli@localhost ~]$ su -
[root@localhost ~]# systemctl start vmtoolsd& &&& & ----开启open-vm-tools
[root@localhost ~]# systemctl enable vmtoolsd& &&& &&----设置开机自启
[root@localhost ~]# cat /proc/version & /etc/arch-release& &&& & ----将版本信息写入&open-vm-tools将读取的文档
[root@localhost ~]# vmware-toolbox-cmd timesync enable& &&& & ----和宿主时间同步
[root@localhost ~]# sudo hwclock --hctosys --localtime& &&& & ----进行同步的指令
[root@localhost ~]# pacman -S xf86-input-vmmouse xf86-video-vmware svga-dri
[root@localhost ~]# vim /etc/X11/xorg.conf.d/20-gpudriver.conf& &&& & ----编辑配置显卡驱动
Section "Device"
&&&&&&& Identifier "Card0"
&&&&&&& Driver&&&& "vmware"
EndSection
[root@localhost ~]# vim /etc/xdg/autostart/vmware-user.desktop
[Desktop Entry]
Type=Application
Name=VMWare User Agent
Exec=/usr/bin/vmware-user-suid-wrapper
Icon=system-run
[虚拟机-&安装VMware Toos]& &&& & ----设置虚拟机挂载VMware Tools的iso
[eli@localhost ~]$&cd /run/media/eli/VMware\ Tools/& &&& & ----切换到挂载的iso中
[eli@localhost ~]$&cp VMwareTools-9.6.1-1378637.tar.gz &~/Downloads&&&& & ----复制
[eli@localhost ~]$&tar zxvf ~/Downloads/VMwareTools-9.6.1-1378637.tar.gz&& &&& & ----解压
[eli@localhost ~]$&cd ~/vmware-tools-distrib
[eli@localhost ~]$&./vmware-install.pl& &&& & ----安装
[eli@localhost ~]$ shutdown -h now& &&&& ----关机并重启虚拟机
9. 建立学习开发环境
9.1 安装ssh
[eli@localhost ~]$ sudo pacman -S openssh
[eli@localhost ~]$ sudo vim /etc/ssh/ssh_config& &&& & ----对客户端进行设置
Port 1104& && & ----默认是22&
Protocol 2& &&& & ----协议1据说不安全
[eli@localhost ~]$ sudo vim /etc/ssh/sshd_config& &&& & ----对服务器端进行设置(守护进程)
Port 1104& && & ----默认是22&,如果发生端口扫描也不会记录那么多日志
Banner /etc/issue&&&& & ---指定登录欢迎语
AllowUser eli&&&& & ----限制只有eli可以登录
PermitRootLogin no& &&& & ----不允许root通过远程ssh登录
[eli@localhost ~]$ sudo systemctl enable sshd.service& &&& & ----设置开机自启
[eli@localhost ~]$ sudo systemctl start sshd& &&& & ----启动守护进程(监听1104端口)&&
[eli@localhost ~]$&sudo vim /lib/systemd/system/sshd.socket& &&& & ----和ssd监听的端口保持一致
ListenStream=1104
[eli@localhost ~]$&&ssh -p 1104 elir@localhost
9.2 git初始化环境
[eli@localhost ~]$ sudo pacman &-S git
[eli@localhost ~]$ git config --global core.editor "nano -w"&&& & & ----设置git默认的编辑器
[eli@localhost ~]$ git config --global user.name "eli01"& &&&&----设置git帐号
[eli@localhost ~]$&git config --global --global user.email ""&&&&&&&&&&----设置git邮箱
[eli@localhost ~]$&git config --global color.ui true& &&&&----设置git字符界面启用颜色
[eli@localhost ~]$ mkdir ~/Workstation/github
[eli@localhost ~]$ cd&Workstation/github
[eli@localhost ~]$ git clone git:///eli01/archlinux
9.3 vim集成开发环境的搭建
[eli@localhost ~]$ sudo pacman -S vim& &&
[eli@localhost ~]$ &sudo&cp /usr/share/vim/vim73/vimrc_example.vim /etc/vimrc& &&& & ----用一个示例配置替代原来的配置文件(支持语法高亮等)
[eli@localhost ~]$ mkdir ~/Downloads/vim-plugins& &&& & ----创建一个文件夹下载vim插件
[eli@localhost ~]$ mkdir ~/.vim/{plugin,doc}&&&&&&&&&&----创建安装vim插件和文档的目录
[eli@localhost ~]$ vim ~/.vim/vim_plugin_download_list.txt&&&&&&&&---备份下载连接到文档(taglist wimmanager minibufexploer a grep visualmark supertab)
http://www.vim.org/scripts/scripts.php?script_id=95
【通过浏览器下载上述插件】
[eli@localhost ~]$ cd ~/Download
[eli@localhost&Download]$ cp taglist_46.zip winmanager.zip ~/.vim/&&&&&&&&----插件中有些是压缩包,复制到.vim中解压
[eli@localhost&Download]]$ cd ~/.vim
[eli@localhost .vim]$unzip *.zip&&&&&&&&----解压缩
[eli@localhost .vim]$ cd ~; cp ~/Download/*.vim ~/.vim/plugin&&&&&&&&----那些.vim后缀的插件复制到~/.vim/plugin文件夹下
[eli@localhost ~]$ sudo pacman -S cscope&&&&&&&&----某些插件直接到官方源下载安装
[eli@localhost ~]$ sudo pacman -S ctags
[eli@localhost ~]$ vim ~/.vimrc&&&&&&&&----【配置文件 .vimrc】,对vim进行一些列个性化设置
if has("syntax")
" 语法高亮
syntax enable"语法高亮
colorscheme desert
" elflord ron peachpuff default 设置配色方案,vim自带的配色方案保存在/usr/share/vim/vim74/colors目录下
"filetype on
filetype plugin on
if has("autocmd")
au BufReadPost * if line("'\"") & 1 && line("'\"") &= line("$") | exe "normal! g'\"" |
set ignorecase
set smartcase
"set autoindent
set autowrite
"set smartindent
set tabstop=4
set softtabstop=4
set shiftwidth=4
"set cindent
set cinoptions={0,1s,t0,n-2,p2s,(03s,=.5s,&1s,=1s,:1s
set backspace=2
set showmatch
set linebreak
set whichwrap=b,s,&,&,[,]
set hidden
set mouse=a
set number
set previewwindow
set history=50
set laststatus=2
set showcmd
set showmode
set incsearch
set hlsearch
set shellcmdflag=-ic
"-----------ctags seeting----------------
"nmap &F5& :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .&CR&&CR& :TlistUpdate&CR&
"nmap &F5& &ESC&:!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .&CR&&CR& :TlistUpdate&CR&
"set tags=tags
set tags+=./tags
set tags+=~/Workstation/Test/tags
"----------Taglist setting----------------
nmap &F5& :Tlist &CR&
let Tlist_Show_One_File = 1
let Tlist_Exit_OnlyWindow = 1
let Tlist_User_Right_Window = 1
"----------vundle vim plugin manager setting---
set nocompatible
" be iMproved
filetype off
" required!
call vundle#rc()
" My Bundles here:
"Bundle 'gmarik/vundle' " original repos on github
"Bundle 'tpope/vim-fugitive'
"Bundle 'Lokaltog/vim-easymotion'
"Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
"Bundle 'tpope/vim-rails.git'
" vim-scripts repos
"Bundle 'L9'
"Bundle 'FuzzyFinder'
"" non github repos
"Bundle 'git:///command-t.git'
filetype plugin indent on
" required!
" Brief help
" :BundleList
- list configured bundles
" :BundleInstall(!)
- install(update) bundles
" :BundleSearch(!) foo - search(or refresh cache first) for foo
" :BundleClean(!)
- confirm(or auto-approve) removal of unused bundles
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Bundle command are not allowed..
"---------NERDTree setting--
map &F4& :NERDTree &CR&
"---------WinManager setting-----------
let g:winManagerWindowLayout='FileExplorer|TagList'
map &F6& :WMToggle &cr&
"---------Cscope setting--------------
set cscopequickfix=s-,c-,d-,i-,t-,e-"设置是否将结果用quickfix显示
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&
"---------quickfix setting-----------
nmap &F7& :cn&cr&
nmap &F8& :cp&cr&
"---------minibuffer explorer setting-----
let g:miniBufExplMapCTabSwitchBufs=1
let g:miniBufExplMapWindowNavVim=1
let g:miniBufExplMapWindowNavArrows=1
nnoremap &silent& &F12& :A&CR&
"---------grep setting----------------
nnoremap &silent&&F3& :Grep &CR&
"---------Super tab-------------------
"let g:SuperTabRetainCompletionType=2
"let g:SuperTabDefaultCompletionType="&C_X&&C_O&"
"---------complier----------------
func! CompileGcc()
let compilecmd="!gcc "
let compileflag="-o %& "
if search("mpi\.h") != 0
let compilecmd = "!mpicc "
if search("glut\.h") != 0
let compileflag .= " -lglut -lGLU -lGL "
if search("cv\.h") != 0
let compileflag .= " -lcv -lhighgui -lcvaux "
if search("omp\.h") != 0
let compileflag .= " -fopenmp "
if search("math\.h") != 0
let compileflag .= " -lm "
exec compilecmd." % ".compileflag
func! CompileGpp()
let compilecmd="!g++ "
let compileflag="-o %& "
if search("mpi\.h") != 0
let compilecmd = "!mpic++ "
if search("glut\.h") != 0
let compileflag .= " -lglut -lGLU -lGL "
if search("cv\.h") != 0
let compileflag .= " -lcv -lhighgui -lcvaux "
if search("omp\.h") != 0
let compileflag .= " -fopenmp "
if search("math\.h") != 0
let compileflag .= " -lm "
exec compilecmd." % ".compileflag
func! RunPython()
exec "!python %"
func! CompileJava()
exec "!javac %"
func! CompileCode()
if &filetype == "cpp"
exec "call CompileGpp()"
elseif &filetype == "c"
exec "call CompileGcc()"
elseif &filetype == "python"
exec "call RunPython()"
elseif &filetype == "java"
exec "call CompileJava()"
func! RunResult()
if search("mpi\.h") != 0
exec "!mpirun -np 4 ./%&"
elseif &filetype == "cpp"
exec "! ./%&"
elseif &filetype == "c"
exec "! ./%&"
elseif &filetype == "python"
exec "call RunPython"
elseif &filetype == "java"
exec "!java %&"
map &F7& :call CompileCode()&CR&
imap &F7& &ESC&:call CompileCode()&CR&
vmap &F7& &ESC&:call CompileCode()&CR&
map &F8& :call RunResult()&CR&
[eli@localhost ~]$ vim ~/.vim/syntax/c.vim&&&&&&&&----[配置文件 c.vim],针对从c 语言语法高亮设置
"========================================================
"Highlight All Function
"========================================================
syn match cFunction "/&[a-zA-Z_][a-zA-Z_0-9]*/&[^()]*)("me=e-2
syn match cFunction "/&[a-zA-Z_][a-zA-Z_0-9]*/&/s*("me=e-1
hi cFunction gui=NONE guifg=#B5A1FF
"========================================================
"Highlight All Math Operator
"========================================================
" C math operators
syn match cMathOperator display "[-+/*/%=]"
" C pointer operators
syn match cPointerOperator display "-&/|/."
" C logical operators - boolean results
syn match cLogicalOperator display "[!&&]=/="
syn match cLogicalOperator display "=="
" C bit operators
syn match cBinaryOperator display "/(&/||/|/^/|&&/|&&/)=/="
"syn match cBinaryOperator display "/~"
"syn match cBinaryOperatorError display "/~="
" More C logical operators -highlight in preference to binary
syn match cLogicalOperator display "&&/|||"
syn match cLogicalOperatorError display "/(&&/|||/)="
" Math Operator
hi cMathOperator guifg=#3EFFE2
hi cPointerOperator guifg=#3EFFE2
hi cLogicalOperator guifg=#3EFFE2
hi cBinaryOperator guifg=#3EFFE2
hi cBinaryOperatorError guifg=#3EFFE2
hi cLogicalOperator guifg=#3EFFE2
hi cLogicalOperatorError guifg=#3EFFE2
"========================================================
" My Own DataType
"========================================================
"syn keyword cType My_Type_1 My_Type_2 My_Type_3
9.4 优化man手册功能
[eli@localhost ~]$ sudo pacman -S man-pages-zh_cn& &&& & ----安装中文的man手册
[eli@localhost ~]$ sudo mandb& &&& & ----更新关键词搜索需要的缓存
[eli@localhost ~]$ sudo pacman -S most
[eli@localhost ~]$ vim /etc/man_db.conf& &&& & ----获得高亮显示man的结果
[eli@localhost ~]$ vim .profile& &&& & ----自定义环境变量BROWSER
export BROWSER=chromium
[eli@localhost ~]$ source ~/.profile& &&& & ----执行这个脚本以使新设定的环境变量在当前环境下生效
[eli@localhost ~]$& man -H dd& &&& & ----测试上面的设置是否生效
9.5对系统进行个性化修改
[eli@localhost ~]$ sudo vim /etc/issue& &&& & ----修改开机的欢迎语
Arch Linux \r (\l)
Welcome!Remember,present is gift!Haave fun!
阅读(...) 评论()}

我要回帖

更多关于 archlinux时间不对 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信