Package vim is not available, but is referred to by another package及我的vim配置

在新安装的Ubuntu系统上尝试安装vim时遇到包不可用的问题。解决方案耗时较长。个人vim配置受他人启发,主要配置保存在.vimrc文件中,此处发布主要是为了备份。
摘要由CSDN通过智能技术生成

新安装的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   
  • 3
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值