"#========================#" "# 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 " Auto-reload files changed outside Vim set autoread " Shows you which commands you're typing set showcmd " Enable line numbers, and make them relative set number set rnu " Indendation modifications " Auto indent; set spacing; use spaces set autoindent set expandtab set smarttab set shiftwidth=5 set softtabstop=5 " Spacing " Set width; word wrap; scroll mods set scrolloff=5 set tw=80 " set colorcolumn=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 incsearch set hlsearch " Set default/backup colorscheme colorscheme desert "###### "# 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 "###### "# 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$ " Shift between tabs with Shift+h/l nnoremap gt nnoremap gT " 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 % " Toggle relative numbering nnoremap n :set rnu! " Easy-toggle nohlsearch nnoremap h :set nohlsearch! " Edit dotfiles with d " v is for vim nnoremap dv :tabnew ~/.dotfiles/vim/vimrc nnoremap dp :tabnew ~/.dotfiles/vim/vimrc-plugins " b is for bash " nnoremap db :tabnew ~/.dotfiles/bash/bashrc " t is for tmux nnoremap dt :tabnew ~/.dotfiles/tmux/tmux.conf " m is for makefile nnoremap dm :tabnew ~/.dotfiles/makefile " Remap ESC in insert mode inoremap jk " Toggle spell-check nmap s :set spell! " Remove Trailing Whitespaace nnoremap rtw :%s/\s\+$//e