Search the web
Sign In
New User? Sign Up
hackers-il · Creative programming discussed
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.

Messages

  Messages Help
Advanced
enhancing the 'Unix IDE'   Message List  
Reply Message #3687 of 5109 |
Re: [hackers-il] enhancing the 'Unix IDE'

Well, I also use the UNIX IDE with a different variation than Guy's (terminals
with bash, gvim, make, perl, perl -d, gdb, etc) and like it a lot. Until some
time ago, I indeed did a lot of repetitive commands, but eventually came out
with the concept of "bash themes". Meaning that I type "Theme $project" and
have a bash customization suitable for the project. There are several
projects that I'm involved in and each one requires its own customizations.

It works like that. In my .bashrc I have:

<<<
function load_common
{
source "$HOME/.bash_themes/common/$1.bash"
}

function Theme
{
theme="$1"
shift;
filename="$HOME/.bash_themes/themes/$theme/source.bash"
test -e "$filename" || { echo "Unknown theme" 1>&2 ; return 1; }
source "$filename"
}

complete -W "$(cat $HOME/.bash_themes/list-of-themes.txt)" Theme
>>>

"load_common" is a utility function used by the theme scripts. "Theme"
actually loads a theme file. The "complete" function makes sure "Theme" has
tab-auto-completion based on the themes present. (list-of-themes.txt is
generated by a small script I created for the purpose).

Now most of my themes until now were pretty simple: define a "$this" variable
with the root of the working area, and cd to "$this" automatically. This all
changed when I started working on an elaborate patch to Subversion a while
ago. As a result my "svn" theme became this monster:

<<<
load_common mymake

this="/home/shlomi/progs/svn/SVN-From-Repos/Peg-Revision/trunk"
test_dir="$this/subversion/tests/clients/cmdline/"
test_file="$test_dir/past_loc_tests.py"
patches_dir="/home/shlomi/progs/svn/SVN-From-Repos/patches"

Edit_tests()
{
gvim "$test_file"
}

Edit_fs()
{
gvim "$this/subversion/libsvn_fs/tree.c"
}

gen_patch()
{
(cd $this ;
a=$(cd $patches_dir ;
ls peg-revision-tng-rev* |
sed 's/^peg-revision-tng-rev\([0-9]\+\).patch/\1/' |
sort -n |
tail -1
) ;
let a++;
svn diff > $patches_dir/peg-revision-tng-rev"$a".patch
)
}

Run_svnserve()
{
(cd $this;
subversion/svnserve/svnserve -d -r `pwd`/subversion/tests/clients/cmdline
)
}

cd $this
>>>

And I could perhaps use more stuff there, for which the shell history was
sufficient for the time being.

As for gvim customizations, I have this:

<<<
" map <F8> :r /home/shlomi/Docs/lecture/html/texts/mycode.html<CR>
map <F8> :r /home/shlomi/Docs/lecture/Gimp/slides/mydemo.html<CR>
" map <F4> :r /home/shlomi/Docs/lecture/Gimp/slides/menupath.html<CR>
map
<F4> :r
/home/shlomi/Docs/Univ/Homework/SICP/homework/SICP/hw5/mycode.txt<CR><CR>
" map <F6> :r /home/shlomi/Docs/lecture/Gimp/slides/h3_notbold.html<CR>

" Set Incremental Search (I-Search)
set incsearch

" set guifont=-biznet-courier-medium-r-normal-*-*-140-*-*-m-*-iso8859-2
" set guifont=-adobe-courier-medium-r-normal-*-*-140-*-*-m-*-iso8859-1

" map <F3> 0"5y$:!xmms -e '<C-R>5'<CR><CR>
" map <S-F3> 0"5y$:!xmms '<C-R>5'<CR><CR>

source ~/conf/Vim/xmms.vim

" map <F3> 0"5y$ji<CR><ESC>ki<C-R>5<ESC>:s/'/'\\''/ge<CR>0"5y$:!xmms -e
'<C-R>5'<CR><CR>ddk
" map <S-F3> 0"5y$ji<CR><ESC>ki<C-R>5<ESC>:s/'/'\\''/ge<CR>0"5y$:!xmms
'<C-R>5'<CR><CR>ddk

an 50.740 &Syntax.Convert\ to\ &WML :so
$VIMRUNTIME/syntax/2html.vim<CR>:%!wml_safe.pl<CR>

let @s = ":r sect_template.xml\n"

" Expand the syntax menu automatically
let do_syntax_sel_menu = 1
runtime! synmenu.vim
" aunmenu &Syntax.&Show\ individual\ choices

let html_use_css = 1

autocmd BufNewFile,BufRead ~/progs/svn/*.[ch] so ~/conf/Vim/svn-dev.vim
autocmd BufNewFile,BufRead ~/Download/unpack/graphics/gimp-cvs/*.[ch] so
~/conf/Vim/svn-dev.vim

so ~/conf/Vim/perl-test-manage.vim

autocmd BufNewFile,BufRead *.t set filetype=perl
autocmd BufNewFile,BufRead *.t map <F3> :call Perl_Tests_Count()<CR>
autocmd BufNewFile,BufRead ~/Download/unpack/graphics/*.pdb set filetype=perl

set guifont=Bitstream\ Vera\ Sans\ Mono\ 12

so ~/conf/Vim/hebrew.vim

autocmd BufNewFile,BufRead ~/Svn/homework/*.tex set encoding=iso8859-8

" To make sure Python file editing is tabbed according to 2 spaces
" in the subversion Python files.
autocmd BufNewFile,BufRead ~/progs/svn/*.py retab 2
autocmd BufNewFile,BufRead ~/progs/svn/*.py set shiftwidth=2

>>>

Best Regards,

Shlomi Fish



On Thursday 29 April 2004 02:03, guy keren wrote:
> after about a decade of programming using the 'Unix IDE' (2-4 terminal
> windows with shells, vi, etc), i've finally realized i'm not about to
> transition into using a conventional IDE. thus, i made a decision to make
> sure my Unix IDE is the best i can have. for that, i decided that whenever
> i encounter some task that, during development, i already performed
> hundreads of times in the past, i will automate it in a better manner.

---------------------------------------------------------------------
Shlomi Fish shlomif@...
Homepage: http://shlomif.il.eu.org/

Quidquid latine dictum sit, altum viditur.
[Whatever is said in Latin sounds profound.]



Thu Apr 29, 2004 10:48 am

shlomif@...
Send Email Send Email

Message #3687 of 5109 |
Expand Messages Author Sort by Date

after about a decade of programming using the 'Unix IDE' (2-4 terminal windows with shells, vi, etc), i've finally realized i'm not about to transition into...
guy keren
choogalu
Offline Send Email
Apr 28, 2004
8:40 pm

Hello Guy, Your idea is very right approach to extremely high productivity in computer use and software development. I'd like to suggest another approach, of...
Omer Zak
omerz@...
Send Email
Apr 28, 2004
11:08 pm

... That's what a shell history is for. Searching in it using ctrl-r is very useful. BTW: I occasionally automate shell commands in a project using a makefile....
Tzafrir Cohen
ctzafrir
Online Now Send Email
Apr 29, 2004
1:46 pm

... can you give some concrete examples? in particular, examples for tasks that are not too project-specific? -- guy "For world domination - press 1, or dial...
guy keren
choogalu
Offline Send Email
Apr 29, 2004
9:50 pm

... Here's one example: I had to run some tests on a remote system. Remote as in: slow trafic, and line may go down unexpectedly. It involved first syncing the...
Tzafrir Cohen
ctzafrir
Online Now Send Email
May 7, 2004
8:13 pm

The problem of navigating through deeply-nested directories is a general one, which affects interactive shell work, filename selection dialogs (such as Open...
Omer Zak
omerz@...
Send Email
Apr 28, 2004
11:17 pm

Re: $SUBJ: I've been using the following little bash routines for too many years to count: # search for directories containing pattern: # first call cdsload,...
Oleg Goldshmidt
pub@...
Send Email
Apr 30, 2004
3:38 pm

... One note: if you ever feel that the syntax of aliases is too limiting, try using functions instead. E.g: function fvi() { vi `find ${PROJ_HOME} -name "$1"...
Tzafrir Cohen
ctzafrir
Online Now Send Email
Apr 29, 2004
6:18 am

... Here are a few zero and one-liners I use all the time: # every ooo binary knows to open other types function ooo { /usr/lib/openoffice/program/soffice.bin...
Muli Ben-Yehuda
muxtub2001
Offline Send Email
Apr 29, 2004
6:59 am

My $0.02 ... # -*- sh-mode -*- # # echoes output common::echo() { echo "$*" } # # echoes output without trailing carriage return common::necho() { printf "$*" ...
Omer Musaev
omermus
Offline Send Email
Apr 29, 2004
8:48 am

Some petty notes: Usually it is better to use "$@" instead of "$*" : ... Here it doesn't really matter ... Here "$*" should indeed be used ... Why not simply: ...
Tzafrir Cohen
ctzafrir
Online Now Send Email
Apr 29, 2004
1:37 pm

... why not show us some of your python code too ? Gabor...
Gabor Szabo
gabor529
Offline Send Email
Apr 29, 2004
6:50 pm

Well, I also use the UNIX IDE with a different variation than Guy's (terminals with bash, gvim, make, perl, perl -d, gdb, etc) and like it a lot. Until some ...
Shlomi Fish
shlomif@...
Send Email
Apr 29, 2004
10:55 am

... You may want to consider using vim to help you find a file in a given search path: set PATH=** ... I find wcd (Wherever Change Directory) very handy as...
hackers-il@...
Send Email
Apr 30, 2004
10:52 am

... is there a way to use this feature during file-name completion? the hting is that file names in large projects can get quite long, and file-name completion...
guy keren
choogalu
Offline Send Email
Apr 30, 2004
4:57 pm
Advanced

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help