RSS
 

Posts Tagged ‘vim’

VIM 尾部多余字符

21 Nov

今天编辑一个 wordpress 的主题,用 VIM 打开之后发现每一行到尾部都有一个 ^M
这个是 windows 和 linux 到换行符不同导致到

然而在执行替换的时候用键盘输入 ^ 和 M 却不可以,方法在于按Ctrl + Q Ctrl + M 之后也可以出现 ^M 这也两个就成了一个整体,从而执行替换就可以了
所以……就是:

:%s/Ctrl+Q Ctrl+M//g
为什么?我不知道。。嘿嘿……只是刚才碰巧试出来的~

 
No Comments

Posted in notes

 

MiniBufferExplorer And VIM Indent

14 Aug

Screenshot-form.php (-var-www-iriart) - GVIMI install the MinBufferExplorer(VIM plugins page here) into my VIM days before. It is a very good plugin, and it makes my multi-files editing very easy and comfortable.

But, recently, I stuck into one problem: I am on my php project (very tiny;p) now, and when I edit my html part of php files, the VIM can not indent correctly. That HURTS.. Because:

  1. There is no other text editor can move the curse with ‘J’, ‘K’,'L’,'H’. I tried to compromise, but I failed… How could you bear keep deleting so many ‘JKLH’s ?
  2. I’ve get used to use CTRL+N/CTRL+P to automatically complete my phrase. I don’t wanna change it.
  3. the VIM is FREE to use while some editors spending money = =
  4. I JUST LIKE VIM, IT IS MY COMPUTER, IT IS MY CODE, IS THERE MUST BE A REASON?!!



yeah… I know, I am over-reacted, but i DO love vim, you know… with this great passion, I just try to figure out the problem:


I just found that, with the help of MiniBufferExplorer, if I open two files one by one, the quit(:q), the gVIM will not quit, but return the first file, most importantly, without highlight.

Hmm, that is strange right? I thought, damn, it is another problem… As this time, an idea comes to my mind: why not delete the MiniBufferExplorer?

I did, problem solved, include the hightlight one.

To tell the truth: I DO NOT KNOW WHAT’S WRONG WITH MiniBufferExplorer, and the plugin was update in 2004 the last time :(
But it is ok to me to put it away. Maybe, someday I will make it better by myself. LOL

===============================================================

UPDATE: I just got it wrong, IT IS NOT MiniBufferExplorer’s PROBLEM… I AM WORKING ON IT NOW

UPDATE AGAIN: IT IS NOT THE MiniBufferExplorer’s PROBLEM… BUT THE indent file . YOU CAN GET THE SOLUTION VIA HERE.

how stupid i am…:(

 
No Comments

Posted in web