6

OI 中的 Vim

 2 years ago
source link: https://rapiz.me/2017/oi-vim/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

OI 中的 Vim

Installation

Arch Linux: pacman -S gvim
Windows: www.baidu.com
注意 Linux 下 vimgvim 两个包是冲突的。安装 gvim 可以使用两者(GUI 和非 GUI)。

Configurations

Compile and Run

关于编译可以看看这篇文章
我们想在新窗口中运行,还想要运行结束后按任意键继续来看输出。
我使用 Konsole 作为终端模拟器,所以我可以这样写命令:

konsole -e 'sh -c "./prog;read -p done"'

这样会新窗口执行程序并且最后输出一行’done’。
然后就是一些 Vim 的知识了。不再赘述。

Color

Molokai 不错,但是这个不是自带主题。
evening 是很经典的一个自带主题,赛场你可以用它。

gt 下一个标签

Tree-views

My .vimrc

set number "行号
set hls "高亮搜索结果
set go= "隐藏gvim顶栏
set autoread "自动重新加载文件
set cindent " 自动缩进
set shiftwidth=2 "缩进大小
set tabstop=2 "tab大小
set makeprg=g++\ %\ -Wall\ -g
map<F10> :!konsole -e 'sh -c "./a.out;read -p done;"'<Enter>
map<F12> :w<Enter>:make<Enter>
map<F11> <F12><Enter><F10>
inoremap { {}<Esc>i "{}补全
colo molokai
sy on "语法高亮

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK