Loading ...
Sorry, an error occurred while loading the content.
Skip to search.

3687Re: [hackers-il] enhancing the 'Unix IDE'

Expand Messages
  • Shlomi Fish
    Apr 29, 2004
      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.]
    • Show all 15 messages in this topic