Skip to content

Instantly share code, notes, and snippets.

@gujiaxi
Last active May 13, 2016 06:28
Show Gist options
  • Save gujiaxi/2725881 to your computer and use it in GitHub Desktop.
Save gujiaxi/2725881 to your computer and use it in GitHub Desktop.
Vim config for remote servers.
set nocompatible " Use Vim defaults
set backspace=indent,eol,start " reasonable backspace in insert mode
set modelines=0 " Modelines are a security hazard
" Formatting
set expandtab " Automatically expand tabs to spaces
set tabstop=2 " tab width
set shiftwidth=2 " wide, otherwise it's tabstop wide
set softtabstop=2 " Simulated tabstop of 4 by using spaces and tabs
set textwidth=78 " where to wrap lines
set fo=crq " when to wrap lines
set autoindent " set auto-indenting on
" Display
set ruler " show the cursor position
set nowrap " don't warp display
set laststatus=2
set encoding=utf-8
set showmatch " show matching brackets
set showcmd " show (partial) command in status line
"set wildmenu
set wildmode=list:longest,full
" Searching
set incsearch " incremental search
set infercase " handle case in a smart way in autocompletes
set ignorecase " ignore case in search
set smartcase " unless the search string contains uppercase
set hlsearch " highlighted search
" Display whitespace characters nicely when using 'set list'
set listchars=eol:$,tab:>-,trail:-,extends:>,precedes:<
filetype plugin on " enable filetype detection
filetype indent on " enable language-depenent indentation
syntax enable
set background=dark
set t_Co=256
colorscheme elflord
highlight clear SignColumn
highlight RedundantSpaces ctermbg=red
match RedundantSpaces /\s\+$\| \+\ze\t\|\t/
set number " line numbers
set scrolloff=5
set hidden
set nobackup
set pastetoggle=<F2>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment