Adding current version of my vim env to repo

This needs to be updated. But that is currently low on my list of
priorities. I will set up the rest of my env first and come back to
this.
This commit is contained in:
James Patrick 2019-04-13 16:29:46 -04:00
parent 203a6231dc
commit bfe0b4d80c
6 changed files with 280 additions and 0 deletions

20
vim/spell/en.utf-8.add Normal file
View File

@ -0,0 +1,20 @@
off
Ctrl
zsh
dotfiles
CoffeeScript
Haml
ctag
Ctags
mkdir
tmux
hostname
rebase
rebases
ctags
config
zsh
backend
SES
Tybera
GreenFiling

4
vim/vimrc Normal file
View File

@ -0,0 +1,4 @@
source ~/.vim/vimrc.d/base.vim
source ~/.vim/vimrc.d/plugins.vim
source ~/.vim/vimrc.d/ui.vim
source ~/.vim/vimrc.d/keybind.vim

69
vim/vimrc.d/base.vim Normal file
View File

@ -0,0 +1,69 @@
set go=
set t_Co=256
syntax on
filetype plugin indent on
set encoding=utf-8
set hidden
set showcmd
set nowrap
set backspace=indent,eol,start
set autoindent
set number
set shiftround
set ignorecase
set smartcase
set hlsearch
set incsearch
set history=1000
set undolevels=1000
set title
set noerrorbells
set list
set listchars=tab:>>,trail:.,extends:>,precedes:<,nbsp:.
set ttyfast
set mouse=a
set nocompatible
set backup
set noswapfile
set backupdir=~/.vim/backup
set laststatus=2
set fileformats=unix,dos,mac
set expandtab
set softtabstop=2 tabstop=2 shiftwidth=2
set ruler
set cursorline
set cuc cul
set wildmenu
set lazyredraw
set showmatch " highlight matching [{()}]
set wildignore=*.swp,*.bak
set wildignore+=*.o,*.obj,.git,*.rbc,*.class,.svn,vendor/gems/*
set wildmode=longest,list:full
set linebreak
set nolist " list disables linebreak
set omnifunc=syntaxcomplete#Complete
set dictionary=/usr/share/dict/words
" The Silver Searcher
if executable('ag')
set grepprg=ag\ --nogroup\ --nocolor
endif
if v:version > 702 && has('patch541')
set formatoptions+=j
endif
let g:has_async = v:version >= 800 || has('nvim')
"" Toggle relative/absolute numbering
function! NumberToggle()
if(&relativenumber == 1)
set number
else
set relativenumber
endif
endfunc

96
vim/vimrc.d/keybind.vim Normal file
View File

@ -0,0 +1,96 @@
"" Keybinds
let mapleader=","
"" Kill
nnoremap <Leader>kb :BD<cr>
"" Toggles : t for toggle
" Toggle PasteMode
nnoremap <Leader>tp :set invpaste paste?<cr>
" Toggle wordwrap
nnoremap <Leader>tw :set wrap!<CR>
" Toggle Git Gutter :: Requires GitGutter
nnoremap <Leader>tg :GitGutterToggle<cr>
" Toggle Indent :: Requires Yggdroot/indentLine
nnoremap <leader>ti :IndentLinesToggle<cr>
" Tooggle Spell Check
nnoremap <leader>ts :setlocal spell! spelllang=en<CR>
" Toggle Relative Numbers
nnoremap <leader>t# :call NumberToggle()<cr>
" Toggle Syntastic :: Requires scrooloose/syntastic
nnoremap <leader>tc :SyntasticToggleMode<cr>
" Keybind ri
nnoremap <leader>ri :call ri#OpenSearchPrompt(0)<cr> " horizontal split"
nnoremap <leader>rk :call ri#LookupNameUnderCursor()<cr> " keyword lookup"
" vim-test mappings : T for Testing
nnoremap <silent> <Leader>Tt :TestFile<CR>
nnoremap <silent> <Leader>Ts :TestNearest<CR>
nnoremap <silent> <Leader>Tl :TestLast<CR>
nnoremap <silent> <Leader>Ta :TestSuite<CR>
nnoremap <silent> <leader>Tgt :TestVisit<CR>
" Enter for Nerd :: Requires Nerdtree
map <Leader><cr> :NERDTreeToggle<cr>
" Sudo Save :: Requires tpope/vim-eunuch
nnoremap <Leader>W :SudoWrite<cr>
" Quick Format : f for Format
nnoremap <silent> <Leader>fi :normal migg=G`i`
nnoremap <silent> <Leader>fw :FixWhitespace<cr>
nnoremap <silent> <Leader>fw :FixWhitespace<cr>
vnoremap <silent> <Leader>ft :Tabularize /
vnoremap <silent> <Leader>fT :Tabularize /\zs<LEFT><LEFT><LEFT>
nnoremap <silent> <Leader>ft :Tabularize /
nnoremap <silent> <Leader>fT :Tabularize /\zs<LEFT><LEFT><LEFT>
" Set File Type Use : F for Filetype
nnoremap <silent> <Leader>Fm :set filetype=markdown<CR>
nnoremap <silent> <Leader>Fv :set filetype=vim<CR>
nnoremap <silent> <Leader>Frb :set filetype=ruby<CR>
" Tagbar
nmap <F8> :TagbarToggle<CR>
" CTRL-P
map <F3> :CtrlPMRU<cr>
nnoremap <Leader>b :CtrlPBuffer<cr>
" Better Search :: Requires haya14busa/incsearch.vim
map / <Plug>(incsearch-forward)
map ? <Plug>(incsearch-backward)
map g/ <Plug>(incsearch-stay)
nnoremap <Space> :
" Better Subsitute :: Requires osyo-manga/vim-over
nnoremap <leader>s :OverCommandLine<CR> %s/
" Format XML
map @@x :%s/<\([^>]\)*>/\r&\r/g<enter>:g/^$/d<enter>vat=
" Switch windows with shift + jikl
nnoremap <S-l> :wincmd l<CR>
nnoremap <S-j> :wincmd j<CR>
nnoremap <S-h> :wincmd h<CR>
nnoremap <S-k> :wincmd k<CR>
" Line Switch
nnoremap <C-j> :m .+1<CR>==
nnoremap <C-k> :m .-2<CR>==
vnoremap <C-j> :m '>+1<CR>gv=gv
vnoremap <C-k> :m '<-2<CR>gv=gv
" Plug Stuff
nnoremap <leader>pi :PlugInstall<CR>
nnoremap <leader>pu :PlugUpdate<CR>
nnoremap <leader>ps :PlugStatus<CR>
" UltiSnips
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<tab>"
let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
imap <expr><C-k> pumvisible() ? "\<C-y><C-R>=UltiSnips#ExpandSnippet()<CR>" : "\<C-R>=UltiSnips#ExpandSnippet()<CR>"

72
vim/vimrc.d/plugins.vim Normal file
View File

@ -0,0 +1,72 @@
" ==============================================================================
" PLUGINS
" This
filetype off
"" automatically install new plugs
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
"" Start Vim-Plug
call plug#begin('~/.vim/plugged')
"" Cond loading
function! Cond(cond, ...)
let opts = get(a:000, 0, {})
return a:cond ? opts : extend(opts, { 'on': [],'for': [] })
endfunction
" Themes
Plug 'kamwitsta/flatwhite-vim'
Plug 'tomasr/molokai'
" Extensions
Plug 'Shougo/deoplete.nvim' , Cond(g:has_async, { 'on': [] })
Plug 'Shougo/neco-vim' , {'for' : 'vim'}
Plug 'Shougo/neocomplete.vim' , Cond(!g:has_async, { 'on': [] })
Plug 'Shougo/vimproc.vim' , {'do' : 'make'}
Plug 'SirVer/ultisnips' , { 'on': [] }
Plug 'Yggdroot/indentLine'
Plug 'airblade/vim-gitgutter'
Plug 'bronson/vim-trailing-whitespace'
Plug 'danchoi/ri.vim' , {'for' : 'ruby'}
Plug 'fatih/vim-go' , {'for' : 'go'}
Plug 'godlygeek/tabular'
Plug 'haya14busa/incsearch.vim'
Plug 'honza/vim-snippets'
Plug 'janko-m/vim-test'
Plug 'jiangmiao/auto-pairs'
Plug 'jpalardy/vim-slime'
Plug 'kien/ctrlp.vim'
Plug 'kien/rainbow_parentheses.vim'
Plug 'majutsushi/tagbar'
Plug 'osyo-manga/vim-over'
Plug 'qpkorr/vim-bufkill' , {'on': 'BD'}
Plug 'racer-rust/vim-racer' , {'for' : 'rust'}
Plug 'rizzatti/dash.vim'
Plug 'roxma/nvim-yarp' , Cond(g:has_async)
Plug 'roxma/vim-hug-neovim-rpc' , Cond(g:has_async)
Plug 'rust-lang/rust.vim' , {'for' : 'rust'}
Plug 'scrooloose/nerdcommenter'
Plug 'scrooloose/nerdtree' , { 'on': 'NERDTreeToggle' }
Plug 'scrooloose/syntastic' , Cond(!g:has_async)
Plug 'tpope/vim-bundler' , {'for' : 'ruby' }
Plug 'tpope/vim-eunuch'
Plug 'tpope/vim-markdown' , {'for' : 'markdown'}
Plug 'tpope/vim-projectionist'
Plug 'tpope/vim-rails' , {'for' : 'ruby' }
Plug 'tpope/vim-rake' , {'for' : 'ruby'}
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'vim-ruby/vim-ruby' , {'for' : 'ruby' }
Plug 'w0rp/ale' , Cond(g:has_async)
Plug 'wincent/terminus'
for fpath in split(globpath('~/.vim/plug.d/', '*.vim'), '\n')
exe 'source' fpath
endfor
call plug#end()

19
vim/vimrc.d/ui.vim Normal file
View File

@ -0,0 +1,19 @@
"" GUI
if has('gui_macvim')
let macvim_skip_colorscheme = 1
colorscheme flatwhite
set lines=60 columns=108 linespace=0
set guifont=Source\ Code\ Pro\ for\ Powerline:h10
else
set background=dark
let g:molokai_original=1
let g:rehash256=1
set t_Co=256
colorscheme molokai
hi LineNr ctermfg=245 ctermbg=235
endif
"" Error Message
match ErrorMsg '\%>120v.\+'
match ErrorMsg '\s\+$'