From bfe0b4d80cb3b65c7db043fbf1cfbc2f1d3fd932 Mon Sep 17 00:00:00 2001 From: James Patrick Date: Sat, 13 Apr 2019 16:29:46 -0400 Subject: [PATCH] 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. --- vim/spell/en.utf-8.add | 20 +++++++++ vim/vimrc | 4 ++ vim/vimrc.d/base.vim | 69 +++++++++++++++++++++++++++++ vim/vimrc.d/keybind.vim | 96 +++++++++++++++++++++++++++++++++++++++++ vim/vimrc.d/plugins.vim | 72 +++++++++++++++++++++++++++++++ vim/vimrc.d/ui.vim | 19 ++++++++ 6 files changed, 280 insertions(+) create mode 100644 vim/spell/en.utf-8.add create mode 100644 vim/vimrc create mode 100644 vim/vimrc.d/base.vim create mode 100644 vim/vimrc.d/keybind.vim create mode 100644 vim/vimrc.d/plugins.vim create mode 100644 vim/vimrc.d/ui.vim diff --git a/vim/spell/en.utf-8.add b/vim/spell/en.utf-8.add new file mode 100644 index 0000000..80117ea --- /dev/null +++ b/vim/spell/en.utf-8.add @@ -0,0 +1,20 @@ +off +Ctrl +zsh +dotfiles +CoffeeScript +Haml +ctag +Ctags +mkdir +tmux +hostname +rebase +rebases +ctags +config +zsh +backend +SES +Tybera +GreenFiling diff --git a/vim/vimrc b/vim/vimrc new file mode 100644 index 0000000..8966522 --- /dev/null +++ b/vim/vimrc @@ -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 diff --git a/vim/vimrc.d/base.vim b/vim/vimrc.d/base.vim new file mode 100644 index 0000000..34e1a7b --- /dev/null +++ b/vim/vimrc.d/base.vim @@ -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 + diff --git a/vim/vimrc.d/keybind.vim b/vim/vimrc.d/keybind.vim new file mode 100644 index 0000000..f179952 --- /dev/null +++ b/vim/vimrc.d/keybind.vim @@ -0,0 +1,96 @@ +"" Keybinds + +let mapleader="," + +"" Kill +nnoremap kb :BD + +"" Toggles : t for toggle +" Toggle PasteMode +nnoremap tp :set invpaste paste? +" Toggle wordwrap +nnoremap tw :set wrap! +" Toggle Git Gutter :: Requires GitGutter +nnoremap tg :GitGutterToggle +" Toggle Indent :: Requires Yggdroot/indentLine +nnoremap ti :IndentLinesToggle +" Tooggle Spell Check +nnoremap ts :setlocal spell! spelllang=en +" Toggle Relative Numbers +nnoremap t# :call NumberToggle() +" Toggle Syntastic :: Requires scrooloose/syntastic +nnoremap tc :SyntasticToggleMode + +" Keybind ri +nnoremap ri :call ri#OpenSearchPrompt(0) " horizontal split" +nnoremap rk :call ri#LookupNameUnderCursor() " keyword lookup" + +" vim-test mappings : T for Testing +nnoremap Tt :TestFile +nnoremap Ts :TestNearest +nnoremap Tl :TestLast +nnoremap Ta :TestSuite +nnoremap Tgt :TestVisit + +" Enter for Nerd :: Requires Nerdtree +map :NERDTreeToggle + +" Sudo Save :: Requires tpope/vim-eunuch +nnoremap W :SudoWrite + +" Quick Format : f for Format +nnoremap fi :normal migg=G`i` +nnoremap fw :FixWhitespace +nnoremap fw :FixWhitespace +vnoremap ft :Tabularize / +vnoremap fT :Tabularize /\zs +nnoremap ft :Tabularize / +nnoremap fT :Tabularize /\zs + +" Set File Type Use : F for Filetype +nnoremap Fm :set filetype=markdown +nnoremap Fv :set filetype=vim +nnoremap Frb :set filetype=ruby + +" Tagbar +nmap :TagbarToggle + +" CTRL-P +map :CtrlPMRU +nnoremap b :CtrlPBuffer + +" Better Search :: Requires haya14busa/incsearch.vim +map / (incsearch-forward) +map ? (incsearch-backward) +map g/ (incsearch-stay) + +nnoremap : + +" Better Subsitute :: Requires osyo-manga/vim-over +nnoremap s :OverCommandLine %s/ + +" Format XML +map @@x :%s/<\([^>]\)*>/\r&\r/g:g/^$/dvat= + +" Switch windows with shift + jikl +nnoremap :wincmd l +nnoremap :wincmd j +nnoremap :wincmd h +nnoremap :wincmd k + +" Line Switch +nnoremap :m .+1== +nnoremap :m .-2== +vnoremap :m '>+1gv=gv +vnoremap :m '<-2gv=gv + +" Plug Stuff +nnoremap pi :PlugInstall +nnoremap pu :PlugUpdate +nnoremap ps :PlugStatus + +" UltiSnips +let g:UltiSnipsExpandTrigger="" +let g:UltiSnipsJumpForwardTrigger="" +let g:UltiSnipsJumpBackwardTrigger="" +imap pumvisible() ? "\=UltiSnips#ExpandSnippet()" : "\=UltiSnips#ExpandSnippet()" diff --git a/vim/vimrc.d/plugins.vim b/vim/vimrc.d/plugins.vim new file mode 100644 index 0000000..a05ffb2 --- /dev/null +++ b/vim/vimrc.d/plugins.vim @@ -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() diff --git a/vim/vimrc.d/ui.vim b/vim/vimrc.d/ui.vim new file mode 100644 index 0000000..defc7eb --- /dev/null +++ b/vim/vimrc.d/ui.vim @@ -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\+$'