跳转至内容
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 发布者 559 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
回复
  • 在新帖中回复
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • 我是小马甲~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 - 热门主题
    • 免费音乐下载网站
      L
      liuckv
      2
      4
      123

    • OpenAI Sora 2 邀请码
      M
      moon_
      1
      26
      169

    • 交城乡居民社保减了188
      我是小马甲~M
      我是小马甲~
      1
      3
      585

    • 免费领取一个月的 Perplexity Pro 会员
      undefined
      1
      1
      102

    • 游玩北京野生动物园分享
      undefined
      1
      1
      328

    • 【建行】大毛提醒,领立减金或京东支付券~
      undefined
      0
      1
      32

    • 登录

    • 没有帐号? 注册

    • 登录或注册以进行搜索。
    百度网盘
    2,314 个主题
    夸克网盘
    1,231 个主题
    连续剧
    947 个主题
    国产剧
    698 个主题
    美剧
    445 个主题
    中国移动
    307 个主题
    动画片
    294 个主题
    动作片
    277 个主题

    151

    在线

    42.2k

    用户

    42.4k

    主题

    113.4k

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