Merge pull request #3028 from XLCYun/master

Update 20150713 How to manage Vim plugins
This commit is contained in:
ictlyh 2015-07-15 11:09:55 +08:00
commit aba6df4eb9
3 changed files with 229 additions and 82 deletions

View File

@ -1,82 +0,0 @@
How To Fix System Program Problem Detected In Ubuntu 14.04
================================================================================
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/system_program_Problem_detected.jpeg)
For the last couple of weeks, (almost) every time I was greeted with **system program problem detected on startup in Ubuntu 15.04**. I ignored it for sometime but it was quite annoying after a certain point. You wont be too happy as well if you are greeted by a pop-up displaying this every time you boot in to the system:
> System program problem detected
>
> Do you want to report the problem now?
>
> ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/System_Program_Problem_Detected.png)
I know if you are an Ubuntu user you might have faced this annoying pop-up sometimes for sure. In this post we are going to see what to do with “system program problem detected” report in Ubuntu 14.04 and 15.04.
### What to do with “system program problem detected” error in Ubuntu? ###
#### So what exactly is this notifier all about? ####
Basically, this notifies you of a crash in your system. Dont panic by the word crash. Its not a major issue and your system is very much usable. It just that some program crashed some time in the past and Ubuntu wants you to decide whether or not you want to report this crash report to developers so that they could fix this issue.
#### So, we click on Report problem and it will vanish? ####
No, not really. Even if you click on report problem, youll be ultimately greeted with a pop up like this:
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Ubuntu_Internal_error.png)
[Sorry, Ubuntu has experienced an internal error][1] is the apport that will further open a web browser and then you can file a bug report by logging or creating an account with [Launchpad][2]. You see, it is a complicated procedure which will take around four steps to complete.
#### But, I want to help developers and let them know of the bugs! ####
Thats very thoughtful of you and the right thing to do. But there are two issues here. First, there are high chances that the bug would have already been reported. Second, even if you take the pain of reporting the crash, its not a guarantee that you wont see it again.
#### So, you suggesting to not report the crash? ####
Yes and no. Report the crash when you see it the first time, if you want. You can see the crashing program under “Show Details” in the above picture. But if you see it repetitively or if you do not want to report the bug, I advise you to get rid of the system crash once and for all.
### Fix “system program problem detected” error in Ubuntu ###
The crash reports are stored in /var/crash directory in Ubuntu. If you look in to this directory, you should see some files ending with crash.
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Crash_reports_Ubuntu.jpeg)
What I suggest is that you delete these crash reports. Open a terminal and use the following command:
sudo rm /var/crash/*
This will delete all the content of directory /var/crash. This way you wont be annoyed by the pop up for the programs crash that happened in the past. But if a programs crashes again, youll again see system program problem detected error. You can either remove the crash reports again, like we just did, or you can disable the Apport (debug tool) and permanently get rid of the pop-ups.
#### Permanently get rid of system error pop up in Ubuntu ####
If you do this, youll never be notified about any program crash that happens in the system. If you ask my view, I would say its not that bad a thing unless you are willing to file bug reports. If you have no intention of filing a bug report, the crash notifications and their absence will make no difference.
To disable the Apport and get rid of system crash report completely, open a terminal and use the following command to edit the Apport settings file:
gksu gedit /etc/default/apport
The content of the file is:
# set this to 0 to disable apport, or to 1 to enable it
# you can temporarily override this with
# sudo service apport start force_start=1
enabled=1
Change the **enabled=1** to **enabled=0**. Save and close the file. You wont see any pop up for crash reports after doing this. Obvious to point out that if you want to enable the crash reports again, you just need to change the same file and put enabled as 1 again.
#### Did it work for you? ####
I hope this tutorial helped you to fix system program problem detected in Ubuntu 14.04 and Ubuntu 15.04. Let me know if this tip helped you to get rid of this annoyance.
--------------------------------------------------------------------------------
via: http://itsfoss.com/how-to-fix-system-program-problem-detected-ubuntu/
作者:[Abhishek][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://itsfoss.com/author/abhishek/
[1]:http://itsfoss.com/how-to-solve-sorry-ubuntu-12-04-has-experienced-an-internal-error/
[2]:https://launchpad.net/

View File

@ -0,0 +1,80 @@
如何修复ubuntu 14.04中检测到系统程序错误的问题
================================================================================
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/system_program_Problem_detected.jpeg)
在过去的几个星期,(几乎)每次都有消息 **Ubuntu 15.04在启动时检测到系统程序错误system program problem detected on startup in Ubuntu 15.04)** 跑出来“欢迎”我。那时我是直接忽略掉它的,但是这种情况到了某个时刻,它就让人觉得非常烦人了!
> 检测到系统程序错误(System program problem detected)
>
> 你想立即报告这个问题吗?
>
> ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/System_Program_Problem_Detected.png)
我肯定地知道如果你是一个Ubuntu用户你可能曾经也遇到过这个恼人的弹窗。在本文中我们将探讨在Ubuntu 14.04和15.04中遇到"检测到系统程序错误(system program problem detected)"时 应该怎么办。
### 怎么解决Ubuntu中"检测到系统程序错误"的错误 ###
#### 那么这个通知到底是关于什么的? ####
大体上讲它是在告知你你的系统的一部分崩溃了。可别因为“崩溃”这个词而恐慌。这不是一个严重的问题你的系统还是完完全全可用的。只是在以前的某个时刻某个程序崩溃了而Ubuntu想让你决定要不要把这个问题报告给开发者这样他们就能够修复这个问题。
#### 那么,我们点了“报告错误”的按钮后,它以后就不再显示了?####
不,不是的!即使你点了“报告错误”按钮,最后你还是会被一个如下的弹窗再次“欢迎”:
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Ubuntu_Internal_error.png)
[对不起Ubuntu发生了一个内部错误(Sorry, Ubuntu has experienced an internal error)][1]是一个Apport(Apport是Ubuntu中错误信息的收集报告系统,详见Ubuntu Wiki中的Apport篇,译者注),它将会进一步的打开网页浏览器,然后你可以通过登录或创建[Launchpad][2]帐户来填写一份漏洞Bug)报告文件。你看,这是一个复杂的过程,它要花整整四步来完成.
#### 但是我想帮助开发者,让他们知道这个漏洞啊 !####
你这样想的确非常地周到体贴,而且这样做也是正确的。但是这样做的话,存在两个问题。第一,存在非常高的概率,这个漏洞已经被报告过了;第二,即使你报告了个这次崩溃,也无法保证你不会再看到它。
#### 那么,你的意思就是说别报告这次崩溃了?####
也不对。如果你想的话在你第一次看到它的时候报告它。你可以在上面图片显示的“显示细节Show Details)”中查看崩溃的程序。但是如果你总是看到它或者你不想报告漏洞Bug),那么我建议你还是一次性摆脱这个问题吧。
### 修复Ubuntu中“检测到系统程序错误”的错误 ###
这些错误报告被存放在Ubuntu中目录/var/crash中。如果你翻看这个目录的话应该可以看到有一些以crash结尾的文件。
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Crash_reports_Ubuntu.jpeg)
我的建议是删除这些错误报告。打开一个终端,执行下面的命令:
sudo rm /var/crash/*
这个操作会删除所有在/var/crash目录下的所有内容。这样你就不会再被这些报告以前程序错误的弹窗所扰。但是如果有一个程序又崩溃了你就会再次看到“检测到系统程序错误”的错误。你可以再次删除这些报告文件或者你可以禁用Apport来彻底地摆脱这个错误弹窗。
#### 彻底地摆脱Ubuntu中的系统错误弹窗 ####
如果你这样做,系统中任何程序崩溃时,系统都不会再通知你。如果你想问问我的看法的话,我会说,这不是一件坏事,除非你愿意填写错误报告。如果你不想填写错误报告,那么这些错误通知存不存在都不会有什么区别。
要禁止Apport并且彻底地摆脱Ubuntu系统中的程序崩溃报告打开一个终端输入以下命令
gksu gedit /etc/default/apport
这个文件的内容是:
# set this to 0 to disable apport, or to 1 to enable it
# 设置0表示禁用Apportw或者1开启它。译者注下同。
# you can temporarily override this with
# 你可以用下面的命令暂时关闭它:
# sudo service apport start force_start=1
enabled=1
把**enabled=1**改为**enabled=0**.保存并关闭文件。完成之后你就再也不会看到弹窗报告错误了。很显然如果我们想重新开启错误报告功能只要再打开这个文件把enabled设置为1就可以了。
#### 你的有效吗? ####
我希望这篇教程能够帮助你修复Ubuntu 14.04和Ubuntu 15.04中检测到系统程序错误的问题。如果这个小窍门帮你摆脱了这个烦人的问题,请让我知道。
--------------------------------------------------------------------------------
via: http://itsfoss.com/how-to-fix-system-program-problem-detected-ubuntu/
作者:[Abhishek][a]
译者:[XLCYun](https://github.com/XLCYun)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://itsfoss.com/author/abhishek/
[1]:http://itsfoss.com/how-to-solve-sorry-ubuntu-12-04-has-experienced-an-internal-error/
[2]:https://launchpad.net/

View File

@ -0,0 +1,149 @@
如何管理Vim插件
================================================================================
Vim是Linux上一个轻量级的通用文本编辑器。虽然它开始时的学习曲线对于一般的Linux用户来说可能很困难但比起它的好处这些付出完全是值得的。随着功能的增长在插件工具的应用下Vim是完全可定制的。但是由于它高级的功能配置你需要花一些时间去了解它的插件系统然后才能够有效地去个性化定置Vim。幸运的是我们已经有一些工具能够使我们在使用Vim插件时更加轻松。而我日常所使用的就是Vundle.
### 什么是Vundle ###
[Vundle][1]是一个vim插件管理器用于支持Vim包。Vundle能让你很简单地实现插件的安装升级搜索或者清除。它还能管理你的运行环境并且在标签方面提供帮助。
### 安装Vundle ###
首先如果你的Linux系统上没有Git的话先[安装Git][2].
接着创建一个目录Vim的插件将会被下载并且安装在这个目录上。默认情况下这个目录为~/.vim/bundle。
$ mkdir -p ~/.vim/bundle
现在安装Vundle如下。注意Vundle本身也是一个vim插件。因此我们同样把vundle安装到之前创建的目录~/.vim/bundle下。
$ git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
### 配置Vundle ###
现在配置你的.vimrc文件如下
set nocompatible " This is required
" 这是被要求的。(译注:中文注释为译者所加,下同。)
filetype off " This is required
" 这是被要求的。
" Here you set up the runtime path 
" 在这里设置你的运行时环境的路径。
set rtp+=~/.vim/bundle/Vundle.vim
" Initialize vundle 
" 初始化vundle
call vundle#begin()
" This should always be the first 
" 这一行应该永远放在前面。
Plugin 'gmarik/Vundle.vim'
" This examples are from https://github.com/gmarik/Vundle.vim README
" 这个示范来自https://github.com/gmarik/Vundle.vim README
Plugin 'tpope/vim-fugitive'
" Plugin from http://vim-scripts.org/vim/scripts.html
" 取自http://vim-scripts.org/vim/scripts.html的插件
Plugin 'L9'
" Git plugin not hosted on GitHub
" Git插件但并不在GitHub上。
Plugin 'git://git.wincent.com/command-t.git'
"git repos on your local machine (i.e. when working on your own plugin)
"本地计算机上的Git仓库路径 例如当你在开发你自己的插件时
Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
" vim脚本sparkup存放在这个名叫vim的仓库下的一个子目录中。
" 提交这个路径来正确地设置运行时路径
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Avoid a name conflict with L9
" 避免与L9发生名字上的冲突
Plugin 'user/L9', {'name': 'newL9'}
"Every Plugin should be before this line
"所有的插件都应该在这一行之前。
call vundle#end() " required 被要求的
容我简单解释一下上面的设置默认情况下Vundle将从github.com或者vim-scripts.org下载和安装vim插件。你也可以改变这个默认行为。
要从github安装安装插件译者注下同:
Plugin 'user/plugin'
要从http://vim-scripts.org/vim/scripts.html处安装:
Plugin 'plugin_name'
要从另外一个git仓库中安装:
Plugin 'git://git.another_repo.com/plugin'
从本地文件中安装:
Plugin 'file:///home/user/path/to/plugin'
你同样可以定制其它东西,例如你的插件运行时路径,当你自己在编写一个插件时,或者你只是想从其它目录——而不是~/.vim——中加载插件时这样做就非常有用。
Plugin 'rstacruz/sparkup', {'rtp': 'another_vim_path/'}
如果你有同名的插件,你可以重命名你的插件,这样它们就不会发生冲突了。
Plugin 'user/plugin', {'name': 'newPlugin'}
### 使用Vum命令 ###
一旦你用vundle设置好你的插件你就可以通过几个vundle命令来安装升级搜索插件或者清除没有用的插件。
#### 安装一个新的插件 ####
所有列在你的.vimrc文件中的插件都会被PluginInstall命令安装。你也可以通递一个插件名给它来安装某个的特定插件。
:PluginInstall
:PluginInstall <插件名>
![](https://farm1.staticflickr.com/559/18998707843_438cd55463_c.jpg)
#### 清除没有用的插件 ####
如果你有任何没有用到的插件,你可以通过PluginClean命令来删除它.
:PluginClean
![](https://farm4.staticflickr.com/3814/19433047689_17d9822af6_c.jpg)
#### 查找一个插件 ####
如果你想从提供的插件清单中安装一个插件,搜索功能会很有用
:PluginSearch <文本>
![](https://farm1.staticflickr.com/541/19593459846_75b003443d_c.jpg)
在搜索的时候,你可以在交互式分割窗口中安装,清除,重新搜索或者重新加载插件清单.安装后的插件不会自动加载生效,要使其加载生效,可以将它们添加进你的.vimrc文件中.
### 总结 ###
Vim是一个妙不可言的工具.它不单单是一个能够使你的工作更加顺畅高效的默认文本编辑器,同时它还能够摇身一变,成为现存的几乎任何一门编程语言的IDE.
注意,有一些网站能帮你找到适合的vim插件.猛击[http://www.vim-scripts.org][3], Github或者 [http://www.vimawesome.com][4] 获取新的脚本或插件.同时记得为你的插件使用帮助供应程序.
和你最爱的编辑器一起嗨起来吧!
--------------------------------------------------------------------------------
via: http://xmodulo.com/manage-vim-plugins.html
作者:[Christopher Valerio][a]
译者:[XLCYun(袖里藏云)](https://github.com/XLCYun)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://xmodulo.com/author/valerio
[1]:https://github.com/VundleVim/Vundle.vim
[2]:http://ask.xmodulo.com/install-git-linux.html
[3]:http://www.vim-scripts.org/
[4]:http://www.vimawesome.com/