跳转至内容
0
  • 版块
  • 讨论
  • 最新
  • 标签
  • 热门
  • 顶端
  • 用户
  • 小卖铺
  • 搜索
  • 版块
  • 讨论
  • 最新
  • 标签
  • 热门
  • 顶端
  • 用户
  • 小卖铺
皮肤
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(Zephyr)
  • 不使用皮肤
折叠
色色JIKE社区

Linux VIM 配置内容 .vimrc

已定时 已固定 已锁定 已移动 技术专区
vim8
1 帖子 1 发布者 595 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
回复
  • 在新帖中回复
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • 我是小马甲~M 离线
    我是小马甲~M 离线
    我是小马甲~
    🤫
    写于 最后由 编辑
    #1
    "去掉vi的一致性"
    set nocompatible
    "显示行号"
    set number
    " 隐藏滚动条"    
    set guioptions-=r 
    set guioptions-=L
    set guioptions-=b
    "隐藏顶部标签栏"
    set showtabline=0
    syntax on   "开启语法高亮"
    set background=dark     "设置背景色"
    set nowrap  "设置不折行"
    set fileformat=unix "设置以unix的格式保存文件"
    set cindent     "设置C样式的缩进格式"
    set tabstop=4   "设置table长度"
    set shiftwidth=4        "同上"
    set softtabstop=4
    set smarttab
    set showmatch   "显示匹配的括号"
    set scrolloff=1     "距离顶部和底部5行"
    set laststatus=2    "命令行为两行"
    set fenc=utf-8      "文件编码"
    set backspace=2
    set mouse=v     "启用鼠标"
    set selection=exclusive
    set selectmode=mouse,key
    set matchtime=5
    set incsearch
    set hlsearch        "高亮搜索项"
    set expandtab     "不允许扩展table"
    set whichwrap+=<,>,h,l
    set autoread
    set cursorline      "突出显示当前行"
    hi CursorLine term=bold cterm=bold ctermbg=237
    set cursorcolumn        "突出显示当前列"
    
    nnoremap <C-J> <C-W><C-J>
    nnoremap <C-K> <C-W><C-K>
    nnoremap <C-L> <C-W><C-L>
    nnoremap <C-H> <C-W><C-H>
    
    "F3自动格式化代码
    noremap <F3> :Autoformat<CR>
    let g:autoformat_autoindent = 0
    let g:autoformat_retab = 0
    let g:autoformat_remove_trailing_spaces = 0
    
    
    map <F5> :call CompileRunGcc()<CR>
    func! CompileRunGcc()
            exec "w"
            if &filetype == 'c'
                    exec "!g++ % -o %<"
                    exec "!time ./%<"
            elseif &filetype == 'cpp'
                    exec "!g++ % -o %<"
                    exec "!time ./%<"
            elseif &filetype == 'java'
                    exec "!javac %"
                    exec "!time java %<"
            elseif &filetype == 'sh'
                    :!time bash %
            elseif &filetype == 'python'
                    exec "!clear"
                    exec "!time python3 %"
            elseif &filetype == 'html'
                    exec "!firefox % &"
            elseif &filetype == 'go'
                    " exec "!go build %<"
                    exec "!time go run %"
            elseif &filetype == 'mkd'
                    exec "!~/.vim/markdown.pl % > %.html &"
                    exec "!firefox %.html &"
            endif
    endfunc
    
    " set nocompatible              " required
    " filetype off                  " required
    
    "set rtp+=~/.vim/bundle/Vundle.vim
    "call vundle#begin()
    
    "Plugin 'gmarik/Vundle.vim'
    "Plugin 'Chiel92/vim-autoformat'
    " Plugin 'davidhalter/jedi-vim'
    
    "call vundle#end()            " required
    "filetype plugin indent on    " required
    
    " Uncomment the following to have Vim jump to the last position when
    " reopening a file
    au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
    
    
    
    syntax on
    
    
    

    唐宋元明清,连排小工兵!

    1 条回复 最后回复
    0
    回复
    • 在新帖中回复
    登录后回复
    • 从旧到新
    • 从新到旧
    • 最多赞同


    Popular Topics - 热门主题
    • Cursor Pro 免费 升级 ultra 教程
      Deshen ChenC
      Deshen Chen
      1
      3
      374

    • 2026 元宵节羊毛汇总
      undefined
      1
      1
      378

    • Cursor Team 邀请链接,含20美元调用量
      3
      360hhy
      0
      4
      754

    • windsurf无限方法公开
      V
      vitta
      0
      4
      240

    • 0元白嫖20GB中国移动网上大学流量包,连薅12个月!
      C
      cnfy
      0
      3
      506

    • 上海中行10元毛
      M
      mzrme
      0
      2
      87

    • 登录

    • 没有帐号? 注册

    • 搜索
    中国移动
    306 个主题
    jike早报
    242 个主题
    中国电信
    222 个主题
    滴滴出行
    186 个主题
    滴滴出行代金券
    160 个主题
    中国联通
    91 个主题
    工商银行
    69 个主题
    支付宝
    66 个主题

    73

    在线

    43.1k

    用户

    45.0k

    主题

    116.6k

    帖子
    • 第一个帖子
      最后一个帖子

    与 色色JIKE 的连接断开,我们正在尝试重连,请耐心等待