Ever had IM chats where a conversation splits into multiple topics? You’ll be able to follow along, intelligently piecing together which-message-goes-with-which-topic, until the following scenario inevitably occurs:
me: What's on this weekend? Going to the football?
me: Are you and Jackie still seeing each other?
you: Yes
me: Eh? Yes - [...]
Related posts:
Here are the slides from the presentation Amy and I gave at Kings of Code ‘09 in Amsterdam. Probably not too helpful without the audio, it’s mostly for those of you that attended and asked for the slides, so please enjoy Rich and Snappy Apps (No Scaling Required).
You can also grab a PDF (3.4 MB).
Como ele bem comentou lá no post original, nós já temos esses recursos já faz um bom tempo, no bom e velho (jurássico é sacanagem) Vim, e como o autor do post pediu um vídeo para compararmos (ou provarmos que existia mesmo, sei lá), eu fiz esse vídeo aí em cima mostrando como funcionam os recursos similares do Vim para esse tipo de coisa. Vale lembrar, como disse no post original:
Eram 23:36, eu estava com sono e tive que fazer "colinha" do código ali e comi alguma bronha pois ...
... retirei TODOS os plugins e zerei meu .vimrc, deixando ele PELADO para fazer o vídeo. Algumas coisas como o autocomplete de chaves e parênteses sem funcionar deixam a gente perdido. Eram algumas poucas linhas para habilitar isso no arquivo de configuração, antes que falem alguma coisa.
Eu estava rodando ele direto num terminal, para mostrar que mesmo em um terminalzão texto isso tudo funciona. Quebra um baita galho usando com SSH. No modo gráfico fica mais bonito, mas eu quis mostrar na lasqueira mesmo.
Sem chance de ter som no vídeo, o Corinthians estava jogando e o mundo estava se acabando em fogos aqui. :-)
Não, eu não programo em C#, só quis fazer o exemplo ficar igual. ;-)
Eu inseri algumas anotações durante o vídeo, mas dando uma resumida aqui:
O segredo da coisa está na combinação de teclas CTRL+V. Acionando as danadas podemos fazer seleções em blocos.
Depois de selecionar os readonly usando w para ir até no final da palavra e as setas (ou melhor, como anotei lá, usar 4j para descer direto), eu apaguei o bloco com x.
Para fazer as inserções dos m_, eu selecionei o bloco e apertei I (insert), digitando o texto que queria inserir no restante do bloco (no caso, m_) e logo após apertei ESC, o que repetiu tudo o que eu fiz para o restante do bloco.
Para trocar todos os public para readonly, eu selecionei o block e apertei c (change), digitando o texto que queria seguido por ESC.
Para os comentários, selecionei o bloco no final da linha, apertei $A (importante notar o $ que indica o final da linha, e A de append), digitei o texto que queria (// Comment) e apertei ESC.
Para inserir o código novo, digitei a primeira e a segunda linha, sendo que a segunda eu desconfio que saiu fora da indentação pois eu havia deixado a configuração zerada para o teste. Logo após repliquei a segunda linha com y (yank, para copiar) e 4p, o que colou ela 4 vezes. Em seguida marquei o bloco logo acima e copiei e colei com y e p no lugar determinado, retirando que não era necessário com dw (apagar palavra), movendo com w (palavra pra frente) e b (palavra pra trás).
Pronto! O resultado foi similar, lembrando que foi feito em um terminal texto, sem necessidade de modo gráfico, o que várias vezes é uma mão-na-roda e quebra um galhão (ainda mais acessando via SSH) e que temos esse recurso faz um bom tempo já. No modo gráfico fica até mais bonito, e com alguns plugins habilitados a edição fica rápida e matadora!
As combinações de teclas podem assustar em um primeiro momento, mas é como até foi mencionado, se você se acostuma com o editor, é uma coisa meio de reflexo e muito rápida. O Vim assusta em um primeiro contato, mas depois que gosta não fica sem. Vejam a saga do Aurélio com o Vim para ver o tamanho do abacaxi quando se começa a usar o negócio. :-)
Just a quick note for those googling for a solution to this. Older versions of Low Pro for Protoype will be experiencing problems with behaviors in Firefox 3.5. This issue has been fixed so pick up the latest version from GitHub
An interesting upshot of this is that I found out something pretty nice which is kind of obvious but had never occurred to me before. If you create a function in a closure then that function can refer to itself because it has access to that closure’s variables. I normally use arguments.callee to get a reference to a function from within its body but there’s never really any need to do that:
This is definitely one of the most practically useful and potentially career-changing business books I’ve read. As I started getting toward the end, I realized that I should have been taking notes. The book is an excellent read, but at its core, it can be distilled into a clear outline of stuff to do after you read it. I was reading on my Kindle, which I’m still not good at using as a quick reference device. So, while I was excited about going back through the book and making myself a TODO list, I wasn’t sure how to best do it.
Then I remembered Derek Sivers’ book list. Derek has obviously spent a lot of time thoughtfully preparing a list of recommended books with reasons behind each recommendation. Not only that, he includes detailed notes on each book. I read his notes on E-Myth Revisited and was pleased to see that all of the important stuff is captured. Thanks Derek!
Speaking of Derek and books, don’t miss his book, How to Call Attention to Your Music. It might be titled for musicians but I think everyone will find something valuable inside.
A little while ago, Carl and I starting digging into Rails’ initializer. We already made a number of improvements, such as adding the ability to add a new initializer at any step in the process, and to make it possible to have multiple initializers in a single process. The second improvement is the first step [...]
The trial batch of our new course “Ruby Metaprogramming” started recently. On this occasion, RubyLearning caught up with author Paolo Perrotta (who is writing the book “Metaprogramming Ruby“) and chatted with him.
Satish>> Paolo, could you tell us something about yourself – your background, where you are based?
Paolo>> I’m an Italian developer entering his 40s. I [...]
Over the weekend, it was discovered that the json_pure gem is subject to a DoS attack when parsing specially formed JSON objects. This vulnerability does not affect the json gem, which uses a C extension, or ActiveSupport::JSON, which is used in Rails.
By default, Merb uses the json gem, which is not vulnerable, but falls back [...]
There’s only so many hours in the day and only so many technologies people can be awesome at. So sometimes there are projects that developers can’t do themselves. Either the scope is too big, the timeframe to urgent, or it falls outside their areas of expertise. Or you’ve already got yourself a sexy job and [...]
Related posts:
I’ll occasionally be posting on the Engine Yard blog in addition to my posts here. Union Station has really stepped up lately in terms of technical content. We’ve had posts on pairing, TDD with Cucumber, Rack and a slew of other things, and I know there’s more in the pipe.
I posted today on how we’ve [...]
Tell us what you think of the new BlogSphere feature. We are continually looking to improve and update the
functionality based on your feedback.
Disclaimer: This is a publicly accessible database. The views and opinions of originators and contributors expressed on this site do not necessarily state or reflect those of DSC Limited. No representation or warranty is given as regards to any applicability of any suggestion, its accuracy or completeness.