Skip to content

Instantly share code, notes, and snippets.

@snitzr
Last active January 14, 2018 06:39
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 snitzr/b3332ee91739bf4df475c59ff3a65f61 to your computer and use it in GitHub Desktop.
Save snitzr/b3332ee91739bf4df475c59ff3a65f61 to your computer and use it in GitHub Desktop.
The .vimrc I use
set nocompatible " must be first
" non-terminal UI edits start
set go-=T " hide toolbar
set go-=r " hide scrollbar
set go-=R " hide scrollbar
set go-=l " hide scrollbar
set go-=L " hide scrollbar
" set go-=m
" set mouse=a
" non-terminal UI edits end
syntax enable
syntax on
colorscheme desert
" how to make Python comments italic. start.
" use a monospace font with an _italic_ set.
" Test your terminal's ability to display italics with: echo -e '\e[3m foo \e[m'
" The default shell app in Raspbian Jessie doesn't display italic, so I installed Terminator.
" Terminal and iTerm can display italics in macOS.
" download and install python.vim file to ~/.vim/syntax.
" add the following to the bottom of python.vim
" syn region Comment start=/""" / end=/ """/
" place after colorscheme in .vimrc:
highlight Comment cterm=italic
set t_ZH=^[[3m
set t_ZR=^[[23m
" how to make Python comments italic. end.
" python PEP 8 settings http://henry.precheur.org/vim/python start
setlocal tabstop=4
setlocal softtabstop=4
setlocal shiftwidth=4
setlocal textwidth=80
setlocal smarttab
setlocal expandtab
" python PEP 8 settings http://henry.precheur.org/vim/python end
set cursorline
set number
set formatprg=par " install par with brew install par
set smartindent
set autoindent
autocmd BufRead *.py set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class
filetype off
filetype plugin on
filetype plugin indent on
set omnifunc=syntaxcomplete#Complete
set ignorecase
set smartcase
set vb " set visual bell
set scrolloff=8 " Number of lines from vertical edge to start scroll
set statusline=%<%F%h%m%r%=\[%B\]\ %l,%c%V\ %P
set ruler
set rulerformat=%25(%Y\ [\-%l\-,\|%v\|]\ %p%%%)
set ttyfast
set wildmenu
set wildignore=*.pyc,*.class
set lazyredraw
set linespace=0
set magic
set backspace=eol,start,indent
set whichwrap=h,l,~,[,]
set linebreak
set textwidth=0
set wrapmargin=0
" search as you type
set incsearch
set gcr=a:blinkon0
set showmatch
set showmode
set nobackup
set nowb
set noswapfile
set encoding=utf-8
set termencoding=utf-8
" no encoding conversion
set fileencodings=
" key maps start
nore ; :
map <silent> <F7> :set nospell!<CR>:set nospell?<CR>
vnoremap < <gv
vnoremap > >gv
nnoremap K kJ
nnoremap Y y$
nnoremap j gj
nnoremap k gk
inoremap fj <Esc>
inoremap jf <Esc>
" disable indent during insert mode start
inoremap <c-t> <nop>
inoremap <c-d> <nop>
" disable indent during insert mode end
" prevent entering Ex mode type visual
map Q <nop>
" arrow keys for split window navigation start
nore <Left> <C-w>h
nore <Down> <C-w>j
nore <Up> <C-w>k
nore <Right> <C-w>l
" arrow keys for split window navigation end
" vim for writing tip from @sedm0784 start
inoremap . .<c-g>u
inoremap ? ?<c-g>u
inoremap ! !<c-g>u
inoremap , ,<c-g>u
" vim for writing end
" key maps end
" abbreviations
:ia teh the
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment