dotfiles/vim/vimrc

107 lines
2.2 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
"######
"# Settings
"##
2015-04-11 20:14:53 +00:00
" https://stackoverflow.com/questions/5845557/in-a-vimrc-is-set-nocompatible-completely-useless
set nocompatible
" Auto-reload files changed outside Vim
set autoread
2015-10-21 01:06:47 +00:00
" Map Leader key
let mapleader = ","
2015-04-11 20:14:53 +00:00
" 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
2015-04-11 20:14:53 +00:00
" Airline configuration
set laststatus=2
let g:airline_powerline_fonts = 1
2015-04-11 20:14:53 +00:00
" Necessary for Syntax hilighting
syntax on
filetype plugin indent on
" 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=+1
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 color scheme... duh...
colorscheme desert
"######
"# Mappings
"##
" 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 ~/.vimrc<CR>
" b is for bash
nnoremap <silent> <leader>db :tabnew ~/.bashrc<CR>
" t is for tmux
nnoremap <silent> <leader>dt :tabnew ~/.tmux.conf<CR>
" d is for dotfiles install script
nnoremap <silent> <leader>dd :tabnew ~/.dotfiles/install.conf.yaml<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>