跳转至内容
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 发布者 571 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
回复
  • 在新帖中回复
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • 我是小马甲~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 - 热门主题
    • 买火车票优惠
      undefined
      1
      1
      65

    • 联通app去搜 优享会员
      undefined
      1
      1
      144

    • 中国站ESA免费版重磅发布,白嫖阿里云免费ESA安全加速CDN
      L
      LeagueJinx
      0
      7
      228

    • 【邮储银行】微信立减金券包20元~
      不
      不隔山
      0
      2
      49

    • 帕萨特座椅记忆突然失灵,如何恢复?
      我是小马甲~M
      我是小马甲~
      0
      2
      19

    • 移动1元支付宝红包或8元电费券 5元话费券
      不
      不隔山
      0
      2
      191

    • 登录

    • 没有帐号? 注册

    • 登录或注册以进行搜索。
    百度网盘
    2,749 个主题
    夸克网盘
    1,954 个主题
    连续剧
    1,068 个主题
    国产剧
    755 个主题
    美剧
    488 个主题
    动作片
    382 个主题
    动画片
    327 个主题
    恐怖片
    316 个主题

    180

    在线

    42.8k

    用户

    43.5k

    主题

    114.8k

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