dotfiles/vim/vimrc

110 lines
2.4 KiB
VimL
Raw Normal View History

"#========================#"
"# vimrc file for niblock #"
"#========================#"
2015-04-11 20:14:53 +00:00
" Type :so % to refresh .vimrc after making changes
"######
"# General Settings
"##
2015-04-11 20:14:53 +00:00
" Be IMproved ( Why? https://goo.gl/2RiJoo )
2015-04-11 20:14:53 +00:00
set nocompatible
" Necessary for Syntax hilighting and cool stuff
syntax on
filetype plugin indent on
" Auto-reload files changed outside Vim
set autoread
2015-04-11 20:14:53 +00:00
" Shows you which commands you're typing
set showcmd
" Enable line numbers, and make them relative
2015-04-11 20:14:53 +00:00
set number
set rnu
2015-04-11 20:14:53 +00:00
" 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
2015-04-11 20:14:53 +00:00
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
2015-04-11 20:14:53 +00:00
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 = ","
" Making moving up/down work on wrapped lines of text
nnoremap <silent> j gj
nnoremap <silent> k gk
nnoremap <silent> ^ g^
nnoremap <silent> $ g$
2015-04-11 20:14:53 +00:00
2015-05-24 19:40:04 +00:00
" 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 <silent> <leader>n :set rnu!<CR>
" Easy-toggle nohlsearch
2015-11-04 01:38:01 +00:00
nnoremap <silent> <leader>h :set nohlsearch!<CR>
" Edit dotfiles with <leader>d
" v is for vim
nnoremap <silent> <leader>dv :tabnew ~/.dotfiles/vim/vimrc<CR>
nnoremap <silent> <leader>dp :tabnew ~/.dotfiles/vim/vimrc-plugins<CR>
" b is for bash
" nnoremap <silent> <leader>db :tabnew ~/.dotfiles/bash/bashrc<CR>
" t is for tmux
nnoremap <silent> <leader>dt :tabnew ~/.dotfiles/tmux/tmux.conf<CR>
" m is for makefile
nnoremap <silent> <leader>dm :tabnew ~/.dotfiles/makefile<CR>
" Remap ESC in insert mode
inoremap jk <esc>
2015-11-04 01:38:01 +00:00
" Toggle spell-check
nmap <silent> <leader>s :set spell!<CR>
2015-11-06 22:55:09 +00:00
" Remove Trailing Whitespaace
nnoremap <silent> <leader>rtw :%s/\s\+$//e<CR>