Skip to content

Instantly share code, notes, and snippets.

@mosbth
Last active December 20, 2015 00:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mosbth/6039009 to your computer and use it in GitHub Desktop.
Save mosbth/6039009 to your computer and use it in GitHub Desktop.
My little .vimrc while trying to learn vim.
" netrw
set nocp " 'compatible' is not set
filetype plugin on " plugins are enabled
if version >= 600
filetype plugin indent on
endif
" Set tabwidth and softtabs
" retab
set expandtab tabstop=2 shiftwidth=2
" syntax highlighting
syntax on
" always save when swapping through windows
set autowrite
" make backspace work
set backspace=indent,eol,start
" search with flexible ignore case
" /copyright\c or /copyright\C to override
set smartcase
" spelling
" languages: http://ftp.vim.org/vim/runtime/spell/
set spelllang=sv
"set spell
"set nospell
"setlocal spell spelllang=en
" wrap text
set wrap
set linebreak
" make unicode work
set encoding=utf-8
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
" display syntax for markdown
au BufRead,BufNewFile *.md set filetype=markdown
" display statusbar
set noruler
set laststatus=2
set statusline=%f
set statusline+=[%{strlen(&fenc)?&fenc:'none'}, "file encoding
set statusline+=%{&ff}] "file format
set statusline+=%h "help file flag
set statusline+=%m "modified flag
set statusline+=%r "read only flag
set statusline+=%y "filetype
set statusline+=%= "left/right separator
set statusline+=%c, "cursor column
set statusline+=%l/%L "cursor line/total lines
set statusline+=\ %P "percent through file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment