编辑环境的搭建---vim

 

大前提:  安装git: sudo apt-get install git-core ,因为后续很多都是github上提供的.

此外,不合理之处望指出(具体原理之类的小的没看过>.<,啪啪啪打脸)


1. Terminal使用Solarized配色

配色主题来自: https://github.com/seebi/dircolors-solarized

以下方案来自: http://blog.csdn.net/lucktroy/article/details/7825805

设置solarized theme for GNU ls:

git clone git://github.com/seebi/dircolors-solarized.git

进行具体的配色(具体的选择见配色主题里说明,下面是指dark256方案):

cp ~/dircolors-solarized/dircolors.256dark ~/.dircolors
eval 'dircolors .dircolors'

设置 Terminal 支持 256 色:

打开vim .bashrc 并在其中添加 export TERM=xterm-256color这段在保存,这样 dircolors for GNU ls 算设置完成了

接下来下载 Solarized 的 Gnome-Terminal 配色:

输入如下语句

git clone git://github.com/sigurdga/gnome-terminal-colors-solarized.git

然后进入下面目录

cd gnome-terminal-colors-solarized

在该目录下运行  ./set_dark.sh 或者 ./set_light.sh (具体取决于你选择的颜色方案)

运行完后你就会默默的发现背景变成暗蓝色了---完成!

 

terminal的替代品->terminator(相对来说更舒服---同样进行配色设置)

配色主题来自: https://github.com/ghuntley/terminator-solarized

主要配置方案也是来自上面介绍

当然先clone方案:

git clone git://github.com/ghuntley/terminator-solarized.git

然后为了便于操作和管理,建立文件夹并将上述clone下来的文件copy到新建的目录文件中

mkdir -p ~/.config/terminator/
cp config ~/.config/terminator/

修改文件中的配置

step1:进入配置文件夹并打开配置"文件"

vi ~/.config/terminator/config

step2:改变config里面的内容

将下述文件内容中的注释#去掉(除了 solarized-dark这句)

[[default]]
# solarized-dark
#palette = "#073642:#d30102:#859900:#b58900:#6c71c4:#d33682:#2aa198:#839496:#586e75:#cb4b16:#859900:#b58900:#268bd2:#d33682:#2aa198:#93a1a1"
#background_color = "#eee8d5"
#cursor_color = "#002b36"
#foreground_color = "#002b36"

(里面的字母配色#eee8d5等可能原作者更新或更改过,无需改动)

然后就完成了,当然有时候里面一些内容也需要修改,详见上述链接中的Usage

2. VIM配置----插件

以下方案主要来自: http://feihu.me/blog/2014/intro-to-vim/

1. 插件管理---Vundle

为了使之后的插件更易于管理

插件来自: https://github.com/gmarik/Vundle.vim

安装方法:(其实github上项目给出了非常详细的说明!赞~)

  1. 将github上的进行克隆(terminal中输入如下语句)
    git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
  2. 配置插件: 输入 vim ~/.vimrc 在里面加入以下代码
    set nocompatible              " be iMproved, required
    filetype off                  " required
    
    " set the runtime path to include Vundle and initialize
    set rtp+=~/.vim/bundle/Vundle.vim
    call vundle#begin()
    " alternatively, pass a path where Vundle should install plugins
    "call vundle#begin('~/some/path/here')
    
    " let Vundle manage Vundle, required
    Plugin 'gmarik/Vundle.vim'
    ""Add the Plugin you wanted follows
    
    
    " All of your Plugins must be added before the following line
    call vundle#end()            " required
    filetype plugin indent on    " required
    " To ignore plugin indent changes, instead use:
    "filetype plugin on
    "
    " Brief help
    " :PluginList       - lists configured plugins
    " :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
    " :PluginSearch foo - searches for foo; append `!` to refresh local cache
    " :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
    "
    " see :h vundle for more details or wiki for FAQ
    " Put your non-Plugin stuff after this lin
  3. 安装插件:运行vim,然后 :PluginInstall 完成后会显示Done!

(以下几个插件很多是基于Vundle)

2. VIM配色方案---此处与之前terminal方案最好一致

插件来源: https://github.com/altercation/solarized

输入 vim ~/.vimrc ,在以下代码之间

call vundle#begin()
"""""""在此下面



"""""""在此上面
call vundle#end()

加入插件代码(还看到过另一种表达方式):

Plugin 'git://github.com/altercation/vim-colors-solarized.git'

再打开vim运行:PluginInstall 就OK了

再修改 .vimrc配置,在其中加入如下语句:

syntax enable
set background=dark
colorscheme solarized

如果想要是light只要set background=light便可

3. 导航与索引---NERDTree

插件来源: https://github.com/scrooloose/nerdtree

安装方法与配色方案基本一致.

在.vimrc中加入语句

Plugin 'git://github.com/scrooloose/nerdtree.git'

在运行vim,输入 :PluginInstall 等待done就ok了(别怀疑没装好,打开vim没看到效果别忙PluginClean,因为默认并没有打开)

由于NerdTree也有很多命令进行操作,详见  http://www.cnblogs.com/mo-beifeng/archive/2011/09/08/2171018.html

.vimrc中加入下面语句(用于打开和关闭导航,此外,有些操作后续配置加上允许鼠标操作便能更快捷,开闭快捷键F2):

map <F2> :NERDTreeMirror<CR>
map <F2> :NERDTreeToggle<CR>

或者

map <silent> <F2> :NERDTreeToggle<CR>

4. Taglist---信息列表

插件来源: https://github.com/vim-scripts/taglist.vim

主要列出了当前文件中的宏、全局变量、函数、类等信息

安装方式与上述均类似

有一点不同之处,需要先安装   ctags:  sudo apt-get install ctags

在.vimrc中加入语句

Plugin 'git://github.com/vim-scripts/taglist.vim.git'

在运行vim,输入 :PluginInstall 等待done就ok了

额外进行的.vimrc配置文件如下(开闭快捷键F3):

let Tlist_Show_One_File=1    "只显示当前文件的tags
let Tlist_WinWidth=30        "设置taglist宽度
let Tlist_Exit_OnlyWindow=1  "tagList窗口是最后一个窗口,则退出Vim
let Tlist_Use_Right_Window=1 "在Vim窗口右侧显示taglist窗口
map <silent> <F3> :TlistToggle<CR>

 

 

此外,额外增加了些特效duang~,参照了 http://www.cnblogs.com/ma6174/archive/2011/12/10/2283393.html 


其余插件还没安装和试过,暂时先过~由于主要在学C(瞬间暴露小的菜鸟本性),过段时间后再补充插件

posted @ 2015-04-13 00:36  Nooooooo  阅读(454)  评论(0编辑  收藏  举报