dotfiles/vim/vimrc

119 lines
2.6 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
2016-11-21 17:26:01 +00:00
set encoding=utf-8
" 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
2016-11-05 23:18:12 +00:00
" Enable line numbers
2015-04-11 20:14:53 +00:00
set number
" Indendation modifications
" Auto indent; set spacing; use spaces
set autoindent
set expandtab
set smarttab
2016-11-21 17:26:01 +00:00
set tabstop=4
2016-11-05 23:18:12 +00:00
set shiftwidth=4
set softtabstop=4
2016-11-21 17:26:01 +00:00
2016-11-05 23:18:12 +00:00
" File-Type Specifics
augroup customfiletypes
2016-10-09 00:02:14 +00:00
" Clear old autocmds in group
autocmd!
" Set auto-indent to two spaces, always expand tabs
2016-11-05 23:18:12 +00:00
autocmd FileType ruby,eruby,yaml set sw=2 sts=2
2016-10-09 00:02:14 +00:00
augroup END
2015-04-11 20:14:53 +00:00
" Spacing
" Set width; word wrap; scroll mods
set scrolloff=5
2016-11-05 23:18:12 +00:00
set textwidth=80
2016-11-21 17:26:01 +00:00
set winwidth=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
2016-11-21 17:26:01 +00:00
set ignorecase smartcase
2015-04-11 20:14:53 +00:00
set incsearch
set hlsearch
" Set default/backup colorscheme
2015-04-11 20:14:53 +00:00
colorscheme desert
"######
"# Mappings
"##
2016-11-05 23:18:12 +00:00
"
" 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 = ","
2016-08-20 23:51:09 +00:00
" Make 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
2016-08-20 23:51:09 +00:00
" Move between splits with CTRL+h/j/k/l
nnoremap <silent> <C-l> <C-w>l
nnoremap <silent> <C-k> <C-w>k
nnoremap <silent> <C-j> <C-w>j
nnoremap <silent> <C-h> <C-w>h
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 %
" Remap ESC in insert mode
inoremap jk <esc>
2015-11-04 01:38:01 +00:00
2015-11-06 22:55:09 +00:00
" Remove Trailing Whitespaace
nnoremap <silent> <leader>rtw :%s/\s\+$//e<CR>
2016-11-05 23:18:12 +00:00
2016-11-21 17:26:01 +00:00
" Easy mapping for Startify
nnoremap <silent> <leader>s :Startify<CR>
" Open help topics in a full new tab
command! -nargs=1 -complete=help H :enew | :set buftype=help | :h <args>
" Show buffer list and prompt to choose one
nnoremap <leader>b :ls<CR>:b<space>
2016-11-05 23:18:12 +00:00
"######
"# 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