Показаны сообщения с ярлыком vim. Показать все сообщения
Показаны сообщения с ярлыком vim. Показать все сообщения

VIM: Сдвигается курсор при переключении буффера

Я уже привык к этой «фиче», но вот сегодня она снова обратила на себя мое внимание. Вот что ответил google:

if v:version >= 700
  au BufLeave * let b:winview = winsaveview()
  au BufEnter * if(exists('b:winview')) | call winrestview(b:winview) | endif
endif


Источник: http://stackoverflow.com/questions/4251533/vim-keep-window-position-when-switching-buffers



Remove trailing spaces with VIM

When trying to commit Git raised error:
* You have some suspicious patch lines:

The reason was - trailing spaces (spaces before end of line). VIM inserts spaces when auto formatting code. I found a Nice solution at vim.wikia.com. Insert into your .vimrc line:
autocmd BufWritePre * :%s/\s\+$//e

It will remove all trailing spaces after each file write to disk. Very useful.

Also you can disable this git warning by executing:

$ git config --global core.whitespace nowarn



Compile VIM with GTK and Ruby support under FreeBSD


I've installed new FreeBSD  8.0-RELEASE on my laptop. After compiling VIM by:
# cd /usr/ports/editors && make install clean
I've noticed, that it was compiled without ruby support.


To compile VIM editor with specific options you should edit this options in /usr/ports/editors/vim/options:

and then run command:
# cd /usr/ports/editors/vim && make PACKAGE_BUILDING=yes

This will turn on all available flags. Then you should deinstall previous vim:
# cd /usr/ports/editors && make deinstall

and install new:
# cd /usr/ports/editors && make install

or just:
# cd /usr/ports/editors && make reinstall 

After that we have +ruby +perl +python and others. Great :)






VIM. Great tool for programmer

VIM is a great instrument for programmer. It's fast, stable, has a lot functionality. But there is one thing you should know before you start: VIM is extremely shortcut oriented text-editor.

I was a fan of jEdit, but it is very unstable. A lot of plugins are crashing time after time. So I decided to find something else. IDE's like NetBeans and Eclipse are very slow. I've used Emacs and it was interesting. But it wasn't mine. That's why I've tried VIM.

I'm using it about 6 month and I can say, that my happiness is growing day after day.

Plugins, that you have to try:
rails - awesame plugin for Ruby on Rails
matchit - aotocomplete html tags with "Cntrl"+ "Shift" + "_"
autotag - quick updating ctags file after each file write

that's all :)
VIM has all you need out of box. When I'm saying "all you need", I don't mean "all you want" or "all you expected from VIM". There is a VIM Way. It's quite differ from IDE.

Here is my config ~/.vimrc:




2008–2014 © Сергей Удалов Реклама Система Orphus