Skip to content

Instantly share code, notes, and snippets.

@toulouse
Created April 15, 2014 18:33
Show Gist options
  • Save toulouse/10756871 to your computer and use it in GitHub Desktop.
Save toulouse/10756871 to your computer and use it in GitHub Desktop.
Some useful vimrc settings
""" Settings
imap \ymd <C-R>=strftime("%Y.%m.%d")
imap \date <C-R>=strftime("%c")
imap \vimss :s/\s\+$//<CR>i
set nocompatible " Don't care about vi compatibility
set backupdir=~/.vim/backup " Backup - specify directory
set directory=~/.vim/backup
set backup
""Display
set showcmd " display incomplete commands at bottom of screen
set ruler " show the cursor position all the time
set number " show line numbers
set showmatch " highlight matching parens
set scrolloff=3 " keep 3 lines above and below cursor
syntax on " syntax highlighting
colorscheme default
set wildmenu
"set background=dark "use if background is dark
""Searching
set incsearch " do incremental searching
set hlsearch " highlight searches
""Editing
" So delete isn't broken
set backspace=indent,eol,start
set formatoptions-=tc " autoformatting is inconvenient
set tabstop=4 "width of tabs
set shiftwidth=4 "indent width
set noexpandtab
set smarttab
set smartindent
set autoindent " always set autoindenting on
""Misc.
set history=100 " keep 100 lines of command line history
set wildignore+=*.log,*.out,*.o "completion ignores these extensions
set wildignore+=*.pyc,*.zip,*.gz,*.bz,*.tar,*.jpg,*.png,*.gif,*.avi,*.wmv,*.ogg,*.mp3,*.mov
"""Movement
nnoremap ; gt
nnoremap ' gT
" sensibly navigate wrapped lines
noremap j gj
noremap k gk
" Just a few emacs bindings...
inoremap <C-A> <Home>
inoremap <C-E> <End>
cnoremap <C-A> <Home>
cnoremap <C-E> <End>
nnoremap <C-A> <Home>
nnoremap <C-E> <End>
vnoremap <C-A> <Home>
vnoremap <C-E> <End>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment