Search code examples
linuxvimlinux-mint

Cannot remove right scrollbar in Vim


In my ~/.vimrc I have set guioptions-=r for no right scroll bar. Unfortunately, I still see the right scrollbar in vim (run in terminal), although I cannot scroll it.

This is my ~/.vimrc file:

set nocompatible      " We're running Vim, not Vi!
syntax on             " Enable syntax highlighting
filetype on           " Enable filetype detection
filetype indent on    " Enable filetype-specific indenting
filetype plugin on    " Enable filetype-specific plugins

" Toggle paste with F2 so that pasting from external applications goes well
nnoremap <F2> :set invpaste paste?<CR>
set pastetoggle=<F2>
set showmode

" Mapping ctrl-c ctrl-space to intellisense
inoremap <expr> <C-Space> pumvisible() \|\| &omnifunc == '' ?
            \ "\<lt>C-n>" :
            \ "\<lt>C-x>\<lt>C-o><c-r>=pumvisible() ?" .
            \ "\"\\<lt>c-n>\\<lt>c-p>\\<lt>c-n>\" :" .
            \ "\" \\<lt>bs>\\<lt>C-n>\"\<CR>"
imap <C-@> <C-Space>

" Ruby and Rails preferences
set term=xterm-256color"
colorscheme wombat256mod
set guifont=Monaco:h12
let g:NERDTreeWinPos = "right"
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
autocmd User Rails let b:surround_{char2nr('-')} = "<% \r %>" " displays <%%> correctly
:set cpoptions+=$ " puts a $ marker for the end of words/lines in cw/c$commands 

" Transparent background
hi Normal          ctermfg=252 ctermbg=none
hi NonText         ctermfg=250 ctermbg=none

" Display line numbers
set number

I hope someone can tell me how to get the scrollbar removed.


Solution

  • I have set gui options-=r for no right scroll bar. [...] in vim (run in terminal), although I cannot scroll it.

    Why do you expect a GUI-specific option to have any effect in a non-GUI program?

    The scrollbar you see is your terminal emulator's, not Vim's.

    If you want to get rid of that scrollbar, disable it in your terminal emulator's settings.