星期三, 11月 23, 2011

Copy and Past words from OS's clipborad in vim.

In actually, it’s a problem for me when I copy and past words to vim from OS's clipboard.

So I write a simple vim script to support switching modes between autoindent and noautoindents and set keymap “\ i”.


function! SwitchAutoIndent()
if &autoindent  
    set noautoindent
else
    set autoindent
endif
endfunction

nmap <LEADER>i :call SwitchAutoIndent()<CR>

I think it can resolve my problem temporary. Maybe I have to use MacVim because it has no the problem. XD


---
Take notes.



godfat mentioned to use past mode when we want to past words. So I founded some information about pastmode from vim wikiJust set command as the following.


nmap <LEADER>p :set invpaste paste?<CR>

星期日, 11月 20, 2011

llvm 2.9 can not generate doxygen files

I  have solved the problem for the whole night XD.

In fact, it is dissuced in llvm mailing list. What you have to do is to patch the file, reconfigure, recompile and finish the problem. (When I find ethe soluion, I feel I am a stupid guy. Why do I find llvm mailing list first ?)

You can download the path for generating doxygen files from Here.

The following is my personal note for the problem.



  1. First, you have to install graphviz

    1. For MacOSX

       brew install graphviz
      

      If you meet some problem with Mac OSX 10.7 Lion, There are some linking library errors (The issuse is dissued in github: homebrew issues 6645). Just type

       cd /usr/X11/lib
       sudo ln -s libpng12.0.dylib libpng12.dylib
      
      
    2. For Fedora/ CentOS

       sudo yum install graphviz -y
      
      
  2. Patch to support llvm 2.9 can generate the doxygen files
    (The issue is dissued in mailing list)

     cp doxygen.patch $HOME/usr/src/llvm-2.9
     cd $HOME/usr/src/llvm-2.9
     patch -p1 < doxygen.patch
    
    
  3. Add the option in configure command and reconfigure, recompile

     ./configure --prefix=$HOME/usr --with-clang=$HOME/usr --enable-debug-symbols=yes --enable-debug-runtime=yes --enable-shared --enable-static --with-pic --enable-pic --with-clang=$HOME/usr  --enable-doxygen
     make -j4   # It's upto your computer
     make install