.vimrc.vim

.vimrc配置


" Startup {{{
filetype indent plugin on


" vim 文件折叠方式为 marker
augroup ft_vim
    au!

    au FileType vim setlocal foldmethod=marker
augroup END
" }}}

" General {{{
set nocompatible
set nobackup
set noswapfile
set history=1024
set autochdir
set whichwrap=b,s,<,>,[,]
set nobomb
set backspace=indent,eol,start whichwrap+=<,>,[,]
" Vim 的默认寄存器和系统剪贴板共享
set clipboard+=unnamed
" 设置 alt 键不映射到菜单栏
set winaltkeys=no
" }}}


" Lang & Encoding {{{
set fileencodings=utf-8,gbk2312,gbk,gb18030,cp936
set encoding=utf-8
set langmenu=zh_CN
let $LANG = 'en_US.UTF-8'
"language messages zh_CN.UTF-8
" }}}

" GUI {{{
" colorscheme Tomorrow-Night

source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
set cursorline
set hlsearch
set number
" 窗口大小
set lines=35 columns=140
" 分割出来的窗口位于当前窗口下边/右边
set splitbelow
set splitright
"不显示工具/菜单栏
set guioptions-=T
set guioptions-=m
set guioptions-=L
set guioptions-=r
set guioptions-=b
" 使用内置 tab 样式而不是 gui
set guioptions-=e
set nolist
" set listchars=tab:▶\ ,eol:¬,trail:·,extends:>,precedes:<
set guifont=Inconsolata:h12:cANSI
" }}}


" Format {{{
set autoindent
set smartindent
set tabstop=4
set expandtab
set softtabstop=4
set foldmethod=indent
syntax on
" }}}


" Keymap {{{
let mapleader=","

nmap s :source ~/.vimrc
nmap e :e ~/.vimrc

map tn :tabnew
map tc :tabclose
map th :tabp
map tl :tabn

" 移动分割窗口
nmap  j
nmap  k
nmap  h
nmap  l

" 正常模式下 alt+j,k,h,l 调整分割窗口大小
nnoremap  :resize +5
nnoremap  :resize -5
nnoremap  :vertical resize -5
nnoremap  :vertical resize +5

" 插入模式移动光标 alt + 方向键
inoremap  
inoremap  
inoremap  
inoremap  

" IDE like delete
inoremap  bdei

nnoremap vv ^vg_
" 转换当前行为大写
inoremap  mzgUiw`za
" 命令模式下的行首尾
cnoremap  
cnoremap  

nnoremap  :setlocal number!
nnoremap w :set wrap!

imap  "+gP
vmap  "+y
vnoremap  d
vnoremap  "+y
vnoremap  "+y
imap         "+gP
map         "+gP
cmap         +
cmap         +

exe 'inoremap 
                    
                    

你可能感兴趣的:(.vimrc.vim)