Vim 프로필 [Windows] 2012 - 05 - 01 버 전

" -----------------   Author: Ruchee
" -----------------    Email: [email protected]
" -----------------  WebSite: http://www.ruchee.com
" -----------------     Date: 2012-05-01


" Ctrl + H                   --        
" Ctrl + J                   --        
" Ctrl + K                   --        
" Ctrl + L                   --        
" Ctrl + C                   --   [  C/C++、Java、Haskll]
" Ctrl + R                   --   [  C/C++、Java、Haskell、Lua、Perl、Python、Ruby]
" Ctrl + ]                   --      
" Ctrl + T                   --      
" Ctrl + E                   --           、    

" <C-P>                      --    
" <C-X><C-L>                 --    
" Tab                       --                [snipMate  ]
" Shift + Insert             -- Vim           

" u [  ]                   --     [     ]
" U [  ]                   --     [     ]

" jj                         --            [    ]
" kk                         --  Normal   [    ]
" nt                         --  NERDTree [     ]
" tl                         --  TagList [     ]

" za                         --         
" zM                         --      
" zR                         --      

" :set syntax=cpp            --         [  :set filetype=cpp]

" :%!xxd                     --       ,         
" :%!xxd -r                  --       


" ----------            ---------------------

" :Tlist                     --          [TagList  ]
" :LoadTemplate              --       [Load_Template  ]
" :AuthorInfoDetect          --    、      [NERD_commenter && authorinfo  ]

" ---------- a.vim [    C/C++     ] ----------
"
" :A                         --              
" :AS                        --            ,     
" :AV                        --            ,     

" ---------- mark.vim [         ] ------------
"
" \m                         --normal   ,            \m            
" :Mark                      --      
" :Mark abc                  --       abc       abc

" ---------- NERDTree [       ] ----------------
"
" :NERDTree                  --  NERDTree  
" o [  ]                   --            、    
" u                          --      
" p [  ]                   --      
" P [  ]                   --     
" K                          --           
" J                          --           
" m                          --         [ 、 、 ]
" ?                          --      
" q                          --     


"     .html      Django Template      
"                  
au BufNewFile,BufRead *.html setf htmldjango

colorscheme blackboard       "     :    
set guifont=Monaco:h10       "    &&   
set tabstop=4                "   tab    
set shiftwidth=4             "          4   
set autoindent               "     
set backspace=2              "        
set cindent shiftwidth=4     "     4  
set smartindent              "       
set ai!                      "       
set nu!                      "     
"set showmatch               "         
set mouse=a                  "     
set ruler                    "              
set incsearch                "   book ,   /b      
set hlsearch                 "         
set incsearch                "         
set nowrapscan               "              
set nocompatible             "       
set vb t_vb=                 "      
"set cursorline              "        
set hidden                   "                 
set list                     "   Tab ,         
set listchars=tab:\|\ ,

syntax enable                "       
syntax on                    "         
filetype indent on           "                   
filetype plugin on           "                 
filetype plugin indent on    "       


if has("gui_running")
    au GUIEnter * simalt ~x  "           
    "winpos 20 20            "          ,          
    "set lines=20 columns=90 "       ,lines   ,columns   
    "set guioptions-=m       "      
    "set guioptions-=T       "      
    "set guioptions-=L       "        
    "set guioptions-=r       "        
    "set guioptions-=b       "        
    "set showtabline=0       "   Tab 
endif

set writebackup              "        
set nobackup
set autochdir                "               
"set nowrap                  "        
set foldmethod=syntax        "         
set foldlevel=100            "       

set laststatus=2             "        
set cmdheight=2              "       ,   1,    2

"     80          
au BufRead,BufNewFile *.s,*.asm,*.h,*.c,*.cpp,*.cc,*.java,*.cs,*.erl,*.hs,*.sh,*.lua,*.pl,*.pm,*.php,*.py,*.rb,*.erb,*.vim,*.js,*.css,*.xml,*.html,*.xhtml 2match Underlined /.\%81v/


"     
set fenc=utf-8
set encoding=utf-8
set fileencodings=utf-8,gbk,cp936,latin-1
"       
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
"   consle    
language messages zh_CN.utf-8


" For Haskell
:let hs_highlight_delimiters=1            "      
:let hs_highlight_boolean=1               "  True False      
:let hs_highlight_types=1                 "               
:let hs_highlight_more_types=1            "              
:let hs_highlight_debug=1                 "          
:let hs_allow_hash_operator=1             "    #     


" =======    &&        ======= "

: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

:inoremap ` ``<ESC>i

function ClosePair(char)
    if getline('.')[col('.') - 1] == a:char
        return "\<Right>"
    else
        return a:char
    endif
endf


" MiniBufExplorer                            
let g:miniBufExplMapWindowNavVim=1
let g:miniBufExplMapWindowNavArrows=1
let g:miniBufExplMapCTabSwitchBufs=1
let g:miniBufExplModSelTarget=1

" :Tlist                TagList
let Tlist_Show_One_File=1                    "         tags
let Tlist_Exit_OnlyWindow=1                  "   Taglist            Vim
let Tlist_Use_Right_Window=1                 "         
let Tlist_File_Fold_Auto_Close=1             "     

" TxtBrowser            TXT    
au BufRead,BufNewFile *.txt setlocal ft=txt

" :LoadTemplate                   
let g:template_path='D:/Apps/Gvim/vimfiles/template/'

" :AuthorInfoDetect         、     ,   NERD_commenter && authorinfo   
let g:vimrc_author='Ruchee'
let g:vimrc_email='[email protected]'
let g:vimrc_homepage='http://www.ruchee.com'

" Ctrl + H                       
imap <c-h> <ESC>I

" Ctrl + J                       
imap <c-j> <ESC>jI

" Ctrl + K                       
imap <c-k> <ESC>kA

" Ctrl + L                       
imap <c-l> <ESC>A

" Ctrl + E                       、    
map <c-e> <ESC>:LoadTemplate<CR><ESC>:AuthorInfoDetect<CR><ESC>Gi
imap <c-e> <ESC>:LoadTemplate<CR><ESC>:AuthorInfoDetect<CR><ESC>Gi
vmap <c-e> <ESC>:LoadTemplate<CR><ESC>:AuthorInfoDetect<CR><ESC>Gi

" jj                              [    ]
imap jj <ESC>:w<CR>li

" kk                    Normal   [    ]
imap kk <ESC>l

" nt                    NERDTree [     ]
map nt :NERDTree<CR>

" tl                    Taglist [     ]
map tl :Tlist<CR><c-l>


" =======    &&    ======= "

"      
func! CompileCode()
        exec "w"
        if &filetype == "c"
            exec "!gcc -Wall -std=c99 %<.c -o %<"
        elseif &filetype == "cpp"
            exec "!g++ -Wall -std=c++98 %<.cpp -o %<"
        elseif &filetype == "java"
            exec "!javac %<.java"
        elseif &filetype == "haskell"
            exec "!ghc --make %<.hs -o %<"
        elseif &filetype == "lua"
            exec "!lua %<.lua"
        elseif &filetype == "perl"
            exec "!perl %<.pl"
        elseif &filetype == "python"
            exec "!python %<.py"
        elseif &filetype == "ruby"
            exec "!ruby %<.rb"
        endif
endfunc

"        
func! RunCode()
        exec "w"
        if &filetype == "c" || &filetype == "cpp" || &filetype == "haskell"
            exec "! %<.exe"
        elseif &filetype == "java"
            exec "!java %<"
        elseif &filetype == "lua"
            exec "!lua %<.lua"
        elseif &filetype == "perl"
            exec "!perl %<.pl"
        elseif &filetype == "python"
            exec "!python %<.py"
        elseif &filetype == "ruby"
            exec "!ruby %<.rb"
        endif
endfunc

" Ctrl + C     、  
map <c-c> :call CompileCode()<CR>
imap <c-c> <ESC>:call CompileCode()<CR>
vmap <c-c> <ESC>:call CompileCode()<CR>

" Ctrl + R     、  
map <c-r> :call RunCode()<CR>
imap <c-r> <ESC>:call RunCode()<CR>
vmap <c-r> <ESC>:call RunCode()<CR>

좋은 웹페이지 즐겨찾기