设为首页 收藏本站
查看: 1052|回复: 0

[经验分享] ubuntu16.04打造vim和python3的IDE

[复制链接]

尚未签到

发表于 2019-2-18 12:34:16 | 显示全部楼层 |阅读模式
  ubuntu16.04 安装支持python3的IDE
1. 安装vim:
# apt-get install  -y vim-gnome
2. 安装ctags,ctags用于支持taglist
# apt-get install ctags
3. 安装taglist
# apt-get install vim-scripts vim-addon-manager
# vim-addons install taglist
4. 安装pydiction 实现代码补全:
#wget  https://www.vim.org/scripts/script.php?script_id=850/pydiction-1.2.3.zip
# unzip pydiction-1.2.3.zip
# cd pydiction/after/ftplugin/
# mkdir /usr/share/vim/vim74/pydiction
# cp  -rp python_pydiction.vim  /usr/share/vim/vim74/ftplugin/
# cp complete-dict pydiction.py  /usr/share/vim/vim74/pydiction/5.安装python_fold自动折叠插件
    下载python_fold.vim:
https://www.vim.org/scripts/script.php?script_id=515
# mv python_fold.vim /usr/share/vim/vim74/plugin/
  #vim /root/.vimrc
set foldmethod=indent

6. 生成ctag序列:
进入到python脚本所在的目录,在该目录下执行:
# ctags -R *
生成一个 ctags 文件,该文件记录了程序/项目的函数、类等的分析序列记录.
7. 安装taglist插件:
下载插件:
https://www.vim.org/scripts/script.php?script_id=273
# unzip taglist_46.zip
# cp plugin/taglist.vim  /usr/share/vim/vim74/plugin/
# cp doc/taglist.txt  /usr/share/vim/vim74/doc/
#vim
:helptags /usr/share/vim/vim74/doc        "生成taglist帮助文件列表。
: help taglist.txt        “查看taglist帮助信息。8. 安装vim  plug:
# mkdir ~/.vim/autoload/
# cd ~/.vim/autoload/
# wget https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
配置vim plug:
#vim  /root/.vimrc
call plug#begin('~/.vim/autoload')                    
Plug 'Valloric/YouCompleteMe'                        
call plug#end()  
#vim  /root/.vimrc
filetype off                  " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/vundle
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'vim-scripts/indentpython.vim'
Bundle 'Valloric/YouCompleteMe'
" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required
call plug#begin('~/.vim/autoload')
Plug 'Valloric/YouCompleteMe'
call plug#end()
set nocompatible "关闭与vi的兼容模式
set number "显示行号
set nowrap    "不自动折行
set showmatch    "显示匹配的括号
set scrolloff=3        "距离顶部和底部3行"
set encoding=utf-8  "编码
set fenc=utf-8      "编码
"set mouse=a        "启用鼠标
set hlsearch        "搜索高亮
syntax on    "语法高亮
set helplang=cn
set encoding=utf-8
"au BufNewFile,BufRead *.py
set tabstop=4
set softtabstop=4
set shiftwidth=4
set textwidth=79
set expandtab
set autoindent
set fileformat=unix
set foldmethod=indent
set autoindent " 实现自动缩进
set foldmethod=indent
set shiftwidth=4
set expandtab
set number
"Flagging Unnecessary Whitespace
highlight BadWhitespace ctermbg=red guibg=darkred
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
filetype plugin on
let g:pydiction_location = '/usr/share/vim/vim74/pydiction/complete-dict'
let g:pydiction_menu_height = 20
autocmd FileType python set omnifunc=pythoncomplete#Complete

let Tlist_Show_One_File = 1   "不同时显示多个文件的tag,只显示当前文件的        
let Tlist_Exit_OnlyWindow = 1 "如果 taglist 窗口是最后一个窗口,则退出 vim         
let Tlist_Use_Right_Window = 1  "在右侧窗口中显示 taglist 窗口      
"let Tlist_Auto_Open=1    "在启动 vim 后,自动打开 taglist 窗口
"let Tlist_File_Fold_Auto_Close=1 "只显示当前文件 tag,其它文件的tag折叠
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   :TlistToggle
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
autocmd FileType python set omnifunc=pythoncomplete#Complete插件安装:
    切换到命令行模式,依次输入
    PlugStatus
    PlugInstall
    就可以安装插件了
    使用vim plug可以方便的管理插件
    查看插件类型:
    :PlugStatus
    安装插件:
    :PlugInstall
    更新插件::PlugUpdate
    vim-plug本身更新::PlugUpgrade  参考:
  
  ubuntu16.04 将Vim打造为强大的Python开发环境:
  https://www.jianshu.com/p/bc19b91354ef
  





运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-673988-1-1.html 上篇帖子: Ubuntu16.04.5 desktop 基本配置及远程桌面 下篇帖子: Ubuntu16.04中安装openoffice
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表