· KLDP.org · KLDP.net · KLDP Wiki · KLDP BBS ·
Vim Rc

°¢ÀÚ°¡ »ç¿ëÇÏ´Â vimrc ¿¹Á¦


1.1. .vimrc


set nocompatible
set title
set autoindent          " ÀÚµ¿À¸·Î µé¿©¾²±â¸¦ ÇÑ´Ù.
set bs=2                " allow backspacing over everything in insert mode
set viminfo='20,\"50    " read/write a .viminfo file, don't store more
set ruler               " show the cursor position all the time
set number
set background=light
set softtabstop=4
set shiftwidth=4
set tabstop=4
set incsearch
set vb
set exrc                " ƯÁ¤µð·ºÅ丮¿¡¼­ .exrc ÆÄÀÏÀÇ ¼³Á¤À» Àû¿ëÇÏ°Ô ÇÔ
set mouse=n
set fencs=utf8,euc-kr
"set fencs=euc-kr,utf8
syntax on

let TE_WinWidth = 20    " TagExplorer âũ±â Á¶Àý

" Function Key
map <F1> K              " man page
map <F2> :w<CR>
"map <F2> :so $VIMRUNTIME/syntax/2html.vim<CR> " make HTML
map <F3> [{v]}zf        " file folding
map <F4> zo             " file unfolding
map <F5> :Tlist<CR>^Ww:20vs ./<CR>:set nonu<CR>^Ww^Ww
map <F6> :cl<CR>
map <F7> :cn<CR>        " ¿¡·¯(°á°ú) À§Ä¡·Î
map <F8> :cp<CR>        " ¿¡·¯(°á°ú) À§Ä¡·Î(¿ª¼ø)
map <F9> :noh<CR>       " ÇÏÀ̶óÀÌÆ® Á¦°Å
map <C-F10> gd          " ¾î¶² ÇÔ¼ö ¾È¿¡¼­ Áö¿ªº¯¼ö¸¦ ÃßÀû
map <F11> ^]            " Àü¿ªº¯¼ö/±¸Á¶Ã¼/Á¤ÀÇ»ó¼ö/ÇÔ¼öÁ¤ÀǸ¦ ÃßÀû
map <C-F11> :make<CR>   " ºôµå
map <F12> ^T            " ÀÌÀüÀ§Ä¡·Î µÇµ¹¾Æ¿À±â
map <C-F12> :make again<CR> " ¸ðµÎ »õ·Î ºôµå

set hlsearch

set guifont=monospace
"set guifont=miscfixed
"set guifont=gulimche\ 9
colo default
"colo koehler

let $grepfile="*.[ch] *.cpp"
map ,gc :grep <cword> * -R<CR>
vnoremap <c-a> :IncN<CR>

filetype on
filetype indent on
filetype plugin on

au BufWinLeave *.py mkview              " º¸´ø .py ÆÄÀÏÀÇ ¿¹Àü À§Ä¡¿¡ Ä¿¼­ À§Ä¡½ÃÅ°±â
au BufWinEnter *.py silent loadview     "
au BufWinLeave *.c mkview               " º¸´ø .c ÆÄÀÏÀÇ ¿¹Àü À§Ä¡¿¡ Ä¿¼­ À§Ä¡½ÃÅ°±â
au BufWinEnter *.c silent loadview      "

au BufNewFile *.cpp call InsertSkeleton()
"0r ~/.vim/skeleton.cpp
au BufNewFile *.h call InsertHeaderSkeleton()

function! InsertSkeleton()
    0r ~/.vim/skeleton.cpp
    call InsertInclude()
endfunction

function! InsertHeaderSkeleton()
    0r ~/.vim/skeleton.h
    call InsertFname()
endfunction

function! InsertInclude()
    let fname = expand("%:t")
    let fname = substitute(fname, "cpp", "h", "g")
    call search("#include")
    exe "normal A " . "\"" . fname . "\""
endfunction

function! InsertFname()
    " Convert newname.h to _NEWNAME_H_
    let fname = expand("%:t")
    let cname = "C" . substitute(fname, "\.h", "", "g")
    let fname = toupper(fname)
    let fname = substitute(fname, "\\.", "_", "g")
    " Search for #ifndef
    call search("#ifndef")
    exe "normal A " . "___" . fname . "___"
    " Search for #define
    call search("#define")
    exe "normal A " . "___" . fname . "___"
    " Search for #endif
    call search("#endif")
    exe "normal A " . "// ___" . fname . "___"
    " Search for #class
    call search("class")
    exe "normal A" . cname . " {"
    " Search for public
    call search("public:")
    exe "normal A" . "\n" . cname . "() {}\nvirtual ~" . cname . "() {}"
endfunction

"
" vim -b : edit binary using xxd-format!
augroup Binary
  au!
  au BufReadPre  *.bin let &bin=1
  au BufReadPost *.bin if &bin | %!xxd
  au BufReadPost *.bin set ft=xxd | endif
  au BufWritePre *.bin if &bin | %!xxd -r
  au BufWritePre *.bin endif
  au BufWritePost *.bin if &bin | %!xxd
  au BufWritePost *.bin set nomod | endif
augroup END

augroup CvsLogging
 au!
 au BufNewFile,BufRead /tmp/cvs*   set fenc=utf-8 enc=utf-8
augroup END

augroup ChangeLog
 au!
 au BufNewFile,BufRead ChangeLog*   set fenc=utf-8 enc=utf-8
augroup END

source ~/.vim/plugin/word_complete.vim
call DoWordComplete()


1.2. .vim/skeleton.h


/**
 * @file
 * @b Title: .
 * @b Desc:
 *
 * @b Author: Son, Kyeong-uk(hey_calm)
 *
 * $Log: VimRc,v $
 * Revision 1.6  2005/05/05 13:29:20  kss
 * 203.237.51.80;;À±ÇöÈ£;;
 *
 * Revision 1.5  2005/04/19 01:12:12  kss
 * 222.98.194.47;;°ËÀºÇØ;;
 *
 * Revision 1.4  2005/04/19 00:38:29  kss
 * 203.237.51.80;;À±ÇöÈ£;;RenameThisPage
 *
 * Revision 1.3  2005/03/14 08:11:57  kss
 * 203.237.51.80;;À±ÇöÈ£;;RenameThisPage
 *
 * Revision 1.2  2004/12/04 12:27:22  kss
 * 61.74.173.192;;infiniterun;;
 *
 * Revision 1.1  2004/12/04 11:48:59  kss
 * 61.74.173.192;;infiniterun;;
 *
 * Revision 1.2  2004/06/07 08:32:32  kss
 * 211.63.103.71;;hey;;
 *
 */
#ifndef
#define

class
public:
};

#endif


1.3. .vim/skeleton.cpp


/**
 * @file
 * @b Title: .
 * @b Desc:
 *
 * @b Author: Son, Kyeong-uk(hey_calm)
 *
 * $Log: VimRc,v $
 * Revision 1.6  2005/05/05 13:29:20  kss
 * 203.237.51.80;;À±ÇöÈ£;;
 *
 * Revision 1.5  2005/04/19 01:12:12  kss
 * 222.98.194.47;;°ËÀºÇØ;;
 *
 * Revision 1.4  2005/04/19 00:38:29  kss
 * 203.237.51.80;;À±ÇöÈ£;;RenameThisPage
 *
 * Revision 1.3  2005/03/14 08:11:57  kss
 * 203.237.51.80;;À±ÇöÈ£;;RenameThisPage
 *
 * Revision 1.2  2004/12/04 12:27:22  kss
 * 61.74.173.192;;infiniterun;;
 *
 * Revision 1.1  2004/12/04 11:48:59  kss
 * 61.74.173.192;;infiniterun;;
 *
 * Revision 1.2  2004/06/07 08:32:32  kss
 * 211.63.103.71;;hey;;
 *
 */
#include


nezy ±Ç¼ø±¹´ÔÀÇ VimRc¿¡¼­ °ÅÀÇ ´ëºÎºÐ ¿ÔÀ½À» ¹àÈü´Ï´Ù.



ID
Password
Join
The best prophet of the future is the past.


sponsored by andamiro
sponsored by cdnetworks
sponsored by HP

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2005-05-05 22:29:20
Processing time 0.0044 sec