[VIM] active “Backspace” key in keyboard with .vimrc

My “Backspace” was not working ! What’s wrong !

You know it is expensive to change a keyboard when they are expire the guarantee period. My laptop was brought in 2006. 😦

I’m joking….

So if you want to active your “Backspace” key in VIM, what you have to do is insert this option in your .vimrc :

set backspace=indent, eol, start

Simple ? So we don’t have to pay for the keyboard 🙂

Advertisements

[VIM] configure VIM with .vimrc in Ubuntu

In Ubuntu, to install VIM (if it is not installed by default)

sudo apt-get install vim

In my PC, there is no configuration file which is called .vimrc, what we have to do is just create it.

cd ~
vim .vimrc

The configuration (it will work automatically) :

set nocompatible        "不使用vi默认键盘布局   (Not use default keyboard configue)
set number              "显示行号 (Show line number)
set autoindent          "自动对齐 
set smartindent         "智能对齐
set showmatch           "括号匹配模式
set ruler               "显示状态行
set incsearch           "查询时非常方便,如要查找book单词,当输入到/b时,会自动找到   第一个b开头的单词,当输入到/bo时,会自动找到第一个bo开头的单词,依次类推,进行查找时,使用此设置会快速找到答案,当你找要匹配的单词时,别忘记回车.
set tabstop=4           "tab键为4个空格
set shiftwidth=4        "换行时行间交错使用4个空格
set softtabstop=4       "设置(软)制表符宽度为4
set cindent             "C语言格式对齐
set nobackup           	"不要备份文件
set clipboard+=unnamed  "与windows共享剪贴板