[vim] back to basics

This commit is contained in:
Josh Sherman 2017-09-25 18:34:58 -05:00
parent 94feefebdb
commit 1fd05d8762
No known key found for this signature in database
GPG key ID: 55B058A80530EF22
4 changed files with 221 additions and 202 deletions

10
install
View file

@ -36,10 +36,14 @@ ln -s $DOTFILES/vim $HOME/.vim
ln -s $DOTFILES/vim $HOME/.config/nvim ln -s $DOTFILES/vim $HOME/.config/nvim
ln -s $DOTFILES/zshrc $HOME/.zshrc ln -s $DOTFILES/zshrc $HOME/.zshrc
curl -fLo $DOTFILES/vim/autoload/plug.vim --create-dirs \ # Probably will end up dropping this
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim # curl -fLo $DOTFILES/vim/autoload/plug.vim --create-dirs \
# https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
#
# /usr/bin/env vim +PlugInstall +qa
/usr/bin/env vim +PlugInstall +qa mkdir -p ~/.vim/pack/git-plugins/start
git clone https://github.com/w0rp/ale.git ~/.vim/pack/git-plugins/start/ale
if [[ `uname` == 'Darwin' ]]; then if [[ `uname` == 'Darwin' ]]; then
defaults write com.apple.dock autohide-delay -float 86400; killall Dock defaults write com.apple.dock autohide-delay -float 86400; killall Dock

1
vim/.gitignore vendored
View file

@ -1,2 +1,3 @@
bundle bundle
pack
.netrwhist .netrwhist

207
vim/bloatrc Normal file
View file

@ -0,0 +1,207 @@
filetype detect
set nocompatible
set ttyfast
filetype plugin on
filetype indent on
set autoindent
set autoread
set background=dark
set backspace=eol,start,indent
set colorcolumn=80,120
set cursorline
set encoding=utf8
set expandtab
set foldmethod=marker
set hidden
set history=1000
set hlsearch
set ignorecase
set incsearch
set laststatus=2
set lazyredraw
set list
set listchars=tab:└─,trail:•
set magic
set mat=2
set nocindent
set noerrorbells
set novisualbell
set number
set pastetoggle=<F2>
set relativenumber
set shiftwidth=2
set showmatch
set showmode
set smartcase
set smartindent
set so=7
set softtabstop=2
set t_Co=256
set tabstop=2
set textwidth=0
set title
set tm=500
set undolevels=1000
set wildmenu
set wildmode=list:longest
autocmd BufNewFile,BufRead *.cnf,*.conf,*gitconfig set filetype=dosini
autocmd BufNewFile,BufRead *.dust,*.dustjs,*.tl set filetype=dustjs
autocmd BufNewFile,BufRead *.less set filetype=less
autocmd BufNewFile,BufRead nginx.conf set filetype=nginx
autocmd BufNewFile,BufRead *.yaml,*.yml,*gemrc set filetype=yaml
autocmd BufNewFile,BufRead *.handlebars set filetype=html.handlebars syntax=mustache
autocmd FileType go setlocal noexpandtab
autocmd FileType php setlocal smartindent tabstop=4 shiftwidth=4 softtabstop=4
autocmd FileType markdown,text setlocal nosmartindent textwidth=80 wrapmargin=2 spell
"autocmd VimEnter,BufNewFile,BufReadPost * silent! call HardMode()
set backupdir=~/.vim/backup//,/tmp
set directory=~/.vim/swap//,/tmp
set undodir=~/.vim/undo//,/tmp
set undofile
call plug#begin('~/.vim/plugged')
Plug 'altercation/vim-colors-solarized'
Plug 'bling/vim-bufferline'
Plug 'cakebaker/scss-syntax.vim'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'dietsche/vim-lastplace'
Plug 'ervandew/supertab'
Plug 'evanmiller/nginx-vim-syntax'
Plug 'garbas/vim-snipmate'
Plug 'groenewege/vim-less'
Plug 'hail2u/vim-css3-syntax'
Plug 'henrik/vim-indexed-search'
Plug 'honza/vim-snippets'
Plug 'ingydotnet/yaml-vim'
Plug 'jimmyhchan/dustjs.vim'
Plug 'joshtronic/php.vim'
Plug 'kchmck/vim-coffee-script'
Plug 'MarcWeber/vim-addon-mw-utils'
Plug 'mustache/vim-mustache-handlebars'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'pangloss/vim-javascript'
Plug 'scrooloose/syntastic'
Plug 'terryma/vim-expand-region'
Plug 'tmux-plugins/vim-tmux'
Plug 'tomtom/tlib_vim'
Plug 'vim-scripts/Align'
Plug 'vim-scripts/matchit.zip'
Plug 'wikitopian/hardmode'
call plug#end()
filetype plugin indent on
syntax enable
set background=dark
silent! colorscheme solarized
autocmd BufWritePre * :%s/\s\+$//e
let g:bufferline_echo = 0
autocmd VimEnter *
\ let &statusline='%{bufferline#refresh_status()}'
\ .bufferline#get_status_string()
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_javascript_checkers = ['eslint']
let b:match_words = '<:>,<tag>:</tag>'
let g:SuperTabDefaultCompletionType = 'context'
let mapleader = "\<Space>"
nnoremap <Leader>o :CtrlP<CR>
nnoremap <Leader>w :w<CR>
nnoremap <Leader>q :q<CR>
nnoremap <Leader>d :bd<CR>
vmap v <Plug>(expand_region_expand)
vmap <C-v> <Plug>(expand_region_shrink)
vnoremap // y/<C-R>"<CR>
nmap <silent> ,/ :nohlsearch<CR>
nmap <Leader>h ^
nmap <Leader>j G
nmap <Leader>k gg
nmap <Leader>l $
nmap <Leader>b $%
nnoremap <Leader>[ :bprevious<CR>
nnoremap <Leader>] :bnext<CR>
nmap <Leader>1 :buffer 1<CR>
nmap <Leader>2 :buffer 2<CR>
nmap <Leader>3 :buffer 3<CR>
nmap <Leader>4 :buffer 4<CR>
nmap <Leader>5 :buffer 5<CR>
nmap <Leader>6 :buffer 6<CR>
nmap <Leader>7 :buffer 7<CR>
nmap <Leader>8 :buffer 8<CR>
nmap <Leader>9 :buffer 9<CR>
nmap <Leader>0 :buffer 10<CR>
nnoremap <Leader>f :set nolist<CR>
nnoremap <Leader>F :set list<CR>
nnoremap <Leader>c :w<CR>:!wc %<CR>
nnoremap <Leader>v :so ~/.vim/vimrc<CR>
nnoremap <Leader>ss /\s\+$<CR>
nnoremap <Leader>n <Esc>:call ToggleLineNumbers()<CR>
nnoremap <Leader>= :Align =<CR>
syntax on
syntax sync fromstart
let g:ctrlp_follow_symlinks = 2
" Ignore some folders and files for CtrlP indexing
let g:ctrlp_custom_ignore = {
\ 'dir': '\.git$\|\.yardoc\|public$|log\|tmp$',
\ 'file': '\.so$\|\.dat$|\.DS_Store$'
\ }
set gcr=a:block
" mode aware cursors
set gcr+=o:hor50-Cursor
set gcr+=n:Cursor
set gcr+=i-ci-sm:InsertCursor
set gcr+=r-cr:ReplaceCursor-hor20
set gcr+=c:CommandCursor
set gcr+=v-ve:VisualCursor
set gcr+=a:blinkon0
hi InsertCursor ctermfg=15 guifg=#fdf6e3 ctermbg=37 guibg=#2aa198
hi VisualCursor ctermfg=15 guifg=#fdf6e3 ctermbg=125 guibg=#d33682
hi ReplaceCursor ctermfg=15 guifg=#fdf6e3 ctermbg=65 guibg=#dc322f
hi CommandCursor ctermfg=15 guifg=#fdf6e3 ctermbg=166 guibg=#cb4b16
function ToggleLineNumbers()
if !&number || &relativenumber
set number!
set relativenumber!
else
set number
set relativenumber
endif
endfunction

205
vim/vimrc
View file

@ -1,207 +1,14 @@
filetype detect syntax on
set nocompatible
set ttyfast
filetype plugin on set number
filetype indent on set relativenumber
set autoindent set autoindent
set autoread
set background=dark
set backspace=eol,start,indent
set colorcolumn=80,120
set cursorline
set encoding=utf8
set expandtab set expandtab
set foldmethod=marker
set hidden
set history=1000
set hlsearch
set ignorecase
set incsearch
set laststatus=2
set lazyredraw
set list
set listchars=tab:└─,trail:•
set magic
set mat=2
set nocindent
set noerrorbells
set novisualbell
set number
set pastetoggle=<F2>
set relativenumber
set shiftwidth=2
set showmatch
set showmode
set smartcase
set smartindent set smartindent
set so=7 set shiftwidth=2
set softtabstop=2 set softtabstop=2
set t_Co=256
set tabstop=2 set tabstop=2
set textwidth=0
set title
set tm=500
set undolevels=1000
set wildmenu
set wildmode=list:longest
autocmd BufNewFile,BufRead *.cnf,*.conf,*gitconfig set filetype=dosini autocmd FileType php setlocal sw=4 sts=4 ts=4
autocmd BufNewFile,BufRead *.dust,*.dustjs,*.tl set filetype=dustjs autocmd FileType gitcommit,markdown,text setlocal nosi spell tw=80 wm=2
autocmd BufNewFile,BufRead *.less set filetype=less
autocmd BufNewFile,BufRead nginx.conf set filetype=nginx
autocmd BufNewFile,BufRead *.yaml,*.yml,*gemrc set filetype=yaml
autocmd BufNewFile,BufRead *.handlebars set filetype=html.handlebars syntax=mustache
autocmd FileType go setlocal noexpandtab
autocmd FileType php setlocal smartindent tabstop=4 shiftwidth=4 softtabstop=4
autocmd FileType markdown,text setlocal nosmartindent textwidth=80 wrapmargin=2 spell
"autocmd VimEnter,BufNewFile,BufReadPost * silent! call HardMode()
set backupdir=~/.vim/backup//,/tmp
set directory=~/.vim/swap//,/tmp
set undodir=~/.vim/undo//,/tmp
set undofile
call plug#begin('~/.vim/plugged')
Plug 'altercation/vim-colors-solarized'
Plug 'bling/vim-bufferline'
Plug 'cakebaker/scss-syntax.vim'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'dietsche/vim-lastplace'
Plug 'ervandew/supertab'
Plug 'evanmiller/nginx-vim-syntax'
Plug 'garbas/vim-snipmate'
Plug 'groenewege/vim-less'
Plug 'hail2u/vim-css3-syntax'
Plug 'henrik/vim-indexed-search'
Plug 'honza/vim-snippets'
Plug 'ingydotnet/yaml-vim'
Plug 'jimmyhchan/dustjs.vim'
Plug 'joshtronic/php.vim'
Plug 'kchmck/vim-coffee-script'
Plug 'MarcWeber/vim-addon-mw-utils'
Plug 'mustache/vim-mustache-handlebars'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'pangloss/vim-javascript'
Plug 'scrooloose/syntastic'
Plug 'terryma/vim-expand-region'
Plug 'tmux-plugins/vim-tmux'
Plug 'tomtom/tlib_vim'
Plug 'vim-scripts/Align'
Plug 'vim-scripts/matchit.zip'
Plug 'wikitopian/hardmode'
call plug#end()
filetype plugin indent on
syntax enable
set background=dark
silent! colorscheme solarized
autocmd BufWritePre * :%s/\s\+$//e
let g:bufferline_echo = 0
autocmd VimEnter *
\ let &statusline='%{bufferline#refresh_status()}'
\ .bufferline#get_status_string()
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_javascript_checkers = ['eslint']
let b:match_words = '<:>,<tag>:</tag>'
let g:SuperTabDefaultCompletionType = 'context'
let mapleader = "\<Space>"
nnoremap <Leader>o :CtrlP<CR>
nnoremap <Leader>w :w<CR>
nnoremap <Leader>q :q<CR>
nnoremap <Leader>d :bd<CR>
vmap v <Plug>(expand_region_expand)
vmap <C-v> <Plug>(expand_region_shrink)
vnoremap // y/<C-R>"<CR>
nmap <silent> ,/ :nohlsearch<CR>
nmap <Leader>h ^
nmap <Leader>j G
nmap <Leader>k gg
nmap <Leader>l $
nmap <Leader>b $%
nnoremap <Leader>[ :bprevious<CR>
nnoremap <Leader>] :bnext<CR>
nmap <Leader>1 :buffer 1<CR>
nmap <Leader>2 :buffer 2<CR>
nmap <Leader>3 :buffer 3<CR>
nmap <Leader>4 :buffer 4<CR>
nmap <Leader>5 :buffer 5<CR>
nmap <Leader>6 :buffer 6<CR>
nmap <Leader>7 :buffer 7<CR>
nmap <Leader>8 :buffer 8<CR>
nmap <Leader>9 :buffer 9<CR>
nmap <Leader>0 :buffer 10<CR>
nnoremap <Leader>f :set nolist<CR>
nnoremap <Leader>F :set list<CR>
nnoremap <Leader>c :w<CR>:!wc %<CR>
nnoremap <Leader>v :so ~/.vim/vimrc<CR>
nnoremap <Leader>ss /\s\+$<CR>
nnoremap <Leader>n <Esc>:call ToggleLineNumbers()<CR>
nnoremap <Leader>= :Align =<CR>
syntax on
syntax sync fromstart
let g:ctrlp_follow_symlinks = 2
" Ignore some folders and files for CtrlP indexing
let g:ctrlp_custom_ignore = {
\ 'dir': '\.git$\|\.yardoc\|public$|log\|tmp$',
\ 'file': '\.so$\|\.dat$|\.DS_Store$'
\ }
set gcr=a:block
" mode aware cursors
set gcr+=o:hor50-Cursor
set gcr+=n:Cursor
set gcr+=i-ci-sm:InsertCursor
set gcr+=r-cr:ReplaceCursor-hor20
set gcr+=c:CommandCursor
set gcr+=v-ve:VisualCursor
set gcr+=a:blinkon0
hi InsertCursor ctermfg=15 guifg=#fdf6e3 ctermbg=37 guibg=#2aa198
hi VisualCursor ctermfg=15 guifg=#fdf6e3 ctermbg=125 guibg=#d33682
hi ReplaceCursor ctermfg=15 guifg=#fdf6e3 ctermbg=65 guibg=#dc322f
hi CommandCursor ctermfg=15 guifg=#fdf6e3 ctermbg=166 guibg=#cb4b16
function ToggleLineNumbers()
if !&number || &relativenumber
set number!
set relativenumber!
else
set number
set relativenumber
endif
endfunction