注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

Search的博客

不断学习中!

 
 
 

日志

 
 

.vimrc配置文件备份  

2012-05-05 00:28:55|  分类: ubuntu |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"  => general vim setting
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" set how many lines of history VIM has to remeber
set history=700
" enable filetype plugins
filetype plugin on
filetype indent on
" show line number
set nu
" auto read when a file has been changed from the outside
set autoread
" set the lines to the cursor,when moving vertically with the key j/k
set so=7
" when we are in last line mode,the code completion will show above the command
" line
set wildmenu
" ignore compiled files,when we use e command to open the specified files
set wildignore=*.o,*~,*.pyc
" always show the current position
set ruler
" highlight search results
set hlsearch
" make search act like search in modern browsers,that's once you type one word
" the word will highlight,one more word one more highlight
set incsearch
" don't redraw while excting macros(good performance config)
set lazyredraw
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" =>colors and fonts
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"enable syntax highlighting 
syntax enable
colorscheme desert
set background=dark
" set extra options when running in GUI mode
if has("gui_running")
set guioptions-=T
set guioptions-=e
set t_Co=256
set guitablabel=%M\ %t
endif 
" set utf-8 as standard encoding(auto change other file encoding) and en_US as the standard language
set encoding=utf-8 fileencodings=ucs-bom,utf-8,cp936
" show the status line
" set statusline and in specifed format
set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l\ \ \ [Pos:\ %l,%v][%p%%]
function! HasPaste()
    if &paste
        return 'PASTE MODE'
    en
    return ''
endfunction

"set statusline=%F%m%r%h%w\ \ \ \ \ \ [file:\ %{&ff}]\ \ [Type:\ %Y]\ \ \ \ \ \ [Pos:\ %l,%v][%p%%]\ \ [Len:\ %l/%L]
set laststatus=2
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Files, backups and undo
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set nobackup
set nowb
set noswapfile
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"=> Text, tab and indent related
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Use spaces instead tabs
set expandtab
" set 1 tab=4 spaces
set shiftwidth=4
set tabstop=4
" Linebreak on 500 characters
set lbr
set tw=500
" Auto indent
set ai
" Smart indent
set si
" Wrap lines
set wrap

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"=> Visual Model Related
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" search the current selected word
vnoremap <slient> * :call VisualSelection('f')<CR>
vnoremap <slient> # :call VisualSelection('b')<CR>

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Moving around, tabs, windows and buffers
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Treat long lines as bread lines(useful when moving around in them)
map j gj
map k gk
" Map <Space> to / (search) and Ctr-<Space> to ?(backwards search)
map <space> /
map <c-space> ?
" Smart way to move between windows
nnoremap <c-h> <c-w>h
nnoremap <c-j> <c-w>j
nnoremap <c-k> <c-w>k
nnoremap <c-l> <c-w>h
" Increase and decrease window width and height
nnoremap <C-S-Left> 5<c-w><
nnoremap <C-S-Down> 5<c-w>-
nnoremap <C-S-Up> 4<c-w>+
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Plugins Configuration
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Create tags
set tags+=/home/lxy/.vim/sys_tags
nmap <F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
" Tlist Configuration
"only show one file's tag
let Tlist_Show_One_File=1
"when there's only window,exit vim
let Tlist_Exit_OnlyWindow=1
"show taglist menu
let Tlist_Show_Menu=1
"auto update tags
nmap <silent> <F7> :TlistUpdate<cr>
"combine taglist and winmanager,and show them together
let g:winManagerWindowLayout='FileExplorer|TagList'
nmap <silent> <F8> :WMToggle<cr>
" OmniCpp configuration
set completeopt=menu
let OmniCpp_MayCompleteDot = 1 " autocomplete with .
let OmniCpp_MayCompleteArrow = 1 " autocomplete with ->
let OmniCpp_MayCompleteScope = 1 " autocomplete with ::
let OmniCpp_SelectFirstItem = 2 " select first item (but don't insert)
let OmniCpp_NamespaceSearch = 2 " search namespaces in this and included files
let OmniCpp_ShowPrototypeInAbbr = 1 " show function prototype  in popup window
let OmniCpp_GlobalScopeSearch=1
let OmniCpp_DisplayMode=1
let OmniCpp_DefaultNamespaces=["std"]
:inoremap ( ()<ESC>i
:inoremap ) <c-r>=ClosePair(')')<CR>
:inoremap { {}<ESC>i
:inoremap } <c-r>=ClosePair('}')<CR>
:inoremap [ []<ESC>i
:inoremap ] <c-r>=ClosePair(']')<CR>
:inoremap < <><ESC>i
:inoremap > <c-r>=ClosePair('>')<CR>
:inoremap " ""<ESC>i
:inoremap ' ''<ESC>i
function Closepair(char)
    if getline('.')[col('.')-1]==a:char
        return "\<Right>"
    else
        return a:char
    endif
endfunction
  评论这张
 
阅读(128)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017