현재 내가 사용 중인 vim plugin 목록

1. ctags
2. cscope
3. taglist
4. buf explorer
5. source explorer
6. NERD Tree


.vimrc 설정...

1. ctags
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
set tags=./tags

if version >= 500
func! Sts()
	let st = expand("<cword>")
	exe "sts ".st
endfunc
nmap ,st :call Sts()<cr>

func! Tj()
	let st = expand("<cword>")
	exe "tj ".st
endfunc
nmap ,tj :call Tj()<cr>
endif

2. cscope
1
2
3
4
5
6
7
8
9
10
11
12
13
14
set csprg=/usr/bin/cscope
set csto=0
set cst
set nocsverb

if filereadable("./cscope.out")
	cs add cscope.out
endif
set csverb

nmap ,cs :cs find s <C-R>=expand("<cword>")<CR><CR>
nmap ,cg :cs find g <C-R>=expand("<cword>")<CR><CR>
nmap ,cd :cs find d <C-R>=expand("<cword>")<CR><CR>
nmap ,cc :cs find c <C-R>=expand("<cword>")<CR><CR>

3. taglist / buf explorer
1
2
map <F3> :Tlist<cr><C-W><C-W>
map <F4> :BufExplorer<cr>

4. source explorer
1
2
3
4
5
6
7
8
9
10
11
nmap <F8> :SrcExplToggle<CR>
nmap <C-H> <C-W>h
nmap <C-J> <C-W>j
nmap <C-K> <C-W>k
nmap <C-L> <C-W>l

let g:SrcExpl_winHeight=8
let g:SrcExpl_refreshTime=100
let g:SrcExpl_jumpKey="<ENTER>"
let g:SrcExpl_gobackKey="<SPACE>"
let g:SrcExpl_isUpdateTags=0

5. NERD Tree
1
2
let NERDTreeWinPos = "left"
nmap <F9> :NERDTreeToggle

  vim 관련 설정 (.vimrc)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
set csprg=/usr/bin/cscope
set csto=0
set cst
set nocsverb

if filereadable("./cscope.out")
    cs add cscope.out
endif
set csverb

nmap ,cs :cs find s <C-R>=expand("<cword>")<CR><CR>     
nmap ,cg :cs find g <C-R>=expand("<cword>")<CR><CR>
nmap ,cd :cs find d <C-R>=expand("<cword>")<CR><CR>
nmap ,cc :cs find c <C-R>=expand("<cword>")<CR><CR>

  cscope 사용법
:cs find {질의 종류} {심볼}

질의 종류
s   : Find this C symbol
g   : Find this definition
d   : Find functions called by this function
c   : Find functions calling this function
t    : Find assignments to
e   : Find this egrep pattern
f    : Find this file
i    : Find files #including this file

#!/bin/sh
rm -rf cscope.out cscope.files
find $PWD \( -name '*.c' -o -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.s' -o -name '*.S' \) -print > cscope.files

cscope -i cscope.files


 윈도우용
dir /B /S *.c *.inc *.cpp *.s *.S *.hpp *.h > cscope.files
cscope -b -q -k
ctags -R



/* elf32-littlearm.lds 파일 */

//이 부분은 arm-linux-ld가 만들어 낼 최종 결과 파일의 포맷을 나타낸다.
//즉, little endian 포맷의 파일을 생성할 것인지,
//big endian 포맷의 파일을 생성할 것인지를 결정하는 역할을 한다.

OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")

//이 부분은 최종 결과 파일이 동작할 CPU의 architecture를 나타낸다.
//즉, 이 파일은 ARM CPU 상에서 동작한다는 의미이다.

OUTPUT_ARCH(arm)

//최종 결과 파일의 시작 지점을 나타낸다.
//즉, 여기서 파일의 시작 지점은 reset_handler가 된다.
//reset_handler는 Cstartup.s 파일에 정의되어 있다.

ENTRY(reset_handler)

//SECTIONS{ ... }부분은 링커(arm-linux-ld)가 입력 파일들의 섹션들을
//결과 파일의 어떤 섹션들로 위치시킬지를 결정하는 역할을 한다.

SECTIONS
{
    .text : {          //프로그램의 코드영역
        _stext = .;      //코드영역의 시작주소를 makefile로 부터 가져온다.
        *(.text)        //모든 입력 파일들(*)의 .text 섹션을 결과 파일의 .text 섹션에 위치시킨다.
        *(.rodata)      //readonly 파일들을 .text 섹션에 위치시킨다.
        *(.rodata*)    //그외 모든 데이터들을 .text 섹션에 위치시킨다.
        . = ALIGN(4);  //현재의 위치에서 4 바이트 단위로 놓겠다는 의미이다.
                                 // 즉, 4바이트 단위로 메모리를 정렬한다.

         _etext = . ;    //코드영역의 끝을 현재 위치포인트로 하겠다는 의미이다.
    }

    //데이터 영역
     //코드영역 시작주소부터 코드영역의 크기만큼 더한다음 주소 즉, 코드영역 다음 주소
    .data : AT ( ADDR (.text) + SIZEOF (.text) ) {  
        _sdata = .;
        *(.vectors)    //모든 입력 파일의 벡터 테이블을 데이터 영역에 포함
        *(.data)       //모든 입력 파일의 초기화 된 데이터를 데이터 영역에 포함
        _edata = .;
    }

     //bss 영역
     //noload = 적재하지 않는다. 
    .bss (NOLOAD) : { 
        . = ALIGN(4);
        _sbss = .;
        *(.bss)         //모든 입력 파일의 bss영역을 출력파일의 bss영역에 포함한다.
        _ebss = .;
    }
}
end = .;

+ Recent posts