Equivalent scrapbook

…scrap on Vim

vim substitude

rename class name to method name


I'm to lazy to figure out the leading underscore :)

multiply string in vim

just in visual mode highlite string row, pres '/' and type



:'<,'>s/mystring/&&'  # vim command line



sings you use more duplication you get

:'<,'>s/mystring/&&&&&&&&'  # vim command line


Charset problem with vim and ruby

if you ever have this problem

 invalid multibyte char (US-ASCII)

just in vim do

set bomb

and save file



install ctags from bash or upgrade it (under ubuntu synaptic is pretty old)

apt-get install ctags

add tags to .gitignore list

ctags -R --exclude=log * --exclude=.git *

screencast source


add alias to your ~/.bashrc (delate old tags, regenerate new tags)

alias ctagrails='rm -R ./tags; ctags -R --exclude=log * --exclude=.git *'??

keywords: ctags c tags navigation jump

h3. Adding and removing quotes with vim combos

As you know vim have build-in text editing combos like @di'@ witch will delete text inside @''@, for example: ??"text" di" will resoult to ""??. I wanted to be able to add/delete quotes braced on word like ??"text" somecombo will resoult to text??. Vim build-in solution doesn't exist, so I had to put into my @.vimrc@ file solution, googled by my college, founded "here":http://vim.wikia.com/wiki/Simple_Macros_to_quote_and_unquote_a_word

??" 'quote' a word
nnoremap qw :silent! normal mpea'bi'

" double "quote" a word
nnoremap qv :silent! normal mpea"<Esc>bi"<Esc>
" remove quotes from a word
nnoremap ciq :silent! normal mpeld bhd `ph??

Now I have combos
??word qw "word"
word qv 'word'
"word" ciq word??

h3. How to join middle mouse button clipboard with vim yank/paste

??set clipboard=unnamed??
now when you select text with mouse, it will be avalible in vim paste (hit p) or other way when you yank text in vim (yy) you can paste it with middle mouse button anywher in your system (in browser for example)

h3. C tags on vim


To turn any indent modes on, with the application in Normal mode, type
. To turn off an indent mode, simply preface the mode name with the word

”. For example, to turn on
, type:
??:set cindent??
To turncindent back off, type:
@:set nocindent@