• vim 基础配置


    最近在使用 python 搞服务, 简单配置了一个 vim, 配置了自动补全以及背景色 。(ps:搜狗输入法快捷键占用真是太坑爹,改用谷歌输入法,世界安静了)

    具体配置如下:

    一、 安装插件

    1、克隆 Vundle 到本地: 
     git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim 

    2、 配置  ~/.vimrc 

     1 set nocompatible              " be iMproved, required
      2 filetype off                  " required
      3 
      4 " set the runtime path to include Vundle and initialize
      5 set rtp+=~/.vim/bundle/Vundle.vim
      6 call vundle#begin()
      7 " alternatively, pass a path where Vundle should install plugins
      8 
      9 " let Vundle manage Vundle, required
     10 Plugin 'VundleVim/Vundle.vim'
     11 
     12 " python auto-complete
     13 Plugin 'davidhalter/jedi-vim'
     14 
     15 " tab 
     16 Plugin 'ervandew/supertab'
     17 
     18 " background
     19 Plugin 'altercation/vim-colors-solarized'
     20 
     21 
     22 " All of your Plugins must be added before the following line
     23 call vundle#end()            " required
     24 filetype plugin indent on    " required
     25 
     26 
     27 let g:SuperTabDefaultCompletionType = "context"
     28 let g:jedi#popup_on_dot = 0
     29 
     30 syntax on
     31 set background=dark
     32 colorscheme solarized
     33 let g:solarized_termcolors=256
     34 
     35 set number

    二、 快捷键

    函数跳转功能:

    1、安装 c-tags:  

    sudo apt-get install exuberant-ctags

     2、创建 tags, 在项目文件目录下

    ctags -R *
    "--ctags setting--
    " 按下F5重新生成tag文件,并更新taglist
    map <F5> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR><CR> :TlistUpdate<CR>
    imap <F5> <ESC>:!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR><CR> :TlistUpdate<CR>
    set tags=tags
    set tags+=./tags "add current directory's generated tags file
    set tags+=~/arm/linux-2.6.24.7/tags "add new tags file(刚刚生成tags的路径,在ctags -R 生成tags文件后,不要将tags移动到别的目录,否则ctrl+]时,会提示找不到源码文件)
    
    set tags+=./tags表示在当前工作目录下搜索tags文件
    set tags+=~/arm/linux-2.6.24.7/tags表示在搜寻tags文件的时候,也要搜寻~/arm/linux-2.6.24.7/文件夹下的tags文件。
    然后保存并退出vi。这样,你就可以用vim在任意地方查看有关Linux的函数原形
    ------------------------------------
    tag命令用法:
    Ctrl+]  跳到当前光标下单词的标签
    Ctrl+O  返回上一个标签
    Ctrl+T  返回上一个标签

    3、使用

    跳转: Ctrl + ] 

    返回: Ctrl + T

    参考:https://www.cnblogs.com/zhangsf/archive/2013/06/13/3134409.html

  • 相关阅读:
    uml系列(四)——类图
    Linux设备驱动实现自己主动创建设备节点
    收集了三年的最好的设计站点
    CoInitialize浅析一
    iOS 单例
    Android开发之异步具体解释(二)之AsyncTask
    ComboBox控件
    下拉框Html.DropDownList 和DropDownListFor 的经常用法
    好记心不如烂笔头,ssh登录 The authenticity of host 192.168.0.xxx can&#39;t be established. 的问题
    cidaemon.exe进程cpu占用率高及关闭cidaemon.exe进程方法
  • 原文地址:https://www.cnblogs.com/yaolin1228/p/9338150.html
Copyright © 2020-2023  润新知