"#========================#" "# vimrc file for niblock #" "#========================#" " Type :so % to refresh .vimrc after making changes "###### "# General Settings "## " Be IMproved ( Why? https://goo.gl/2RiJoo ) set nocompatible " Necessary for Syntax hilighting and cool stuff syntax on filetype plugin indent on set encoding=utf-8 " Auto-reload files changed outside Vim set autoread " Shows you which commands you're typing set showcmd " Enable line numbers set number " Indendation modifications " Auto indent; set spacing; use spaces set autoindent set expandtab set smarttab set tabstop=4 set shiftwidth=4 set softtabstop=4 " File-Type Specifics augroup customfiletypes " Clear old autocmds in group autocmd! " Set auto-indent to two spaces, always expand tabs autocmd FileType ruby,eruby,yaml set sw=2 sts=2 augroup END " Spacing " Set width; word wrap; scroll mods set scrolloff=5 set textwidth=80 set winwidth=80 set wrap " Enable auto-completion for vim commands " :help wildmode and :help wildmenu for details set wildmenu set wildmode:longest:full,full " Search modifications " Incremental search; search hilighting set ignorecase smartcase set incsearch set hlsearch " Set default/backup colorscheme colorscheme desert "###### "# Mappings "## " " I make use of many mappings from vim-impaired (hlsearch, relative numbering, " and several other toggles). I highly suggest investing the time to learn and " take advantage of those very eash mappings! " Map Leader key let mapleader = "," " Make moving up/down work on wrapped lines of text nnoremap j gj nnoremap k gk nnoremap ^ g^ nnoremap $ g$ " Move between splits with CTRL+h/j/k/l nnoremap l nnoremap k nnoremap j nnoremap h " Allow saving of files as sudo when I forgot to start vim using sudo. cmap w!! w !sudo tee > /dev/null % " Remap ESC in insert mode inoremap jk " Remove Trailing Whitespaace nnoremap rtw :%s/\s\+$//e " Easy mapping for Startify nnoremap s :Startify " Open help topics in a full new tab command! -nargs=1 -complete=help H :enew | :set buftype=help | :h " Show buffer list and prompt to choose one nnoremap b :ls:b "###### "# Plugins "### " Old Way: Pathogen, add-ons go in ~/.vim/bundle/ " runtime bundle/vim-pathogen/autoload/pathogen.vim " execute pathogen#infect() " New Way: Vim-Plug, add-ons configured in .vimrc-plugins if filereadable(expand("~/.vimrc-plugins")) source ~/.vimrc-plugins endif