标签归档:Openwrt

Openwrt安装完整版vim,支持代码变色和缩进

Openwrt默认的是vi而不是vim,如果想使用必须安装vim-full,同时要安装vim-runtime

opkg update
opkg install vim-full vim-runtime

我们输入vim就可以看见安装成功

QQ截图20160303225938

然后执行下面的命令编辑vim配置

vim /usr/share/vim/vimrc

同时分享一下我的配置

set showcmd         " show (partial) command in status line
set showmatch       " show matching brackets
set incsearch       " incremental search
set autowrite       " automatically save before commands like :next and :make
set nocompatible    " use vim defaults instead of 100% vi compatibility
set backspace=indent,eol,start  " more powerful backspacing
set autoindent      " always set autoindenting on
set linebreak       " don't wrap words by default
set textwidth=0     " don't wrap lines by default
set ruler           " show the cursor position all the time

set backupskip+=/etc/crontabs.* " fix crontab -e

"set number       "设置行号
syntax on         "语法高亮
filetype on       "文件类型检测
set tabstop=4
set softtabstop=4
set shiftwidth=4