zoukankan      html  css  js  c++  java
  • Ubuntu 下一个 vim 建立python 周围环境 构造

    于Windows通过使用各种现成的工具使用,去Linux下一个,没有一个关于线索……总之google有些人的经验,折腾来折腾,开发环境也算是一个好工作。

    1. 安装完成vim
    # apt-get install vim-gnome

    2. 安装ctags,ctags用于支持taglist,必需!
    # apt-get install ctags

    3. 安装taglist
    #apt-get install vim-scripts
    #apt-get install vim-addon-manager // 貌似我在安装vim-scripts的时候,已经附带安装了vim-addon-manager
    # vim-addons install taglist

    4. 安装pydiction(实现代码补全)
    #wget http://www.pythonclub.org/_media/python-basic/pydiction-1.2.zip
    #unzip pydiction-1.2.zip

    // ~/.vim/after/ftplugin和~/.vim/tools/pydiction/文件夹默认不存在。须要自行创建
    #cp pydiction-1.2/python_pydiction.vim ~/.vim/after/ftplugin
    #cp pydiction-1.2/complete-dict ~/.vim/tools/pydiction/complete-dict

    5. 编辑配置文件
    # vim ~/.vimrc

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    let Tlist_Auto_Highlight_Tag=1 
    let Tlist_Auto_Open=1 
    let Tlist_Auto_Update=1 
    let Tlist_Display_Tag_Scope=1 
    let Tlist_Exit_OnlyWindow=1 
    let Tlist_Enable_Dold_Column=1 
    let Tlist_File_Fold_Auto_Close=1 
    let Tlist_Show_One_File=1 
    let Tlist_Use_Right_Window=1 
    let Tlist_Use_SingleClick=1 
    nnoremap <silent> <F8> :TlistToggle<CR>  // 设定F8为taglist开关
       
    filetype plugin on 
    autocmd FileType python set omnifunc=pythoncomplete#Complete 
    autocmd FileType javascrīpt set omnifunc=javascriptcomplete#CompleteJS 
    autocmd FileType html set omnifunc=htmlcomplete#CompleteTags 
    autocmd FileType css set omnifunc=csscomplete#CompleteCSS 
    autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags 
    autocmd FileType php set omnifunc=phpcomplete#CompletePHP 
    autocmd FileType c set omnifunc=ccomplete#Complete 
       
       
    let g:pydiction_location='~/.vim/tools/pydiction/complete-dict' 
    set autoindent // 实现自己主动缩进
    set tabstop=4 
    set shiftwidth=4 
    set expandtab 
    set number

    至此,python IDE的环境就算是搭好了。来张完毕图:
    20120919231245
    右边即为taglist窗体,按F8打开,使用Ctrl+w,再按w能够在code窗体和taglist窗体间切换。

    另外

    nerdtree

    一 安装方法

    1. 官方站点: The NERD tree : A tree explorer plugin for navigating the filesystem  下載 NERD_tree.zip(只是我这边官网打不开。于是去csdn下了一份NERDTree.zip
    2. unzip NERD_tree.zip 
    3. mkdir -p ~/.vim/plugin # 假设沒有 plugin 的文件夹,就建立一个
    4. mv plugin/NERD_tree.vim ~/.vim/plugin # 将NERD_tree.vim 移近去就可以
    5. 开启 Vim 后, 输入 :NERDTree 就看到了

    二 经常使用设置

    NERDTree 开启需输入 :NERDTree。关闭时按 q 就可以。也能够增加快捷键开启

    1. vim ~/.vimrc
    2. 增加此行
      1
      nnoremap <silent> <F5> :NERDTree<CR>
    3. 这样按F5就会自己主动展开文件夹树

    三 我觉得经常使用的快捷键

    ctrl + w + w    光标自己主动在左右側窗体切换
    o       展开左側某个文件夹。再按一下就是合并文件夹 
    t       在新 Tab 中打开选中文件/书签,并跳到新 Tab
    T       在新 Tab 中打开选中文件/书签,但不跳到新 Tab
    P       跳到根结点
    p       跳到父结点
    q       关闭 NerdTree 窗体

    更全面的快捷键请參考:http://yang3wei.github.io/blog/2013/01/29/nerdtree-kuai-jie-jian-ji-lu/

    四 效果图

    版权声明:本文博主原创文章。博客,未经同意不得转载。

  • 相关阅读:
    Myeclipse下使用Maven搭建spring boot项目
    Dubbo+Zookeeper视频教程
    dubbo项目实战代码展示
    流程开发Activiti 与SpringMVC整合实例
    交换两个变量的值,不使用第三个变量的四种法方
    数据库主从一致性架构优化4种方法
    数据库读写分离(aop方式完整实现)
    在本地模拟搭建zookeeper集群环境实例
    box-sizing布局
    盒子模型
  • 原文地址:https://www.cnblogs.com/blfshiye/p/4850168.html
Copyright © 2011-2022 走看看