"#========================#" "# vimrc file for niblock #" "#========================#" " Type :so % to refresh .vimrc after making changes "###### "# Settings "## " https://stackoverflow.com/questions/5845557/in-a-vimrc-is-set-nocompatible-completely-useless set nocompatible " Auto-reload files changed outside Vim set autoread " Map Leader key let mapleader = "," " Shows you which commands you're typing set showcmd " Enables addons via Pathogen " Add-ons go in ~/.vim/bundle/ " runtime bundle/vim-pathogen/autoload/pathogen.vim " execute pathogen#infect() " Load plugins with Vundle if filereadable(expand("~/.vimrc.bundles")) source ~/.vimrc.bundles endif " Airline configuration set laststatus=2 let g:airline_powerline_fonts = 1 " Necessary for Syntax hilighting syntax on filetype plugin indent on " 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=+1 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 color scheme... duh... colorscheme desert "###### "# Mappings "## " Making moving up/down work on wrapped lines of text nnoremap j gj nnoremap k gk nnoremap ^ g^ nnoremap $ g$ " 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 ~/.vimrc " b is for bash nnoremap db :tabnew ~/.bashrc " t is for tmux nnoremap dt :tabnew ~/.tmux.conf " d is for dotfiles install script nnoremap dd :tabnew ~/.dotfiles/install.conf.yaml " Remap ESC in insert mode inoremap jk " Toggle spell-check nmap s :set spell!