From 1f4270151c84099ece152e64590b5c4a07409814 Mon Sep 17 00:00:00 2001 From: Matthew Jensen Date: Thu, 8 Apr 2021 10:03:09 -0700 Subject: [PATCH] remove pathogen. add plug vim. --- dotfiles/.bash_profile | 1 + dotfiles/.vimrc | 79 ++++++++++++++++++++++++++++++++---------- init.sh | 12 ------- 3 files changed, 61 insertions(+), 31 deletions(-) diff --git a/dotfiles/.bash_profile b/dotfiles/.bash_profile index bf32028..b7bd7b1 100644 --- a/dotfiles/.bash_profile +++ b/dotfiles/.bash_profile @@ -7,3 +7,4 @@ function homestead() { alias hup="homestead up && homestead ssh" PATH=$PATH:$HOME/.config/composer/vendor/bin +set -o vi diff --git a/dotfiles/.vimrc b/dotfiles/.vimrc index 39b112d..c7a28e3 100644 --- a/dotfiles/.vimrc +++ b/dotfiles/.vimrc @@ -1,4 +1,57 @@ -execute pathogen#infect() +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 + +" Specify a directory for plugins +call plug#begin('~/.vim/plugged') + +Plug 'neoclide/coc.nvim', {'branch': 'release'} +Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } +Plug 'junegunn/fzf.vim' +Plug 'jpalardy/vim-slime', {'branch': 'main'} +"Plug 'vim-syntastic/syntastic' +Plug 'prettier/vim-prettier', { 'do': 'yarn install' } + +" Plug 'christoomey/vim-tmux-navigator' + +" Initialize plugin system +call plug#end() + +" Begin coc.vim +" +" Use tab for trigger completion with characters ahead and navigate. +" NOTE: Use command ':verbose imap ' to make sure tab is not mapped by +" other plugin before putting this into your config. +inoremap + \ pumvisible() ? "\" : + \ check_back_space() ? "\" : + \ coc#refresh() +inoremap pumvisible() ? "\" : "\" + +function! s:check_back_space() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' +endfunction + +" Use K to show documentation in preview window. +nnoremap K :call show_documentation() + +function! s:show_documentation() + if (index(['vim','help'], &filetype) >= 0) + execute 'h '.expand('') + else + call CocActionAsync('doHover') + endif +endfunction +" +" End coc.vim +" + +nnoremap :Files +nnoremap f :Ag +nnoremap b :Buffers set nocompatible " Disable vi-compatibility @@ -9,11 +62,11 @@ set go-=L " Removes left hand scroll bar set linespace=15 set showmode " always show what mode we're currently editing in -set nowrap " don't wrap lines +"set nowrap " don't wrap lines set tabstop=4 " a tab is four spaces set smarttab set tags=tags -set softtabstop=4 " when hitting , pretend like a tab is removed, even if spaces +set softtabstop=2 " when hitting , pretend like a tab is removed, even if spaces set expandtab " expand tabs by default (overloadable per file type later) set shiftwidth=4 " number of spaces to use for autoindenting set shiftround " use multiple of shiftwidth when indenting with '<' and '>' @@ -26,26 +79,14 @@ set visualbell " don't beep set noerrorbells " don't beep set autowrite "Save on buffer switch -" Down is really the next line -nnoremap j gj -nnoremap k gk - -"Easy escaping to normal model -imap jj +" autocmd TextChanged,TextChangedI silent write "Load the current buffer in Chrome -nmap ,c :!open -a Firefox - -" Familiar commands for file/symbol browsing -map :CtrlP -map :CtrlPBufTag - -" I don't want to pull up these folders/files when calling CtrlP -set wildignore+=*/node_modules/** +" nmap ,c :!open -a Firefox " Copy and Paste register between tmux panes. -let g:slime_target = "tmux" -let g:slime_default_config = {"socket_name": "default", "target_pane": "1"} +" let g:slime_target = "tmux" +" let g:slime_default_config = {"socket_name": "default", "target_pane": "1"} " Auto complete current file path to edit, tabe or split map ,e :e =expand("%:p:h") . "/" diff --git a/init.sh b/init.sh index 0138d8b..50b4a8c 100755 --- a/init.sh +++ b/init.sh @@ -1,16 +1,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -rm $HOME/.vim/ -rf -rm $HOME/.vim/autoload/ -rf -rm $HOME/.vim/bundle/ -rf - -mkdir $HOME/.vim -mkdir $HOME/.vim/autoload -mkdir $HOME/.vim/bundle - -curl -LSso $HOME/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim - -git clone https://github.com/ctrlpvim/ctrlp.vim.git $HOME/.vim/bundle/ctrlp.vim -git clone https://github.com/jpalardy/vim-slime.git $HOME/.vim/bundle/vim-slime cp -rf $DIR/dotfiles/.vimrc $HOME/.vimrc echo ".vimrc copied"