我的vimrc

" ==================================

" HighTall, <hightallyht@gmail.com>

" ================================== set autowrite

 

set completeopt=longest,menu

"set tabstop=2               " 设定 tab 长度为 4

"set nu

set backspace=2

set nomodeline

set ch=1

set aw

set hidden

set sw=4

set ts=4

set ic

"=================================

" git screen copy

"=================================

"set nowrap

set nobk

set showcmd

set incsearch

set hlsearch

"set mouse=a

 

""""""""""""""""""""""""""""""

" mark setting

""""""""""""""""""""""""""""""

nmap <silent> <leader>hl <Plug>MarkSet

vmap <silent> <leader>hl <Plug>MarkSet

nmap <silent> <leader>hh <Plug>MarkClear

vmap <silent> <leader>hh <Plug>MarkClear

nmap <silent> <leader>hr <Plug>MarkRegex

vmap <silent> <leader>hr <Plug>MarkRegex

 

nmap * //C/<<C-R>=expand("<cword>")<CR>/><CR>

nmap # ?/C/<<C-R>=expand("<cword>")<CR>/><CR>

nmap =5 =%

nmap <space> :

vmap <space> :

nmap <c-a> ggVG

nmap <c-c> "+y

nmap <c-p> "+gp

 

 

 

 

imap {} {}<LEFT><CR><ESC>O

"imap {} {}<LEFT>

imap [] []<LEFT>

imap () ()<LEFT>

imap <> <><LEFT>

imap "" ""<LEFT>

imap '' ''<LEFT>

imap ?? /**/<left><left>

 

"======================================

" tabbar will corrupt the taglist.

" disable it.

"======================================

"set tabpagemax =15

 

"======================================

" if set filetype on, the coming indent

" for c will do any mess but for supertab

"=====================================

 

filetype plugin indent on

"============================

" SuperTab for auto-completion

"============================

"let g:SuperTabRetainCompletionType = 2

"let g:SuperTabDefaultCompletionType = "<C-X><C-O>"

 

"==============================

" winManager for file explorer

" BufExplorer,FileExplorer|TagList

" BufExplorer -> tagBar

"==============================

"let g:winManagerWindowLayout='FileExplorer'

"

 

""let g:winManagerWindowLayout='TagList'

""let g:winManagerWidth = 23

"map <c-w><c-t> :WMToggle<cr>

 

""""let g:explHideFiles="[^ch]$, .git*"

""""let g:explSplitBelow=1

 

 

"=========================

" winfileexplorer

"====================================

" disable till work with checkpatch.pl

"====================================

"======================================

" endline set

"======================================

"autocmd BufWritePre * %s//s*$//e

 

""""let g:tex_flavor='latex'

""""let Tlist_Ctags_Cmd = '/usr/bin/ctags'

""""let Tlist_Show_One_File = 1

""""let Tlist_Exit_OnlyWindow = 1

""""let Tlist_Use_Right_Window = 1

""""let Tlist_Auto_Open = 1

""""let Tlist_Sort_Type = 'order'

""""let Tlist_WinWidth = 20

 

 

"=======================================

" replay configuration

" ======================================

let g:replay_speed = 2000

 

if has("cscope")

            set csprg=/usr/bin/cscope

            set nocsverb

             if filereadable(".cscope.out")

                   cs add .cscope.out

    elseif filereadable("cscope.out")

  cs add cscope.out

             elseif $CSCOPE_DB != ""

                   cs add $CSCOPE_DB

             endif

             set csverb

endif

 

nmap <C-r> :cs find s <C-R>=expand("<cword>")<CR><CR>

nmap <C-d> :cs find g <C-R>=expand("<cword>")<CR><CR>

nmap <C-x> :xall<CR>

nmap <C-e> :nohl<CR>

nmap <F2> :Tlist<CR>

nmap <F3> :set nu<CR>

nmap <F4> :set nonu<CR>

nmap <F5> :ShowMultiBase<CR>

nmap <F6> :Mark <C-R>=expand("<cword>")<CR><CR>

map <Space> <C-F>

 

" ====================================================================

 

filetype plugin indent on

set completeopt=longest,menu

set laststatus=2

"set statusline=/ %F%m%r%h/ %w/ / CWD:/ %r%{CurDir()}%h/ / / Line:/ %l/%L:%c

 

function! CurDir()

let curdir = substitute(getcwd(), '/Users/amir/', "~/", "g")

return curdir

endfunction

 

iab xdate <c-r>=strftime("%d/%m/%y %H:%M:%S")<cr>

 

" Set fonts and colors

if has("gui_running")

set guioptions-=T

set background=dark

set t_Co=256

colorscheme 256-grayvim

set nu

else

colorscheme 256-grayvim

 

set nu

endif

 

" extent function

":inoremap ( ()<ESC>i

":inoremap ) <c-r>=ClosePair(')')<CR>

":inoremap { {}<ESC>i

":inoremap } <c-r>=ClosePair('}')<CR>

":inoremap [ []<ESC>i

":inoremap ] <c-r>=ClosePair(']')<CR>

"

"function ClosePair(char)

" if getline('.')[col('.') - 1] == a:char

" return "/<Right>"

" else

" return a:char

" endif

"endf

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值