跳转至内容
0
  • 版块
  • 讨论
  • 最新
  • 标签
  • 热门
  • 顶端
  • 用户
  • 版块
  • 讨论
  • 最新
  • 标签
  • 热门
  • 顶端
  • 用户
皮肤
  • Light
  • 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社区
  1. 首页
  2. 讨论区
  3. 技术专区
  4. Linux VIM 配置内容 .vimrc

Linux VIM 配置内容 .vimrc

已定时 已固定 已锁定 已移动 技术专区
vim8
1 帖子 1 发布者 516 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
回复
  • 在新帖中回复
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • 我是小马甲~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 - 热门主题
    • Bug! Bug !Google One 学生优惠 可无门槛验证
      mztcM
      mztc
      3
      14
      5.2k

    • 中国科技云免费白嫖1 年 Cursor 使用权!快~~~
      D
      d914954480
      1
      7
      2.1k

    • MySQL 8.0 OCP 限时免费考
      HebutMrLiuH
      HebutMrLiu
      1
      5
      369

    • 免费科技代理流量巨多
      孤
      孤傲的王
      1
      4
      154

    • 阿里云国际站轻量应用服务器 2C+1G+200M带宽 仅9.9美元一年!
      T
      Test
      1
      4
      1.2k

    • 京东冲100明天送一张25-20外卖卷
      我是小马甲~M
      我是小马甲~
      1
      2
      711

    • 登录

    • 没有帐号? 注册

    • 登录或注册以进行搜索。
    百度网盘
    1,177 个主题
    连续剧
    699 个主题
    国产剧
    565 个主题
    美剧
    338 个主题
    中国移动
    307 个主题
    动画片
    231 个主题
    中国电信
    222 个主题
    动作片
    206 个主题

    110

    在线

    39.9k

    用户

    40.1k

    主题

    110.4k

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