zoukankan      html  css  js  c++  java
  • vim的一些基本配置

      本文介绍了一些使用vim的基本配置,具体参见配置文件注释。

      vim很强大,关键还要看应用场景,这个配置只是我用来编写一些编程题的时候用的。至于代码目录结构、智能提示和自动补全,这个配置并没有涉及。

     1 " All system-wide defaults are set in $VIMRUNTIME/debian.vim and sourced by
     2 " the call to :runtime you can find below.  If you wish to change any of those
     3 " settings, you should do it in this file (/etc/vim/vimrc), since debian.vim
     4 " will be overwritten everytime an upgrade of the vim packages is performed.
     5 " It is recommended to make changes after sourcing debian.vim since it alters
     6 " the value of the 'compatible' option.
     7 
     8 " This line should not be removed as it ensures that various options are
     9 " properly set to work with the Vim-related packages available in Debian.
    10 runtime! debian.vim
    11 
    12 " Uncomment the next line to make Vim more Vi-compatible
    13 " NOTE: debian.vim sets 'nocompatible'.  Setting 'compatible' changes numerous
    14 " options, so any other options should be set AFTER setting 'compatible'.
    15 " set compatible
    16 
    17 " Vim5 and later versions support syntax highlighting. Uncommenting the next
    18 " line enables syntax highlighting by default.
    19 if has("syntax")
    20   syntax on
    21 endif
    22 
    23 " If using a dark background within the editing area and syntax highlighting
    24 " turn on this option as well
    25 "set background=dark
    26 
    27 " Uncomment the following to have Vim jump to the last position when
    28 " reopening a file
    29 "if has("autocmd")
    30 "  au BufReadPost * if line("'"") > 1 && line("'"") <= line("$") | exe "normal! g'"" | endif
    31 "endif
    32 
    33 " Uncomment the following to have Vim load indentation rules and plugins
    34 " according to the detected filetype.
    35 "if has("autocmd")
    36 "  filetype plugin indent on
    37 "endif
    38 
    39 " The following are commented out as they cause vim to behave a lot
    40 " differently from regular Vi. They are highly recommended though.
    41 set showcmd        " Show (partial) command in status line.
    42 set showmatch        " Show matching brackets.
    43 set hlsearch        " 搜索高亮显示
    44 "set ignorecase        " Do case insensitive matching
    45 "set smartcase        " Do smart case matching
    46 "set incsearch        " Incremental search
    47 "set autowrite        " Automatically save before commands like :next and :make
    48 "set hidden        " Hide buffers when they are abandoned
    49 "set mouse=a        " Enable mouse usage (all modes)
    50 
    51 " Source a global configuration file if available
    52 if filereadable("/etc/vim/vimrc.local")
    53   source /etc/vim/vimrc.local
    54 endif
    55 
    56 set nu              "设置行号
    57 set cursorline      "突显当前行
    58 set cursorcolumn    "突显当前列
    59 set autoread        "文件改动后自动加载修改后的文件
    60 set autoindent      "换行后自动缩进
    61 set tabstop=4       "Tab键的空格个数
    62 set encoding=utf-8  "编码格式
    63 set t_Co=256        "配色
    64 
    65 " 命令模式下,底部操作指令按下 Tab 键自动补全。第一次按下 Tab,会显示所有匹配的操作指令的清单;第二次按下 Tab,会依次选择各个指令。
    66 set wildmenu
    67 set wildmode=longest:list,full
    68 
    69 set lines=55 columns=100 "设置窗口大小
    你的每一个点赞、一句留言,都将是是博主前进的动力,欢迎交流,共同进步——
  • 相关阅读:
    linux查看端口被占用等常用命令
    python批量修改文件内容及文件编码方式的处理
    为什么在Python里推荐使用多进程而不是多线程
    python小练习之读取文件写入excel
    python 小练习之生成手机号码
    python 小练习之删除文件夹下的所有文件,包括子文件夹中的文件
    python中 字符 字典 列表之间的转换
    统计表中 重复出现 XX次以上的数据
    java数据类型
    字符编码和python使用encode,decode转换utf-8, gbk, gb2312
  • 原文地址:https://www.cnblogs.com/wenzhixin/p/14495677.html
Copyright © 2011-2022 走看看