-
Notifications
You must be signed in to change notification settings - Fork 1
/
.rugal_function
112 lines (107 loc) · 2.63 KB
/
.rugal_function
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/bash
ffi ()
{
name=$1;
path=".";
if [[ $# -eq 2 ]]; then
name=$2;
path=$1;
fi;
grep --color=auto -D skip -nRe $name $path
}
function ff()
{
find . -type f -iname '*'$*'*' -ls ;
}
function install_eclim_headless()
{
ECLIPSE_HOME="/usr/local/eclipse"
ECLIM_JAR="$ECLIPSE_HOME/eclim_2.3.2.jar"
if [ ! -d $ECLIPSE_HOME ]
then
echo "eclipse does not exists"
return
fi
if [ ! -e $ECLIM_JAR ]
then
echo "eclim_jar does not exists"
return
fi
sudo apt-get install xvfb build-essential
if [ ! -e $ECLIPSE_HOME/eclimd ]
then
java -Dvim.files=$HOME/.vim -Declipse.home=$ECLIPSE_HOME -jar $ECLIM_JAR install
fi
}
function run_headless_eclimd()
{
ECLIPSE_HOME="/usr/local/eclipse"
Xvfb :1 -screen 0 1024x768x24 &
DISPLAY=:1 $ECLIPSE_HOME/eclimd -b
}
function run_graphical_eclimd()
{
ECLIPSE_HOME="/opt/eclipse"
$ECLIPSE_HOME/eclimd 1>/dev/null 2>&1 &
}
function install_vim()
{
sudo apt-get install libncurses5-dev libgnome2-dev libgnomeui-dev \
libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev \
libxpm-dev libxt-dev python-dev ruby-dev mercurial
sudo apt-get remove vim vim-runtime gvim vim-common vim-tiny
cd ~
hg clone https://code.google.com/p/vim/
cd vim
./configure --with-features=huge --enable-rubyinterp --enable-pythoninterp \
--enable-perlinterp --enable-gui=gtk2 --enable-cscope \
--with-python-config-dir=/usr/lib/python2.7/config-i386-linux-gnu/
make && sudo make install && cd ; rm -rf vim
}
function install_powerline_font()
{
FONTS="~/.fonts"
FONTCONFIG="~/.config/fontconfig/conf.d"
cd ~
mkdir $FONTS $FONTCONFIG -p
wget https://github.com/Lokaltog/powerline/raw/develop/font/PowerlineSymbols.otf \
-O $FONTS/PowerlineSymbols.otf
fc-cache -vf ~/.fonts
wget https://github.com/Lokaltog/powerline/raw/develop/font/10-powerline-symbols.conf \
-O $FONTCONFIG/10-powerline-symbols.conf
}
function init_eclim_classpath()
{
if [ ! -e pom.xml ]
then
exit
fi
if [ ! -e .project ]
then
do_init_eclim_classpath
elif [ $# == 1 ]
then
rm -rf .settings .project .classpath
do_init_eclim_classpath
fi
}
function do_init_eclim_classpath()
{
mvn eclipse:eclipse
vim +MvnRepo +ProjectImport . +qa
}
v2() {
declare q="$*";
curl --user-agent curl "https://v2en.co/${q// /%20}";
}
v2-sh() {
while echo -n "v2en> ";
read -r input;
[[ -n "$input" ]];
do v2 "$input";
done;
}
csv() {
FILE=$1
column -s, -t < $FILE | less -#2 -N -S
}