Skip to content

Instantly share code, notes, and snippets.

@glwagner
Last active March 19, 2018 14:52
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save glwagner/9458803fd4f4d9613d17fcb3800b626c to your computer and use it in GitHub Desktop.
My Ubuntu vimrc with a few humble settings and keymappings.
set nocompatible
filetype off
" Set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'JuliaEditorSupport/julia-vim'
Bundle 'mattn/webapi-vim'
Bundle 'mattn/gist-vim'
runtime macros/matchit.vim
" Numbers
set nu
" Syntax highlighting.
syntax on
" Convert tab key to four spaces.
set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab
autocmd Filetype julia setlocal
\ tabstop=2 softtabstop=0 expandtab shiftwidth=2 smarttab
autocmd Filetype python setlocal
\ tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab
" Create 'stamp' command that replaces current word with yanked text.
nnoremap S madiw"0P`a
" Create a 'paste-replace' command that overwrites with yanked text.
nnoremap V maR<C-R>"<C-[>`a
" Highlight a column at the 80th character for line-length control
set colorcolumn=120
" Uncomment for interesting highlighting of illegal text
" highlight OverLength ctermbg=red ctermfg=white guibg=#592929
" match OverLength /\%>80v.\+/
" Redefine syntax group colors
hi Statement ctermfg=3 " Yellow
hi Identifier ctermfg=5 " Magenta
hi LineNr ctermfg=7 " White
hi Comment ctermfg=0 " Bright black
hi PreProc ctermfg=4 " Blue
hi Constant ctermfg=1 " Green
hi String ctermfg=2 " Red
hi Type ctermfg=6 " Cyan
hi ColorColumn ctermbg=0 " Bright black (same as for comments)
if has("multi_byte")
if &termencoding == ""
let &termencoding = &encoding
endif
set encoding=utf-8
setglobal fileencoding=utf-8
" setglobal bomb
set fileencodings=ucs-bom,utf-8,latin1
endif
" Define digraphs for alphabetic subscripts in .vimrc
execute "digraphs ks " . 0x2096
execute "digraphs as " . 0x2090
execute "digraphs es " . 0x2091
execute "digraphs hs " . 0x2095
execute "digraphs is " . 0x1D62
execute "digraphs ks " . 0x2096
execute "digraphs ls " . 0x2097
execute "digraphs ms " . 0x2098
execute "digraphs ns " . 0x2099
execute "digraphs os " . 0x2092
execute "digraphs ps " . 0x209A
execute "digraphs rs " . 0x1D63
execute "digraphs ss " . 0x209B
execute "digraphs ts " . 0x209C
execute "digraphs us " . 0x1D64
execute "digraphs vs " . 0x1D65
execute "digraphs xs " . 0x2093
execute "digraphs oo " . 0x2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment