wim 显示 配置在/etc/vim文件夹下,新建vimrc.local

把下面内容复制到vimrc.local中

在vimrc中添加

if filereadable(”/etc/vim/vimrc.local“)

source /etc/vim/vimrc.local

endif

即可

"下面是小小的配置

set nocompatible
set number
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
syntax on


"自动对齐
"set autoindent
"set smartindent

"设置匹配模式 类似输入作括号时自动匹配左括号
set showmatch

"查找高亮显示
set hlsearch

"取消高亮设置
"set nohlsearch

 
"查找补全
set incsearch

"修改文件自动产生备份
set backup

"高亮显示当前行

"颜色方案

"colorscheme torte

"colorscheme darkblue

set cursorline

if has('mouse')

  set mouse=

endif

 

"set clipboard+=unnamed

"ctags设置

"filetype plugin indent on

"set completeopt=longest,menu


"自动补全快捷键

"inoremap             

"inoremap             

"inoremap             

"inoremap             

"根据文件内关键字补全

"inoremap     

"整行补全                        CTRL-X CTRL-L

"根据当前文件里关键字补全        CTRL-X CTRL-N

"根据字典补全                    CTRL-X CTRL-K

"根据同义词字典补全              CTRL-X CTRL-T

"根据头文件内关键字补全          CTRL-X CTRL-I

"根据标签补全                    CTRL-X CTRL-]

"补全文件名                      CTRL-X CTRL-F

"补全宏定义                      CTRL-X CTRL-D

"补全vim命令                     CTRL-X CTRL-V

"用户自定义补全方式              CTRL-X CTRL-U

"拼写建议                        CTRL-X CTRL-S

 


 

"自定义代码高亮显示

function! ToggleSyntax()

  if exists("g:syntax_on")

        syntax off

  else

        syntax enable

  endif

endfunction

"自定义快捷键 打开关闭 代码高亮显示

nmap   ;s  :call ToggleSyntax()

 

"空格下翻一页

nmap

 

"标题居中

function! CapitalizeCenterAndMoveDown()

   s/\<./\u&/g   "Built-in substitution capitalizes each word

   center        "Built-in center command centers entire line

   +1            "Built-in relative motion (+1 line down)

endfunction

"\c快捷键标题居中

nmap   \c  :call CapitalizeCenterAndMoveDown()

 

"F8 打开或关闭TagList

nnoremap :TlistToggle

 

"Taglist设置-----------------

"自动打开TagList

let g:Tlist_Auto_Open=1

"退出最后一个VIM窗口退出Taglist

let g:Tlist_Exit_OnlyWindow=1

"同时现出多个Tag,只显示当前其它折叠

let g:Tlist_File_Fold_Auto_Close=1

"设置Tag在右侧显示

"let g:Tlist_Use_Right_Window=1

"显示taglist菜单

let g:Tlist_Show_Menu=1

"让vim记忆上次编辑的位置
autocmd BufReadPost *
            \ if line("'\"")>0&&line("'\"")<=line("$") |
            \   exe "normal g'\"" |
            \ endif
"让vim记忆上次编辑的位置
 


set encoding=utf-8 fileencodings=ucs-bom,utf-8,cp936
 

你可能感兴趣的:(ubuntu)