新安装的ubuntu,先安装vim,但是安装出现
Reading package lists... Done Building dependency tree Reading state information... Done Package vim is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package vim has no installation candidate
[解决方案]:
sudo apt-get update && sudo apt-get install vim
时间可能有点长
我个人的vim配置,比较习惯,是参考一个大哥的写法,
上面是自动添加的东西,主要配置在.vimrc中,还有其他的地方,放在这里主要也是为自己备份
1 map <F9> :call SaveInputData()<CR> 2 func! SaveInputData() 3 exec "tabnew" 4 exec 'normal "+gP' 5 exec "w! /tmp/input_data" 6 endfunc 7 "colorscheme torte 8 "colorscheme murphy 9 "colorscheme desert 10 "colorscheme desert 11 "colorscheme elflord 12 colorscheme ron 13 14 "my setting" 15 16 "tags" 17 ":set tags=/home/jyg/linux-2.6.35.7/tags 18 19 "remember last update or view postion" 20 if has("autocmd") 21 " In text files, always limit the width of text to 78 characters 22 autocmd BufRead *.txt set tw=78 23 " When editing a file, always jump to the last cursor position 24 autocmd BufReadPost * 25 \ if line("'\"") > 0 && line ("'\"") <= line("$") | 26 \ exe "normal g'\"" | 27 \ endif 28 endif 29 30 "end of my setting" 31 32 33 "set fencs=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936 34 "set termencoding=utf-8 35 "set encoding=utf-8 36 "set fileencodings=ucs-bom,utf-8,cp936 37 "set fileencoding=utf-8 38 39 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 40 " 显示相关 41 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 42 "set shortmess=atI " 启动的时候不显示那个援助乌干达儿童的提示 43 "winpos 5 5 " 设定窗口位置 44 "set lines=40 columns=155 " 设定窗口大小 45 set go= " 不要图形按钮 46 "color asmanian2 " 设置背景主题 47 "set guifont=Courier_New:h10:cANSI " 设置字体 48 "syntax on " 语法高亮 49 autocmd InsertLeave * se nocul " 用浅色高亮当前行 50 autocmd InsertEnter * se cul " 用浅色高亮当前行 51 "set ruler " 显示标尺 52 set showcmd " 输入的命令显示出来,看的清楚些 53 "set cmdheight=1 " 命令行(在状态行下)的高度,设置为1 54 "set whichwrap+=<,>,h,l " 允许backspace和光标键跨越行边界(不建议) 55 "set scrolloff=3 " 光标移动到buffer的顶部和底部时保持3行距离 56 set novisualbell " 不要闪烁(不明白) 57 set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ %{strftime(\"%d/%m/%y\ -\ %H:%M\")} "状态行显示的内容 58 set laststatus=1 " 启动显示状态行(1),总是显示状态行(2) 59 set foldenable " 允许折叠 60 set foldmethod=manual