[vim] Why I emphasize “know your editor well, don’t just use it because of nothing or popularity”, because once we “know” our editor, it can increase productivity.

The first long one gives me nice status bar, but only if I :split my vim. (I always use :spl and :vspl, ex. my code is at the top and the rspec code at the bottom vim, I probably will do :! to execute command automatically from ViM [Lazy to move around again if I’m already inside ViM])

set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [ASCII=\%03.3b]\[HEX=\%02.2B]\ [POS=%04l,%04v][%p%%]\ [LEN=%L]
set nowrap
set backspace=indent,eol,start
set nu
set history=50		" keep 50 lines of command line history
set ruler		" show the cursor position all the time
set showcmd		" display incomplete commands
set incsearch		" do incremental searching

I got codes below from vimrc examples, so it’s easy to do :r or just copy paste if I use Textmate/or emacs (anyway). It’s handy so vim will detect automatically what type of file currently being edited.

" Only do this part when compiled with support for autocommands.
if has("autocmd")

  " Enable file type detection.
  " Use the default filetype settings, so that mail gets 'tw' set to 72,
  " 'cindent' is on in C files, etc.
  " Also load indent files, to automatically do language-dependent indenting.
  filetype plugin indent on

  " Put these in an autocmd group, so that we can delete them easily.
  augroup vimrcEx

  " For all text files set 'textwidth' to 78 characters.
  autocmd FileType text setlocal textwidth=78

  " When editing a file, always jump to the last known cursor position.
  " Don't do it when the position is invalid or when inside an event handler
  " (happens when dropping a file on gvim).
  autocmd BufReadPost *
    \ if line("'\"") > 0 && line("'\"") <= line("$") |
    \   exe "normal g`\"" |
    \ endif

  augroup END


  set autoindent		" always set autoindenting on

endif " has("autocmd")

[search from many multiple files at once in vim] it’s just from my feeling. doing shift command f inside textmate or doing grep on bash just feels the same. running grep from terminal as heavy as inside textmate. cmiiw pls (especially with bin/time and/or any benchmarking numerics result), but this one was fast, whoop…, i don’t know why

:vimgrep /redirect_to/ /Users/arie/Projects/eee/app/controllers/*.rb

oh we can do :clist to display all of our search results, or just :cnext or :cprevious to know where the result files are.

[ruby migration] selain data mapper yg main hapus saat rake dm hingga tetap aja satu satu :-P peraturan nomor 51 lakukan ini lakukan itu, kapan ngeliat migration yang bersih :-(

[ruby migration] walau diawali dengan mencoba mereplika bug di localhost dan fine fine terus dan hati makin kesal berbulu bulu gorila tapi tangan ini juga terasa gatal dan berdarah darah arghghghgh kalau kusabar-sabarkan replikasi dari database di culik boleh juga kalo gak sampe puluhan giga satu tabel -_- (pret!)

[ruby migration] (500 records) boom boom boom boom boom! manisnya… :-) gini nih kalo kekurangan integration testing! Idealisme seorang tukang koding emang sering gak bersesuaian dengan idealisme kenyataan hidup , sidenote makanya dulu dulu salah sendiri kenapa tolol koding bego gitu, coba pakai yang bersih kan gak ngomel2 gini!

[textmate shortcut of the day] command alt zero (yes, 0, not O letter) to fold and unfold.

[man -M .] man -M . git-fetch inside git repo / but remember to git checkout head/man first. just like when we play around with git checkout head/html so git manual will be available locally

[ruby shell = rush] wah yang kuat sama networking trus sama yang low low sama operating system bagus nih main ginian! daripada “turun derajat” dengan bash ato bermain perl oneliner yang gampang banget ditulis dan tak akan pernah ingin dibaca (kaburrr….)

[obat sambil koding sambil cegukan] orang finlandia bukan cuma bakat mbikin hengpon nokia tapi ternyata juga bisa ngajarin supaya bisa sembuh dari cigukan =)) kesian kali tu bule ngeliat gw sambil koding sambil cigukan mulu’ udah smbil minum kopi panas masih juga… dikasitau caranya tarik napas dalam dalam simpan semua nafas itu trus tahan napas. trus keluarkan/hembuskan perlahan2, udah gitu pas gw praktekin sembuh betulan =)) paten ! =)) linggisnya hickup hikup atau apa gitu deh..

[alias method and alias] alias method must be inside a class. alias could be anywhere, i found there 3 difference about them, now i forgot where i read them … oh peepcode.. but anyway, here’s my irb copy paste:

m:code arie$ irb
>> def foo; 'hi'; end
=> nil
>> alias :bee :foo
=> nil
>> bee
=> "hi"
>> alias_method :new_foo, :foo
NoMethodError: undefined method `alias_method' for main:Object
	from (irb):4
>> Object.respond_to?("alias_method")
=> false
>> Class.respond_to?("alias_method")
=> false
>> class Coba
>> end
=> nil
>> Kernel.respond_to?("alias_method")
=> false
>> class Coba
>>   def foo; 'hi'; end
>>   alias_method :new_one, :foo
>> end
=> Coba
>> c = Coba.new
=> #
>> c.new_one
=> "hi"
>> exit
m:code arie$ 

ya awalnya gw ngotot metode-metode yang ada tsb kan berada dalam Object, lha si Object kan mbahnya si Object di Ruby. Tapi tetap, harus berada di dalam class. Kalau baca manual ri tentang alias method merupakan metode dari Module mixin.

[capistrano] cap -S stage=production deploy / kalo default cap deploy doang ke staging misalkan.

tinggalkan feedback konstruktif atau lebih baik diam

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s