Finally got my vim stuff on here

This commit is contained in:
Emerson Veenstra 2015-11-17 18:59:57 -05:00
parent cce74cb922
commit f01e5cbd9c
5 changed files with 187 additions and 0 deletions

3
.vim/ftplugin/html.vim Normal file
View File

@ -0,0 +1,3 @@
set tabstop=2
set shiftwidth=2
set softtabstop=2

View File

@ -0,0 +1,4 @@
set tabstop=4
set shiftwidth=4
set softtabstop=4
set tw=80

6
.vim/ftplugin/php.vim Normal file
View File

@ -0,0 +1,6 @@
set shiftwidth=4
set softtabstop=4
set tabstop=4
"Pear says spaces, WP says tabs, since WP is what I'll be writing mostly with
"PHP, it wins.
set noexpandtab

4
.vim/ftplugin/python.vim Normal file
View File

@ -0,0 +1,4 @@
set tabstop=4
set shiftwidth=4
set softtabstop=4

170
.vimrc Normal file
View File

@ -0,0 +1,170 @@
"Turn on syntax highlighting
syntax on
" Colors
set background=dark
colorscheme sahara
hi Search cterm=NONE ctermfg=white ctermbg=red
"Disable vi-compatible backspace behavior
set backspace=indent,eol,start
"Disable vi compatibility (may be redundant with above)
set nocompatible
"Default character encoding
set encoding=utf-8
set fileencoding=utf-8
" All unix, all the time
set ffs=unix
set ff=unix
" Indentation stuff
" 2-space everything
set tabstop=2
set softtabstop=2
set shiftwidth=2
set expandtab
" Old school
set textwidth=80
" Auto wrap long lines
set formatoptions+=t
set autoindent
set smartindent
set smarttab
" Look and feel
set encoding=utf-8
set number
set relativenumber
set wildmenu
set showmatch
" Silence is golden
set noerrorbells
set novisualbell
" Searching things
set incsearch
set hlsearch
set ignorecase
set smartcase
" Visually display whitespace (this prevents slowness from match command)
set list
set listchars=tab:>>,trail:-,nbsp:+
"Display each keystroke in the status line
set showcmd
"Always show the status line
set laststatus=2
set hidden
" Remapping things
let mapleader=","
nnoremap <leader><space> :nohlsearch<CR>
" Making my life hard on purpose so it is easier later...
nnoremap <buffer><Left> <nop>
nnoremap <buffer><Right> <nop>
nnoremap <buffer><Up> <nop>
nnoremap <buffer><Down> <nop>
nnoremap <buffer><PageUp> <nop>
nnoremap <buffer><PageDown> <nop>
nnoremap <buffer><Home> <nop>
nnoremap <buffer><Insert> <nop>
nnoremap <buffer><End> <nop>
vnoremap <buffer><Left> <nop>
vnoremap <buffer><Right> <nop>
vnoremap <buffer><Up> <nop>
vnoremap <buffer><Down> <nop>
vnoremap <buffer><PageUp> <nop>
vnoremap <buffer><PageDown> <nop>
vnoremap <buffer><Home> <nop>
vnoremap <buffer><Insert> <nop>
vnoremap <buffer><End> <nop>
inoremap <buffer><Left> <nop>
inoremap <buffer><Right> <nop>
inoremap <buffer><Up> <nop>
inoremap <buffer><Down> <nop>
inoremap <buffer><PageUp> <nop>
inoremap <buffer><PageDown> <nop>
inoremap <buffer><Home> <nop>
inoremap <buffer><Insert> <nop>
inoremap <buffer><End> <nop>
" Because the shift key is a lot of work
nnoremap ; :
inoremap <leader>; <esc>
"Toggle line numbering
nmap <Leader>l :setlocal number!<CR>
"Toggle paste mode
nmap <Leader>p :set paste!<CR>
map <C-J> :bnext<CR>
map <C-K> :bprev<CR>
map <C-L> :tabn<CR>
map <C-H> :tabp<CR>
"Delete single characters without updating the default register
noremap x "_x
"Paste in visual mode without updating the default register
vnoremap p "_dP
" Backups
set backup
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set backupskip=/tmp/*,/private/tmp/*
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set writebackup
"Enable 256-color mode
set t_Co=256
"Tell vim to remember certain things when we exit
" '10 marks will be remembered for up to 10 previously edited files
" "100 will save up to 100 lines for each register
" :20 up to 20 lines of command-line history will be remembered
" % saves and restores the buffer list
" n... where to save the viminfo files
set viminfo='10,\"100,:20,%,n~/.vim/viminfo
"Function to save the cursor position of the previously opened file
function! ResCur()
if line("'\"") <= line("$")
normal! g`"
return 1
endif
endfunction
augroup resCur
autocmd!
autocmd BufWinEnter * call ResCur()
augroup END
"Jump five lines when scrolling at edge of screen
set scrolljump=1
"Cause screen to scroll when within three lines of the edge
set scrolloff=5
set sidescrolloff=5
"Enable persistent undo
set undofile "Save undo history when a file is closed
set undodir=$HOME/.vim/undo "Where to save undo histories (must create this dir manually)
set undolevels=1000 "How many undos to save
set undoreload=10000 "Number of lines to save for undo
"Folding
set foldmethod=indent
set nofoldenable
"Tell vim to interpret our .vim/after/ftplugin files
filetype plugin on
"Highlight .md files as markdown rather than Modula-2
autocmd BufRead,BufNewFile *.md set filetype=markdown
let loaded_matchparen = 1