Gvim:重新采购vimrc时出现空底栏

时间:2014-09-17 13:46:17

标签: vim

我最近决定迁移到Gvim,并注意到我的一些gui特定设置被禁止了。

我已经定义了一个自动命令,在写入它时重新获取$ MYVIMRC,并且在重新获取它时(这在初始启动时不会发生),底部会出现一个空条。我相信它是用于包含水平滚动条的栏。

当我尝试使用

删除滚动条时
:set guioptions-=b
没有任何反应。但是,如果我先添加它然后删除它,

:set guioptions+=b
:set guioptions-=b

它消失了。

我认为这可能与我定义guioptions的方式和时间有关。这是我.vimrc的相关部分:

set guioptions-=m              " GUI: Disable Menu 
set guioptions-=r              " GUI: Disable right scrollbar
set guioptions-=T              " GUI: Disable Toolbar

我试图把它放在augroup这样的

augroup GuiWidgets
  au!
  set guioptions-=m              " GUI: Disable Menu 
  set guioptions-=r              " GUI: Disable right scrollbar
  set guioptions-=T              " GUI: Disable Toolbar
augroup end

但没有区别。

这个问题的根源是什么?


编辑1 - 添加.vimrc

let mapleader = ','
inoremap jj <Esc>
set nocompatible


"********************************
" PLUGINS
"********************************

if has('vim_starting')
  set runtimepath+=~/.vim/bundle/neobundle.vim/
endif

call neobundle#begin(expand('~/.vim/bundle/'))

NeoBundleFetch 'Shougo/neobundle.vim'

NeoBundle 'benmills/vimux'
NeoBundle 'scrooloose/nerdcommenter'
NeoBundle 'scrooloose/syntastic'
NeoBundle 'kana/vim-textobj-entire'
NeoBundle 'kana/vim-textobj-user'
NeoBundle 'Raimondi/delimitMate'
NeoBundle 'Lokaltog/vim-easymotion'
NeoBundle 'godlygeek/tabular'
NeoBundle 'surround.vim'
NeoBundle 'christoomey/vim-tmux-navigator'
NeoBundle 'Shougo/vimproc.vim'
NeoBundle 'Shougo/unite.vim'
NeoBundle 'Shougo/vimshell.vim'
NeoBundle 'c.vim'

call neobundle#end()
filetype plugin indent on

NeoBundleCheck


"******************************
" PLUGIN SETTINGS
"******************************

nnoremap <C-p> :Unite file_rec/async:! -silent -start-insert -auto-resize<CR>


"******************************
" PLUGIN MAPPINGS
"******************************

map <Space> <Plug>(easymotion-prefix)

cnoreabbrev bi Unite neobundle/install
cnoreabbrev bu Unite neobundle/update
cnoreabbrev bc NeoBundleClean

nmap <Leader>a= :Tabularize /=<CR>
vmap <Leader>a= :Tabularize /=<CR>
nmap <Leader>a: :Tabularize /:\zs<CR>
vmap <Leader>a: :Tabularize /:\zs<CR>
nmap <Leader>a# :Tabularize /#<CR>
vmap <Leader>a# :Tabularize /#<CR>


"******************************
" GENERAL SETTINGS
"******************************

set t_Co=256                   
let g:molokai_original=0       
colorscheme molokai            
filetype plugin indent on      
syntax on                      

set complete-=t                
set gfn=Source\ Code\ Pro\ 10  
set encoding=utf-8             
set number                     
set lazyredraw                 
set completeopt-=preview       
set ttyfast                    
set backspace=indent,eol,start 

set hidden                     
set showmatch                  
set wildmode=longest:list,full 
set wildmenu                   
set shortmess+=I               
set showcmd                    
set showmode                   
set clipboard=unnamed          

set history=50                 
set nrformats=                 
set autoread                   
set ruler                      
set laststatus=2               
set scrolloff=8                
set visualbell                 
set splitright                 

set smarttab                   
set autoindent                 
set expandtab                  
set tabstop=4                  
set shiftwidth=4               
set softtabstop=4              
set ignorecase smartcase       
set gdefault                   

set incsearch                  
set hlsearch                   
set nobackup                   
set noswapfile                 
set ttimeoutlen=50             
set relativenumber             
set cursorline                 
set cc=80                      

set guioptions-=m             
set guioptions-=r             
set guioptions-=T             
"set guioptions=

match ErrorMsg '\%>80v.\+'


"***************************
" GENERAL MAPPINGS
"***************************

map cn <Esc>:cn<CR>
map cp <Esc>:cp<CR>
nmap <CR> o<Esc>k
inoremap {<CR> {<CR>}<C-o>O
nnoremap <leader>v :e $MYVIMRC<CR>
nnoremap <leader>h  :let @/ = ""<CR>
nnoremap n nzz
nnoremap <silent> <leader>; :call setline('.', getline('.').';')<CR>
nnoremap <leader>q <C-w>q<CR>
nnoremap <leader>w :w<CR>
nnoremap <silent> <leader>d :bp\|bd #<CR>
nnoremap <leader>c :cd %:p:h<CR>
cnoreabbrev ci( %ci(
cnoreabbrev ci) %ci)
cnoreabbrev ci[ %ci[
cnoreabbrev ci[ %ci]
cnoreabbrev ci{ %ci{
cnoreabbrev ci} %ci}


"***************************
" AUTOCOMMANDS
"***************************

" Auto-source .vimrc
augroup Vimrc
    au!
    au bufwritepost .vimrc source $MYVIMRC
augroup end

" Filetype-specific settings
augroup Filetypes
    au!
    "au FileType c nmap <leader>r :SCCompileRun<CR>
    au FileType c nmap <leader>r :make\|!./%:r<CR>
    au FileType c setlocal sw=2 sts=2 
    au FileType ruby nmap <leader>r :call RunByFiletype("ruby")<CR>
augroup end


编辑2 - 添加图片
(抱歉小尺寸)

启动时 On startup

在采购.vimrc之后(出现空的滚动条容器) enter image description here

运行后:设置guioptions + = b(水平滚动条添加到容器中) enter image description here

跑步后:设置guioptions- = b(水平容器消失) enter image description here

运行后:设置gfn = Source \ Code \ Pro \ 10(该栏重新出现) enter image description here

2 个答案:

答案 0 :(得分:0)

结束创建一个块来初始化我想在启动时设置的GUI特定选项,而不是.vimrc的资源。我将不再看到&#34;即时效果&#34;改变$ MYVIMRC中的guifont,但这将使底线无法出现。

if has('gui_running')
    if has('vim_starting') 
        set gfn=Source\ Code\ Pro\ 10
        set guioptions-=m
        set guioptions-=T
        set guioptions-=r
        set guioptions+=c
    endif
endif

答案 1 :(得分:0)

这是终端中的Vim

enter image description here

我将GVim平铺到右上角的另一个例子

enter image description here

正常边缘大小在左侧,而在右侧,是由于平铺和字体高度导致的强制边缘大小。

相关问题