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

我的博客

笨笨猫

 
 
 

日志

 
 

gvimrc.imx.uboot  

2011-11-11 10:00:50|  分类: VIM Script |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
" An example for a vimrc file.
"
" Maintainer:    Bram Moolenaar <Bram@vim.org>
" Last change:    2008 Dec 17
"
" To use it, copy it to
"     for Unix and OS/2:  ~/.vimrc
"          for Amiga:  s:.vimrc
"  for MS-DOS and Win32:  $VIM\_vimrc
"        for OpenVMS:  sys$login:.vimrc

" When started as "evim", evim.vim will already have done these settings.
if v:progname =~? "evim"
  finish
endif

" Use Vim settings, rather than Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible

" allow backspacing over everything in insert mode
set backspace=indent,eol,start

if has("vms")
  set nobackup        " do not keep a backup file, use versions instead
else
  set backup        " keep a backup file
endif
set history=50        " keep 50 lines of command line history
set ruler        " show the cursor position all the time
set showcmd        " display incomplete commands
set incsearch        " do incremental searching

" For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
" let &guioptions = substitute(&guioptions, "t", "", "g")

" Don't use Ex mode, use Q for formatting
map Q gq

" CTRL-U in insert mode deletes a lot.  Use CTRL-G u to first break undo,
" so that you can undo CTRL-U after inserting a line break.
inoremap <C-U> <C-G>u<C-U>

" In many terminal emulators the mouse works just fine, thus enable it.
if has('mouse')
  set mouse=a
endif

" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
  syntax on
  set hlsearch
endif

" Only do this part when compiled with support for autocommands.
if has("autocmd")

  " Enable file type detection.
  " Use the default filetype settings, so that mail gets 'tw' set to 72,
  " 'cindent' is on in C files, etc.
  " Also load indent files, to automatically do language-dependent indenting.
  filetype plugin indent on

  " Put these in an autocmd group, so that we can delete them easily.
  augroup vimrcEx
  au!

  " For all text files set 'textwidth' to 78 characters.
  autocmd FileType text setlocal textwidth=78

  " When editing a file, always jump to the last known cursor position.
  " Don't do it when the position is invalid or when inside an event handler
  " (happens when dropping a file on gvim).
  " Also don't do it when the mark is in the first line, that is the default
  " position when opening a file.
  autocmd BufReadPost *
    \ if line("'\"") > 1 && line("'\"") <= line("$") |
    \   exe "normal! g`\"" |
    \ endif

  augroup END

else

  set autoindent        " always set autoindenting on

endif " has("autocmd")

" Convenient command to see the difference between the current buffer and the
" file it was loaded from, thus the changes you made.
" Only define it when not defined already.
if !exists(":DiffOrig")
  command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis
          \ | wincmd p | diffthis
endif

cs add cscope.out
cs kill 0

let USING_IMX51_UBOOT = 1  

set cindent
set autoindent
set smartindent

"every tab key to jump 4 space
"set tabstop=4
"set softtabstop=4

set expandtab

"This is for gg=G =a} to format code
set shiftwidth=4

"ts=tabstop sw:shiftwidth
set ts=8 sw=8 cin

set fileformat=unix
set showcmd

set showmatch
set smartcase
set noincsearch
set hlsearch
set nu

set ch=2        " Make command line two lines high

set mousehide        " Hide the mouse when typing text

syntax on

set go-=m
set go-=T
"colorscheme desert
"colorscheme murphy
colorscheme desertEx
set nobackup

map ,;  $a;<ESC>

"used for printf("...", param1, param2)  params input
map  ,,  $F)i,

map <C-x><C-q>  :set modifiable<cr>
map <C-q><C-x>  :set nomodifiable<cr>
map <C-c>  :tabclose<cr>

"comments here
"one line comment
map ,c  cc<ESC>I/* */<ESC>^la

"after this line comment
map <M-a> A /*  */<ESC>hhi

map ,/   I//<ESC>
map ;/   ^xx

map ,*   I/* <ESC>A */<ESC>
map ;*   ^xxx<ESC>$xxx

map <C-Up> ddkkp==
map <C-Down> ddp==


"=============================
"   for i.MX51 uboot
if exists("USING_IMX51_UBOOT")
        set tags=/datadisk/foryou/uboot-imx/tags
        cs add   /datadisk/foryou/uboot-imx/vim.cscope.out
        set path=/datadisk/foryou/uboot-imx
endif

ab ui unsigned int
ab us unsigned short
ab uc unsigned char
ab ul unsigned long
ab st static
ab vo volatile
ab #d #define

ab #i #include <.h><ESC>^f<

ab #z #if 0<cr><cr>#endif<ESC>kk
ab #o #if 1<cr><cr>#endif<ESC>kk
ab re return;<ESC>i

ab if if () {<cr>}<ESC>k^f(
ab el else {<cr>}<ESC>O<ESC>k
ab ei else if () {<cr>}<ESC>k^f(

ab fo for (;;)<ESC>$%
ab wh while () {<cr>}<ESC>kf(
ab do do {<cr><cr>} while();<ESC>kk

ab pr  printk("\n");<ESC>^f"

"==================
"  taglist.vim
map <F12> :TlistToggle<cr>
let Tlist_Show_One_File = 1
let Tlist_Use_Right_Window = 1
let Tlist_Exit_OnlyWindow = 1
let Tlist_Show_One_File = 1

"set guifont=DejaVu\ Sans\ Mono\ 14

set noswapfile
"set foldcolumn=2

set fileencodings=utf-8,gb18030


map <C-right> :tabn<cr>
map <C-Left> :tabp<cr>
map <C-w> :tabclose<cr>
map <C-n>   :tabedit<cr>

"打开目录浏览器
map <F2>   :execute "tabedit"<cr>:execute "edit ."<cr>

"tags,cscope
"取光标下的单词在新窗口中打开其定义处
function Open_new_tab_and_tags_locate_cursor_word()
        let word=expand('<cword>')
        execute "tabedit"
        execute "edit ."
        execute "ts " word
endfunction
map <F3> :call Open_new_tab_and_tags_locate_cursor_word()<cr>

"取光标下的单词在新窗口中打开其被调用处
function Open_new_tab_and_tags_whocall_locate_cursor_word()
        let word=expand('<cword>')
        execute "tabedit"
        execute "edit ."
        execute "cs find c " word
endfunction
map <F4> :call Open_new_tab_and_tags_whocall_locate_cursor_word()<cr>

"列出buffers
map <C-x> :buffers<cr>:bu
  评论这张
 
阅读(793)| 评论(0)
推荐 转载

历史上的今天

评论

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

页脚

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