星期三, 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>

張貼留言