vimrc의 기록

5506 단어 vimvimrc
필요한 플러그인,nerdtree,pydiction,markdown,Calendar,pydoc,MiniBufExplorer
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin

set ignorecase smartcase "         ,                      

set history=400
"     
set go=

set nu "     
set ruler
set rulerformat=%55(%{strftime('%a\ %b\ %e\ %I:%M\ %p')}\ %5l,%-6(%c%V%)\ %P%)

set paste

"          
"set clipboard+=unnamed 

set cursorline cursorcolumn

syntax enable "       
syntax on "              ,        
colorscheme evening "       

set showcmd "              

set fileencoding=utf-8 "        
set encoding=utf-8
set tenc=utf-8
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1

"  consle    
language messages zh_CN.utf-8
set termencoding=cp936


filetype on "         
filetype plugin on "                  


if has("autocmd") && exists("+omnifunc")
autocmd Filetype *
\ if &omnifunc == "" |
\ setlocal omnifunc=syntaxcomplete#Complete |
\ endif
endif

set laststatus=2 "      
set statusline=%2*%n%m%r%h%w%*\ %F\ %1*[FORMAT=%2*%{&ff}:%{&fenc!=''?&fenc:&enc}%1*]\ [TYPE=%2*%Y%1*]\ [COL=%2*%03v%1*]\ [ROW=%2*%03l%1*/%3*%L(%p%%)%1*]\ [DATE=%2*%{strftime(\"%c\",getftime(expand(\"%%\")))}%1*]

function! InsertStatuslineColor(mode)
  if a:mode == 'i'
    hi statusline guibg=peru
  elseif a:mode == 'r'
    hi statusline guibg=blue
  else
    hi statusline guibg=black
  endif
endfunction

au InsertEnter * call InsertStatuslineColor(v:insertmode)
au InsertLeave * hi statusline guibg=orange guifg=white
hi statusline guibg=black

hi User1 guifg=gray
hi User2 guifg=red
hi User3 guifg=white

set winaltkeys=no

" map
nmap <tab> V>
nmap <s-tab> V<
vmap <tab> >gv
vmap <s-tab> <gv
"         
map <F2> <Esc>:browse saveas<CR>
"   NERDTree        
nmap <F3> :NERDTreeToggle<CR>
"   /    
nmap <silent> <F5> <Esc>:call ToggleWrap()<CR>
"   /      
nmap <silent> <F6> <Esc>:call ToggleCursor()<CR>
"      
map <F10> <Esc>:tabnew<CR>
"   /       
nmap <silent> <A-f> <Esc>:call ToggleHLSearch()<CR>

function! ToggleWrap()
     if &wrap
          set nowrap
     else
          set wrap
     endif
endfunction

function! ToggleHLSearch()
     if &hls
          set nohls
     else
          set hls
     endif
endfunction

function! ToggleCursor()
     if &cursorcolumn
          set nocursorline nocursorcolumn
     else
          set cursorline cursorcolumn
     endif
endfunction


let mapleader=";" "         , <Leader>
nmap <leader>v :tabedit $MYVIMRC<CR>

"     
autocmd bufwritepost _vimrc source $MYVIMRC

"       
set fileformats=unix,dos,mac

" Template
autocmd! BufNewFile * silent! 0r $VIM/vimfiles/skel/Template.%:e

"    ,   swp   
set nobackup
set nowb 
set noswapfile

"         
autocmd! BufNewFile,BufRead * setlocal nofoldenable
"   /      
nnoremap <space> za

"        
let g:LargeFile=10

"       
set autoread

hi NonText ctermfg=247 guifg=#a73111 cterm=bold gui=bold
hi SpecialKey ctermfg=77 guifg=#654321

augroup filetypedetect
   au BufNewFile,BufRead *.mxl setf mxl
augroup END

"      gc        
vnoremap gc "+y<Esc>
"   gp
nmap gp <S-Insert>

"      
set smartindent 
set ai!
set si
set shiftwidth=4  
set tabstop=4  
set softtabstop=4  
set expandtab  
set smarttab  
set backspace=2     "             

"                
set showmatch

"       ,    html <>
set matchpairs=(:),{:},[:],<:> 

if has("gui_running")  
    "set lazyredraw  "      
    "set guioptions-=m   "       
    "set guioptions-=T   "        
    set guifont=Consolas:h14
    "set guifontwide=Consolas:h12,Consolas:Bold:h12
endif  


"              
set bsdir=buffer 

set autochdir
"NERD Tree
let NERDChristmasTree=1
let NERDTreeAutoCenter=1
let NERDTreeBookmarksFile=$VIM.'\Data\NerdBookmarks.txt'
let NERDTreeMouseMode=2
let NERDTreeShowBookmarks=1
let NERDTreeShowFiles=1
let NERDTreeShowHidden=1
let NERDTreeShowLineNumbers=1
let NERDTreeWinPos='left'
let NERDTreeWinSize=31
let NERDTreeIgnore = ['\.pyc$']
nnoremap f :NERDTreeToggle<CR>

" vim         
nmap gh <C-W>h
nmap gk <C-W>k
nmap gj <C-W>j
nmap gl <C-W>l
"        gt gT

"python --
"pydiction
filetype plugin on
let g:pydiction_location = $VIM.'/vimfiles/complete-dict'
"default g:pydiction_menu_height = 15
let g:pydiction_menu_height = 20
"pydoc
"        Pydoc select      select.__doc__
"  from socket import select        select         K    
"   pydoc      
let g:pydoc_cmd = 'python -m pydoc'
"   pydoc           
let g:pydoc_open_cmd = 'tabnew'
"  
let g:pydoc_highlight=0
"ctrl+d   python
map <C-D> :!python %<cr>

"Calendar.vim
let g:calendar_diary = "D:/97-diary" "          
let g:calendar_monday = 1 "       
let g:calendar_focus_today = 1 "          
let g:calendar_mark = 'left-fit' "   *      

"markdown
let g:vim_markdown_folding_disabled=1

"MiniBufExplorer
let g:miniBufExplorerMoreThanOne=0

좋은 웹페이지 즐겨찾기