Showing posts with label vi. Show all posts
Showing posts with label vi. Show all posts

Friday, September 6, 2013

Note for cscope and vim

How to install cscope:
sudo apt-get install cscope
mkdir -p ~/.vim/plugin
cd ~/.vim/plugin
wget http://cscope.sourceforge.net/cscope_maps.vim

How to create the index:
cscope -bR

How to find file:
:cs f f <filename>

Useful command:
CTRL+]
Go to function definition.

CTRL+ O 
Back to the previous place.

]]
Go to the start of this function

[[ 
Go to the end of this function

Ctrl + \ and press 's'
Find all references.


Reference:
用 vim 和 cscope 來 trace 程式碼
http://softsmith.blogspot.tw/2009/01/vim-cscope-trace.html

Tuesday, September 22, 2009

how to remove ^M in vi

:1,$s/^M//g

^M: Ctrl+V, and press Enter

[2014/05/30 updated]
It seems dos2unix is better than this command.

dos2unix – Removing Hidden Windows Characters from Files
http://www.liquidweb.com/kb/dos2unix-removing-hidden-windows-characters-from-files/