summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbluezery <ohpowel@gmail.com>2014-11-20 14:04:19 +0900
committerbluezery <ohpowel@gmail.com>2014-11-20 14:04:19 +0900
commit5ee09b407652839c5a42890d4f9b8a7ca303be06 (patch)
tree6971416f6fac91427cf4ed9cd1972fc0d4edb3d2
Init my environment
-rw-r--r--.bash_aliases115
-rw-r--r--.colordiffrc7
-rw-r--r--.gitconfig22
-rw-r--r--.tmux.conf18
-rw-r--r--.vimrc228
-rw-r--r--README5
-rwxr-xr-xSrcExpl-5.3.zipbin0 -> 15078 bytes
-rw-r--r--Sublime/README6
-rw-r--r--Sublime/User/Default (Linux).sublime-keymap2
-rw-r--r--Sublime/User/Default (OSX).sublime-keymap2
-rw-r--r--Sublime/User/Default (Windows).sublime-keymap2
-rw-r--r--Sublime/User/Preferences.sublime-settings13
-rw-r--r--Ubuntu.package2
-rwxr-xr-xctags.sh40
-rwxr-xr-xinstall-ubuntu.sh154
15 files changed, 616 insertions, 0 deletions
diff --git a/.bash_aliases b/.bash_aliases
new file mode 100644
index 0000000..41fd803
--- /dev/null
+++ b/.bash_aliases
@@ -0,0 +1,115 @@
1# ~/.bash_aliases: executed by bash(1) for non-login shells.
2
3alias grep='grep --color=auto'
4alias fgrep='fgrep --color=auto'
5alias egrep='egrep --color=auto'
6alias top='htop'
7alias df='dfc'
8alias diff='colordiff'
9
10OS="`uname`"
11# ls color setting
12if [ -x /usr/bin/dircolors ]; then
13 test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
14 alias ls='ls --color=auto'
15 if [ "${OS}" == "Linux" ]; then
16 export LS_COLORS='rs=0:di=01;34:ln=01;36:mh=44;37:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36'
17 else
18 export LS_COLORS=':di=01;34:ex=01;32:ln=01;36'
19 fi
20fi
21
22PATH=$HOME/bin:$PATH
23export EDITOR=vi
24export SVN_EDITOR=vi
25export LANG="ko_KR.utf8"
26
27#### some more ls aliases
28alias ll='ls -alF'
29alias la='ls -A'
30alias l='ls -CF'
31alias rm='rm -i'
32export MAKEFLAGS="-j 4"
33
34#### Mac setting
35if [ "${OS}" == "Darwin" ]; then
36 echo "Current OS is" ${OS}
37 export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig:/opt/local/lib/pkgconfig"
38 export CFLAGS="$CFLAGS -I/usr/local/include -I/opt/local/include"
39 export LDFLAGS="$LDFLAGS -L/usr/local/lib -L/opt/local/lib"
40fi
41
42#### Enable ccache
43PATH=$PATH:/usr/lib/ccache
44
45#### ANT setting
46export ANT_HOME="/usr/local/apache-ant-1.8.2"
47PATH=$ANT_HOME/bin:$PATH
48
49#### Andoroid SDK setting
50ANDROID_SDK=$HOME/android/android-sdk-linux_x86
51PATH=$ANDROID_SDK/tools:$ANDROID_SDK/platform-tools:$PATH
52
53#### Android NDK setting
54export ANDROID_NDK=$HOME/android-ndk
55PATH=$ANDROID_NDK:$PATH
56
57#### Android-cmake setting
58ANDROID_CMAKE=$HOME/android/android-cmake
59export ANDTOOLCHAIN=$ANDROID_CMAKE/toolchain/android.toolchain.cmake
60alias android-cmake='cmake -DCMAKE_TOOLCHAIN_FILE=$ANDTOOLCHAIN '
61
62#### Perl setting
63export PERL5LIB=$HOME"/perl5/lib/perl5;$PERL5LIB"
64export PERL_CPANM_OPT="--local-lib=~/perl5"
65
66#### NVM setting
67[[ -s "$HOME/.nvm/nvm.sh" ]] && source ~/.nvm/nvm.sh
68
69#### RVM Setting
70PATH=$PATH:$HOME/.rvm/bin
71[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
72
73#### Job work Setting
74alias runpico='picocom --b 115200 /dev/ttyS0'
75if [ -d $HOME/sbs-install/bin ]; then ## For SBS, not valid anymore
76 PATH=$PATH:$HOME/sbs-install/bin
77 alias dch='dch -iU -D unstable --force-distribution'
78 export DEBEMAIL="the81.kim@samsung.com"
79 export DEBFULLNAME="Tae-Hwan Kim"
80
81 ## for proxy setting
82 #proxy="168.219.61.250"
83 #port="8080"
84 #export all_proxy="${proxy}:""${port}"
85 #export http_proxy="http://""${proxy}:""${port}"
86 #export https_proxy="https://""${proxy}:""${port}"
87 #export ANT_OPTS="-Dhttp.proxyHost=${proxy} -Dhttp.proxyPort=${port}"
88 #export CVSROOT=":pserver;proxy=${proxy};proxyport=${port}:cvs@cvs.fefe.de:/cvs" # dietlibc
89 #export CVSROOT=":pserver;proxy=${proxy};proxyport=${port}:anoncvs@sources.redhat.com:/cvs/src" #newlib
90fi
91
92#### Add bullseye path
93PATH=$HOME/Bullseye/bin:$PATH
94export COVFILE=$HOME/work/tizen/bullseye/test.cov
95
96#### arcanist setting
97PATH=$PATH:$HOME/work/opensrc/arcanist/bin
98
99
100#### Coverity Scan setting
101PATH=$HOME/bin/cov-analysis-linux-6.6.1/bin:$PATH
102
103#### DS-5 setting
104PATH=$PATH:/usr/local/DS-5/bin:$HOME/tizen-sdk/tools:$HOME/tizen-sdk/tools/ide/bin
105ulimit -c unlimited
106if [ -z "$TMUX" ]; then
107 tmux
108fi
109
110#### Address sanitizer
111if [ -f /usr/bin/llvm-symbolizer-3.4 ]; then
112 export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-3.4
113elif [ -f /usr/bin/llvm-symbolizer-3.2 ]; then
114 export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-3.2
115fi
diff --git a/.colordiffrc b/.colordiffrc
new file mode 100644
index 0000000..d3cadc0
--- /dev/null
+++ b/.colordiffrc
@@ -0,0 +1,7 @@
1banner=no
2color_patches=no
3plain=off
4newtext=green
5oldtext=red
6diffstuff=magenta
7cvsstuff=yellow
diff --git a/.gitconfig b/.gitconfig
new file mode 100644
index 0000000..a614ded
--- /dev/null
+++ b/.gitconfig
@@ -0,0 +1,22 @@
1[user]
2 name = bluezery
3 email = ohpowel@gmail.com
4[color]
5 ui=auto
6[color "branch"]
7 current = yellow reverse
8 local = yellow
9 remote = green
10[color "diff"]
11 meta = yellow bold
12 frag = magenta bold
13 old = red bold
14 new = green bold
15[color "status"]
16 added = yellow
17 changed = green
18 untracked = cyan
19[diff]
20 tool = meld
21[push]
22 default = current
diff --git a/.tmux.conf b/.tmux.conf
new file mode 100644
index 0000000..23493df
--- /dev/null
+++ b/.tmux.conf
@@ -0,0 +1,18 @@
1# Set status bar
2set -g status-bg black
3set -g status-fg white
4set -g status-left '#[fg=green]#H'
5# Highlight active window
6set-window-option -g window-status-current-bg red
7
8#set -g default-terminal screen-256color
9set -g history-limit 100000
10
11#set -g status-right '#[fg=yellow]#(uptime | cut -d "," -f 2-)'
12
13#set -g terminal-overrides 'xterm*:smcup@:rmcup@'
14#setw -g mode-mouse on
15#set -g mouse-select-pane on
16#set -g mouse-resize-pane on
17#set -g mouse-select-window on
18#setw -g mode-keys vi
diff --git a/.vimrc b/.vimrc
new file mode 100644
index 0000000..4bbe6dc
--- /dev/null
+++ b/.vimrc
@@ -0,0 +1,228 @@
1if has("win32")
2 source $VIMRUNTIME/vimrc_example.vim
3 source $VIMRUNTIME/mswin.vim
4 behave mswin
5 set path=.,C:/MinGW/include,C:/MinGW/bin
6endif
7
8if version >= 500
9 syntax on
10 color elflord
11 set background=dark
12endif
13
14set backspace=indent,eol,start
15set ai
16set nocompatible " not compatible with original vi
17set incsearch
18set hlsearch
19set number
20set noexpandtab
21set title
22set showmatch
23set showmode
24set ts=4
25set sw=4
26
27"NERDtree & Buffer Explorer if exists
28let NERDTreeWinSize=60
29map <F12> :NERDTreeToggle<CR>
30map <S-F12> \bs
31
32
33""""""""""""""""""""""""""""""""""""""""""""""""""""
34"
35" C, C++ Develpment Setting
36"
37""""""""""""""""""""""""""""""""""""""""""""""""""""
38highlight ExtraOver ctermbg=red ctermfg=white guibg=#59292
39aug Basic
40 au BufRead * match ExtraOver /\s\+\%#\@<!$/
41aug END
42aug developer
43 au!
44 au BufNewFile,BufRead,BufEnter *.cpp,*.hpp set omnifunc=omni#cpp#complete#Main
45 au FileType c,cpp,h set cindent
46 au FileType c,cpp,h,edc autocmd BufEnter * silent! lcd %:p:h
47 au filetype c,cpp,h map <S-k> :exec(":!man 3 ".expand("<cword>"))<CR>
48
49 " Save previous cursor position
50 set viewoptions=cursor
51 au BufWinLeave *.c,*.cpp,*.h,*.edc mkview
52 au BufWinEnter *.c,*.cpp,*.h,*.edc silent loadview
53
54 "Show space errors for c, cpp file type
55 let c_space_errors = 1
56
57 " Show extra white space & Over length (80)
58 au BufRead *.c,*.cpp,*.h match ExtraOver /\s\+\%#\@<!$\|\%81v.*/
59
60 " Remove extra white space before save
61 " au bufwritepre *.c,*.cpp,*.h,*.edc :%s/\s\+$\| \+\ze\t//e
62 au filetype * map <S-F9> :%s/\s\+$\| \+\ze\t//e
63
64 "indent for e17 ref: http://trac.enlightenment.org/e/wiki/ecoding
65 au filetype c,cpp,h,edc map <F9> :set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2p{2(0w1st0<CR>
66
67 " <F2> ---- debugging program ----
68 if has("unix") | au filetype c,cpp map <F2> :!gdb <CR>
69 elseif has ("win32") | au filetype c,cpp map <F2> :!insight<CR>
70 endif
71
72 " <F3> <S-F3> ---- find complie error----
73 au filetype c,cpp,h,edc map <F3> :copen<CR>
74 if &term == 'xterm'
75 au filetype c,cpp,h,edc set <S-F3>=O1;2R
76 au filetype c,cpp,h,edc set <S-F4>=O1;2S
77 endif
78
79 au filetype c,cpp,h,edc map <C-n> :cn<CR>
80 au filetype c,cpp,h,edc map <C-p> :cp<CR>
81
82 " <F4> ---- build (make) ----
83 if has("unix") | au filetype c,cpp,edc set mp=make "gcc\ %\ -o\ %<
84 elseif has("win32") | au filetype c,cpp,edc set mp=make "gcc\ %\ -o\ %<.exe
85 endif
86 au filetype c,cpp,h map <F4> :make -j4<CR>
87
88 " <S-F4> ---- excute binary ------
89 if has("unix") | au filetype c,cpp map <S-F4> :!./%<<CR>
90 elseif has ("win32") | au filetype c,cpp map <S-F4> :!%<.exe<CR>
91 endif
92
93 "<F5> <S-F5> <C-W><C-\> ---- ctags ----
94 au filetype c,cpp,h,edc set tags+=./tags;/tags,/home/bluezery/.vim/tags/tags
95 au filetype c,cpp,h,edc map <S-F5> :!ctags --c-kinds=+p --sort=foldcase -R<CR>:ctags.sh<CR>:!echo "enjoy ctags"<CR>
96 au filetype c,cpp,h,edc map <F5> :ts
97 au filetype c,cpp,h,edc map <C-W><C-\> :vsp<CR>:exec("tag ".expand("<cword>"))<CR>
98
99 "<C-\><C-]> ----- gtags (gnu global) ------
100 au filetype c,cpp,h,edc map <C-\><C-]> :GtagsCursor<CR>
101
102 " <F6> <S-F6> make cscope db file & read db file
103 if has("unix")
104 au filetype c,cpp,h,edc map <S-F6> :!rm -rf cscope.files<CR>:!find . -name '*.c' -o -name '*.cpp' -o -name '*.h' -o -name '*.h.in' -o -name '*.s' -o -name '*.s' -o -name '*.edc' > cscope.files<CR>:!cscope -b -q -k<CR>:cs reset<CR>:cs add cscope.out<CR>:cs add /home/bluezery/.vim/tags/cscope.out<CR>:!echo "enjoy cscope"<CR>
105 elseif has("win32") | au filetype c,cpp,h,edc map <S-F6> :!dir /b /s *.c *.h *.edc > cscope.out<CR>:!cscope -b -q -k<CR>:cs reset<CR>:cs add cscope.out<CR>:!echo "enjoy cscope"<CR>
106 endif
107 au filetype c,cpp,h,edc set csto=0
108 au filetype c,cpp,h,edc set cst
109 au filetype c,cpp,h,edc set csverb
110 if filereadable("/home/bluezery/.vim/tags/cscope.out")
111 au filetype c,cpp,h,edc cs add /home/bluezery/.vim/tags/cscope.out
112 endif
113 au filetype c,cpp,h,edc map <F6> :!cscope<CR>
114 au filetype c,cpp,h,edc map <C-F6> :exec("cs find g ".expand("<cword>")) <CR>
115 au filetype c,cpp,h,edc map <C-\> :exec("cs find c ".expand("<cword>"))<CR>
116
117 "" Tag List setting
118 nmap <F7> :TlistToggle<CR>
119 let Tlist_WinWidth = 50
120
121 "" Source Exploere setting
122 " // The switch of the Source Explorer
123 nmap <F8> :SrcExplToggle<CR>:set hlsearch<CR>
124
125 " // Set the height of Source Explorer window
126 let g:SrcExpl_winHeight = 20
127
128 " // Set 100 ms for refreshing the Source Explorer
129 let g:SrcExpl_refreshTime = 100
130
131 " // Set "Enter" key to jump into the exact definition context
132 " let g:SrcExpl_jumpKey = "<ENTER>"
133
134 " // Set "Space" key for back from the definition context
135 let g:SrcExpl_gobackKey = "<SPACE>"
136
137 " // In order to Avoid conflicts, the Source Explorer should know what plugins
138 " // are using buffers. And you need add their bufname into the list below
139 " // according to the command ":buffers!"
140 let g:SrcExpl_pluginList = [
141 \ "__Tag_List__",
142 \ "_NERD_tree_",
143 \ "Source_Explorer"
144 \ ]
145
146 " // Enable/Disable the local definition searching, and note that this is not
147 " // guaranteed to work, the Source Explorer doesn't check the syntax for now.
148 " // It only searches for a match with the keyword according to command 'gd'
149 let g:SrcExpl_searchLocalDef = 1
150 " // Do not let the Source Explorer update the tags file when opening
151 let g:SrcExpl_isUpdateTags = 0
152 " // Use 'Exuberant Ctags' with '--sort=foldcase -R .' or '-L cscope.files' to
153 " // create/update a tags file
154 let g:SrcExpl_updateTagsCmd = "ctags --sort=foldcase -R ."
155
156 " // Set "<F12>" key for updating the tags file artificially
157 "let g:SrcExpl_updateTagsKey = "<F12>"
158aug END
159""""""""""""""""""""""""""""""""""""""""""""""""""""
160
161"set diffexpr=MyDiff()
162"function MyDiff()
163" let opt = '-a --binary '
164" if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
165" if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
166" let arg1 = v:fname_in
167" if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
168" let arg2 = v:fname_new
169" if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
170" let arg3 = v:fname_out
171" if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
172" let eq = ''
173" if $VIMRUNTIME =~ ' '
174" if &sh =~ '\<cmd'
175" let cmd = '""' . $VIMRUNTIME . '\diff"'
176" let eq = '"'
177" else
178" let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
179" endif
180" else
181" let cmd = $VIMRUNTIME . '\diff'
182" endif
183" silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
184"endfunction
185
186
187""""""""""""""""""""""""""""""""""""""""""
188" Vundles configuration
189""""""""""""""""""""""""""""""""""""""""""
190filetype off " required!
191
192set rtp+=~/.vim/bundle/vundle/
193call vundle#rc()
194
195" let Vundle manage Vundle
196" install guide: https://github.com/gmarik/vundle
197" required!
198Bundle 'gmarik/vundle'
199
200" My Bundles here:
201Bundle 'taglist.vim'
202Bundle 'bufexplorer.zip'
203Bundle 'The-NERD-tree'
204Bundle 'Source-Explorer-srcexpl.vim'
205
206" original repos on github
207Bundle 'tpope/vim-fugitive'
208Bundle 'Lokaltog/vim-easymotion'
209Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
210Bundle 'tpope/vim-rails.git'
211" vim-scripts repos
212Bundle 'L9'
213Bundle 'FuzzyFinder'
214" non github repos
215Bundle 'git://git.wincent.com/command-t.git'
216Bundle 'CCTree'
217" ...
218
219filetype plugin indent on " required!
220"
221" Brief help
222" :BundleList - list configured bundles
223" :BundleInstall(!) - install(update) bundles
224" :BundleSearch(!) foo - search(or refresh cache first) for foo
225" :BundleClean(!) - confirm(or auto-approve) removal of unused bundles
226"
227" see :h vundle for more details or wiki for FAQ
228" NOTE: comments after Bundle command are not allowed..
diff --git a/README b/README
new file mode 100644
index 0000000..632f974
--- /dev/null
+++ b/README
@@ -0,0 +1,5 @@
1$HOME
2.bash_aliases
3.colordiffrc
4.gitconfig
5.vimrc
diff --git a/SrcExpl-5.3.zip b/SrcExpl-5.3.zip
new file mode 100755
index 0000000..5338069
--- /dev/null
+++ b/SrcExpl-5.3.zip
Binary files differ
diff --git a/Sublime/README b/Sublime/README
new file mode 100644
index 0000000..59911d8
--- /dev/null
+++ b/Sublime/README
@@ -0,0 +1,6 @@
1*User
2Link into ~/.config/sublime-text-2/Packages/User
3
4*Plugin Lists:
5TralingSpaces: git://github.com/SublimeText/TrailingSpaces.git
6CTags: git@github.com:bluezery/CTags.git \ No newline at end of file
diff --git a/Sublime/User/Default (Linux).sublime-keymap b/Sublime/User/Default (Linux).sublime-keymap
new file mode 100644
index 0000000..0d4f101
--- /dev/null
+++ b/Sublime/User/Default (Linux).sublime-keymap
@@ -0,0 +1,2 @@
1[
2]
diff --git a/Sublime/User/Default (OSX).sublime-keymap b/Sublime/User/Default (OSX).sublime-keymap
new file mode 100644
index 0000000..0d4f101
--- /dev/null
+++ b/Sublime/User/Default (OSX).sublime-keymap
@@ -0,0 +1,2 @@
1[
2]
diff --git a/Sublime/User/Default (Windows).sublime-keymap b/Sublime/User/Default (Windows).sublime-keymap
new file mode 100644
index 0000000..0d4f101
--- /dev/null
+++ b/Sublime/User/Default (Windows).sublime-keymap
@@ -0,0 +1,2 @@
1[
2]
diff --git a/Sublime/User/Preferences.sublime-settings b/Sublime/User/Preferences.sublime-settings
new file mode 100644
index 0000000..eb8f3de
--- /dev/null
+++ b/Sublime/User/Preferences.sublime-settings
@@ -0,0 +1,13 @@
1{
2 "color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme",
3 "draw_indent_guides": false,
4 "font_face": "Ubuntu Mono",
5 "font_size": 10.0,
6 "rulers":
7 [
8 80
9 ],
10 "smart_indent": false,
11 "translate_tabs_to_spaces": true,
12 "trim_trailing_white_space_on_save": true
13}
diff --git a/Ubuntu.package b/Ubuntu.package
new file mode 100644
index 0000000..adcbd41
--- /dev/null
+++ b/Ubuntu.package
@@ -0,0 +1,2 @@
1Kscope: http://packages.ubuntu.com/precise/kscope
2Insight: https://launchpad.net/~sevenmachines/+archive/dev/+packages
diff --git a/ctags.sh b/ctags.sh
new file mode 100755
index 0000000..ebf8d05
--- /dev/null
+++ b/ctags.sh
@@ -0,0 +1,40 @@
1#/bin/bash
2if [[ ! -d $HOME/.vim ]]; then
3 echo "vim is not installed yet"
4 exit
5fi
6
7TEST=`which ctags`
8if [[ -z "$TEST" ]]; then
9 echo "ctags is not installed yet"
10 exit
11fi
12
13TEST=`which cscope`
14if [[ -z "$TEST" ]]; then
15 echo "cscope is not installed yet"
16 exit
17fi
18
19PREF=$HOME/work/opensrc
20DIR="$PREF/efl $PREF/elementary"
21TAGD=$HOME/.vim/tags
22
23if [[ ! -d $TAGD ]]; then
24 mkdir $TAGD
25fi
26cd $TAGD
27if [[ ! "$?" ]]; then
28 echo "$TAGD is not existed"
29 exit
30fi
31
32# Create ctags
33IGNORE="EINA_ARG_NONNULL"
34rm -rf tags && ctags --c-kinds=+p --sort=foldcase --langmap=c:.c.x.s.S.edc -I $IGNORE $TAGD -R $DIR
35
36# Create cscopes
37rm -rf cscope.files && \
38 find $DIR -name '*.c' -o -name '*.cpp' -o -name '*.h' -o -name '*.h.in' -o -name '*.s' -o -name '*.x' -o -name '*.edc' > cscope.files && \
39 cscope -b -q -k
40
diff --git a/install-ubuntu.sh b/install-ubuntu.sh
new file mode 100755
index 0000000..f8f3a8d
--- /dev/null
+++ b/install-ubuntu.sh
@@ -0,0 +1,154 @@
1#/bin/bash
2#Environment: Ubuntu 13.04
3
4RED='\e[0;31m'
5BLU='\e[0;34m'
6NOC='\e[0m'
7GRN='\e[0;32m'
8
9#param: F L
10function do_link
11{
12 if [ ! -h $L ]; then
13 ln -s $F $L || echo -e "${RED}FIX: File exists($L) but not symbolic linked!!!! ${NOC}"
14 else
15 echo -e "${GRN}$L already symbolic linked ${NOC}"
16 fi
17}
18
19#param: P
20function do_install
21{
22 dpkg -l "$P" > /tmp/null
23 if [ $? = "1" ]; then
24 sudo apt-get install $P || echo -e "${RED}$P cannot be installed ${NOC}"
25 else
26 echo -e "${GRN}$P already installed ${NOC}"
27 fi
28}
29
30#param S T
31function do_clone
32{
33 if [[ ! -d "$T" ]]; then
34 git clone $S $T > /tmp/null || echo -e "${RED}$S cloning failed${NOC}"
35 else
36 cd $T && git pull || echo -e "${RED}$T update failed${NOC}"
37 cd - > /tmp/null
38 fi
39}
40
41### Create home bin directory
42if [[ ! -d "$HOME/bin" ]]; then
43 mkdir $HOME/bin
44fi
45
46### miscellaneous
47F=$PWD/.bash_aliases
48L=$HOME/.bash_aliases
49do_link
50F=$PWD/.colordiffrc
51L=$HOME/.colordiffrc
52do_link
53
54P=checkinstall
55do_install
56
57P=colordiff
58do_install
59
60### GIT
61P=git
62do_install
63F=$PWD/.gitconfig
64L=$HOME/.gitconfig
65do_link
66
67### TMUX
68F=$PWD/.tmux.conf
69L=$HOME/.tmux.conf
70do_link
71P=tmux
72do_install
73
74### CTAGS
75P=ctags
76do_install
77
78### VIM
79P=vim
80do_install
81
82P=vim-scripts
83do_install
84
85
86F=$PWD/.vimrc
87L=$HOME/.vimrc
88do_link
89
90### Run vim and do :BundleInstall
91S="https://github.com/gmarik/vundle.git"
92T="$HOME/.vim/bundle/vundle"
93do_clone
94echo -e "${BLU}Run vim and do :BundleInstall to install vundle completely${NOC}"
95
96## Source Exploere, it can't be installed by vundle :-(
97if [ ! -f "$HOME/.vim/plugin/srcexpl.vim" ]; then
98 unzip SrcExpl-5.3.zip -d $HOME/.vim/ || echo -e "${RED}srcexpl5.3 install failed${NOC}"
99fi
100
101# Sublime Text setting
102S="git://github.com/SublimeText/TrailingSpaces.git"
103T="$HOME/work/github/TrailingSpaces"
104do_clone
105
106S="git://github.com/bluezery/CTags.git"
107T="$HOME/work/github/CTags"
108do_clone
109
110if [ -d "$HOME/.config/sublime-text-2" -a -d "$HOME/.config/sublime-text-2/Packages" ]; then
111 F=$PWD/Sublime/User
112 L=$HOME/.config/sublime-text-2/Packages/
113 do_link
114fi
115
116## ctags.sh scripts
117F=$PWD/ctags.sh
118L=$HOME/bin/ctags.sh
119do_link
120
121# Gnu Global
122if [[ -z `which global` ]]; then
123 sudo apt-get install libncurses5-dev
124 wget http://tamacom.com/global/global-6.2.12.tar.gz && \
125 tar xvzf global-6.2.12.tar.gz && \
126 cd global-6.2.12 && \
127 ./configure && make && sudo checkinstall && \
128 cp /usr/local/share/gtags/gtags.vim $HOME/.vim/plugin
129else
130 echo -e "${GRN}Global already installed${NOC}"
131fi
132
133# Doxygen
134P=doxygen
135do_install
136
137# Dia
138P=dia
139do_install
140
141# htop
142P=htop
143do_install
144
145# dfc
146P=dfc
147do_install
148
149# colorgcc
150P=colorgcc
151do_install
152F=/usr/bin/gcc
153L=$HOME/bin/gcc
154do_link