首页 > 代码库 > 台式机vim配置
台式机vim配置
set autoreadsyntax on"set number" filetype ident on"set autoindent"set expandtabset cindentset shiftwidth=4autocmd FileType make setlocal noexpandtabset tabstop=4set showmatchset matchtime=1set smartindentset scrolloff=3set nocompatible "no vim compatibleset encoding=utf-8set fileencoding=utf-8"set cursorlineset backspace=2" f2 save filemap <F2> :w<CR>" f5 compile funmap <F5> :call CompileRun()<CR>func! CompileRun() if &filetype == ‘c‘ exec "!gcc -std=c99 % -o %<.out && ./%<.out" elseif &filetype == ‘cpp‘ exec "!g++ -std=c++11 % -o %<.out && ./%<.out" elseif &filetype == ‘sh‘ :!./% endifendfunc"gvim解决菜单乱码"language messages zh_CN.utf-8"source $VIMRUNTIME/delmenu.vim"source $VIMRUNTIME/menu.vim" miniBuf configlet g:miniBufExplMapWindowNavVim = 1let g:miniBufExplMapWindowNavArrows = 1let g:miniBufExplMapCTabSwitchBufs = 1let g:miniBufExplModSelTarget = 1" 把空格键映射成:nmap <space> :" 判断操作系统if (has("win32") || has("win64") || has("win32unix")) let g:isWin = 1else let g:isWin = 0endif " 判断是终端还是gvimif has("gui_running") let g:isGUI = 1else let g:isGUI = 0endifif (g:isGUI) set cursorline" colorscheme wombat hi cursorline guibg=#333333 hi CursorColumn guibg=#333333 set guifont=YaHei\ Consolas\ Hybrid\ 12 set mouse=aendifset laststatus=2 " 总是显示状态栏" 用c-j,k在buffer之间切换nn <C-J> :bn<cr>nn <C-K> :bp<cr>" Bash(Emacs)风格键盘绑定imap <C-e> <END>imap <C-a> <HOME>"从系统剪切板中复制,剪切,粘贴map <C-c> "+y"map <F8> "+xmap <C-v> "+p" 插件窗口的宽度,如TagList,NERD_tree等,自己设置let s:PlugWinSize = 25" NERD tree" http://www.vim.org/scripts/script.php?script_id=1658let NERDTreeShowHidden = 1let NERDTreeWinPos = "left"let NERDTreeWinSize = s:PlugWinSize nmap <leader>n :NERDTreeToggle<cr>
台式机vim配置
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。