美文网首页
Debian9开发环境设置

Debian9开发环境设置

作者: 发条蛙 | 来源:发表于2017-11-18 11:15 被阅读0次

    语言设定

    1. 设置语言环境为中文:
      编辑文件/etc/default/locale,内容改为:
      LANG="en_US.UTF-8"
      LANGUAGE="en_US:en"
      

    工具设定

    1. 安装常用软件:
      apt-get install aptitude 
      aptitude install net-tools clang lldb git curl tree cloc python2.7-dev python3.5-dev build-essential ycmd sysstat cmake automake
      

    vim安装

    使用aptitude安装的vim或neovim都不支持python,因此需要自己手动编译安装,步骤如下:

    cd ~
    git clone https://github.com/vim/vim.git
    cd vim
    ./configure --with-features=huge \
                --enable-multibyte \
                --enable-rubyinterp=yes \
                --enable-pythoninterp=yes \
                --with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu \
                --enable-python3interp=yes \
                --with-python3-config-dir=/usr/lib/python3.5/config-3.5m-x86_64-linux-gnu \
                --enable-perlinterp=yes \
                --enable-luainterp=yes \
                --enable-gui=gtk2 \
                --enable-cscope \
                --prefix=/usr/local
    make 
    make install
    

    vim设定

    pathogen

    1. 安装:
      mkdir -p ~/.vim/autoload ~/.vim/bundle && \
      curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
      
    2. 配置:
      execute pathogen#infect()
      syntax on
      filetype plugin indent on
      

    vim-colors-solarized

    1. 安装:
      cd ~/.vim/bundle
      git clone https://github.com/altercation/vim-colors-solarized
      
    2. 配置:
      let g:solarized_termcolors=256
      set background=dark
      colorscheme solarized
      

    YouCompleteMe

    1. 安装:
      cd ~/.vim/bundle
      git clone https://github.com/valloric/youcompleteme
      cd ~/.vim/bundle/youcompleteme
      git submodule update --init --recursive
      ./install.py --clang-completer
      
    2. 配置:
      set encoding=utf-8
      let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/youcompleteme/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
      

    vim-flake8

    1. 安装:
      cd ~/.vim/bundle
      git clone https://github.com/nvie/vim-flake8
      
    2. 配置:
      autocmd BufWritePost *.py call Flake8()
      

    vim-airline

    1. 安装:
      cd ~/.vim/bundle
      git clone https://github.com/bling/vim-airline
      

    taglist

    1. 安装:
      cd ~/.vim/bundle
      git clone https://github.com/vim-scripts/taglist.vim
      

    syntastic

    1. 安装:
      cd ~/.vim/bundle
      git clone https://github.com/scrooloose/syntastic
      
    2. 设置:
      set statusline+=%#warningmsg#
      set statusline+=%{SyntasticStatuslineFlag()}
      set statusline+=%*
      
      let g:syntastic_always_populate_loc_list = 1
      let g:syntastic_auto_loc_list = 1
      let g:syntastic_check_on_open = 1
      let g:syntastic_check_on_wq = 0
      

    nerdcommenter

    1. 安装:
      cd ~/.vim/bundle
      git clone https://github.com/scrooloose/nerdcommenter
      
    2. 配置:
      " Add spaces after comment delimiters by default
      let g:NERDSpaceDelims = 1
      
      " Use compact syntax for prettified multi-line comments
      let g:NERDCompactSexyComs = 1
      
      " Align line-wise comment delimiters flush left instead of following code indentation
      let g:NERDDefaultAlign = 'left'
      
      " Set a language to use its alternate delimiters by default
      let g:NERDAltDelims_java = 1
      
      " Add your own custom formats or override the defaults
      let g:NERDCustomDelimiters = { 'c': { 'left': '/**','right': '*/' } }
      
      " Allow commenting and inverting empty lines (useful when commenting a region)
      let g:NERDCommentEmptyLines = 1
      
      " Enable trimming of trailing whitespace when uncommenting
      let g:NERDTrimTrailingWhitespace = 1
      

    vim其他设置

    一些最基础的设置:

    set number
    set tabstop=4
    set softtabstop=4
    set shiftwidth=4
    set expandtab
    set colorcolumn=80
    hi ColorColumn ctermbg=gray
    match ErrorMsg '\%>80v.\+'
    autocmd BufWritePre *.py :%s/ \+$//ge
    

    TO BE

    相关文章

      网友评论

          本文标题:Debian9开发环境设置

          本文链接:https://www.haomeiwen.com/subject/homrvxtx.html