Skip to content

Instantly share code, notes, and snippets.

@niklasnson
Last active March 15, 2017 07:24
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 niklasnson/f5fd9d91fe9ab4017b76 to your computer and use it in GitHub Desktop.
Save niklasnson/f5fd9d91fe9ab4017b76 to your computer and use it in GitHub Desktop.
execute pathogen#infect()
syntax on
""""""""""""""""""""
" general
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
filetype plugin indent on
set nocompatible
set encoding=utf8
scriptencoding utf-8
""""""""""""""""""""
" user interface
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set so=7 "set 7 lines to the cursor - when moving vertically using j/k
set ruler
set ignorecase
set noerrorbells " no annoying sound on errors
set novisualbell
set tm=500
set number " show line numbers
set cursorline " highlight current line
""""""""""""""""""""
" colors and fonts
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
colorscheme nord
set anti gfn=Ubuntu\ Mono\:h11
""""""""""""""""""""
" files
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set nobackup
set nowb
set noswapfile
""""""""""""""""""""
" searching
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set hlsearch " highlight search
set ignorecase "ignore case when searching
set smartcase
set incsearch "partial search wile searching
set wrapscan
""""""""""""""""""""
" text, tab and editiing
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set expandtab " Use spaces instead of tabs
set smarttab " Be smart when using tabs ;)
set shiftwidth=2 " 1 tab == 2 spaces
set tabstop=2
set softtabstop=2
set autoindent
set expandtab
set lbr
set tw=500 " Linebreak on 500 characters
set ai "Auto indent
set si "Smart indent
set wrap "Wrap lines
set laststatus=2 " always show the status line
""""""""""""""""""""
" key bindings
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let mapleader = ","
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
" map ctrl-movement keys to window switching
noremap <C-k> <C-w><Up>
noremap <C-j> <C-w><Down>
noremap <C-l> <C-w><Right>
noremap <C-h> <C-w><Left>
" disable arrow keys
inoremap <Up> <NOP>
inoremap <Down> <NOP>
inoremap <Left> <NOP>
inoremap <Right> <NOP>
noremap <Up> <NOP>
noremap <Down> <NOP>
noremap <Left> <NOP>
noremap <Right> <NOP>
" map saving to ctrl s
map <C-s> <esc>:w<CR>
imap <C-s> <esc>:w<CR>
" enacs beggining of line
imap <c-e> <c-o>$
imap <c-a> <c-o>^
" ruby on rails
map <Leader>ac :sp app/controllers/application_controller.rb<cr>
map <Leader>bb :!bundle install<cr>
"""""""""""""""""""""""""""""""""""
" undo
"""""""""""""""""""""""""""""""""""""
set history=1000
if !isdirectory($HOME."/.vim")
call mkdir($HOME."/.vim", "", 0770)
endif
if !isdirectory($HOME."/.vim/undos")
call mkdir($HOME."/.vim/undos", "", 0700)
endif
set undodir=~/.vim/.undos " location of the undofile
set undofile " save undofile after file saves
set undolevels=1000 " how many undos
set undoreload=10000 " number of lines to save for undo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment