dotfiles

Obligatory dotfiles repo
git clone git://git.danielmoch.com/dotfiles.git
Log | Files | Refs

commit 8734ee93888243b6964d191a3675845d33b2c076
parent d4c5ccdb1cbd425e204579b6035ba65c3e0ae002
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Fri, 22 May 2020 11:47:38 -0400

vim: gone

Diffstat:
D.vim/after/ftplugin/crontab.vim | 2--
D.vim/after/ftplugin/cs.vim | 1-
D.vim/after/ftplugin/css.vim | 1-
D.vim/after/ftplugin/gitcommit.vim | 2--
D.vim/after/ftplugin/go.vim | 2--
D.vim/after/ftplugin/help.vim | 1-
D.vim/after/ftplugin/java.vim | 15---------------
D.vim/after/ftplugin/mail.vim | 1-
D.vim/after/ftplugin/markdown.vim | 2--
D.vim/after/ftplugin/python.vim | 12------------
D.vim/after/ftplugin/rust.vim | 8--------
D.vim/after/ftplugin/scss.vim | 1-
D.vim/after/ftplugin/text.vim | 2--
D.vim/after/ftplugin/vim.vim | 5-----
D.vim/after/ftplugin/yaml.vim | 1-
D.vim/ftdetect/LICENSE.vim | 1-
D.vim/ftplugin/LICENSE.vim | 1-
D.vim/gvimrc | 9---------
D.vim/pack/update_plugins | 16----------------
D.vim/skel/mit.skel | 21---------------------
D.vim/skel/reserved.skel | 1-
D.vim/vimrc | 9---------
D.vim/vimrc.normal | 362-------------------------------------------------------------------------------
23 files changed, 0 insertions(+), 476 deletions(-)

diff --git a/.vim/after/ftplugin/crontab.vim b/.vim/after/ftplugin/crontab.vim @@ -1,2 +0,0 @@ -" Don't enforce horizontal character limit -setlocal fo-=t diff --git a/.vim/after/ftplugin/cs.vim b/.vim/after/ftplugin/cs.vim @@ -1 +0,0 @@ -setlocal foldmarker=#region,#endregion diff --git a/.vim/after/ftplugin/css.vim b/.vim/after/ftplugin/css.vim @@ -1 +0,0 @@ -compiler csslint diff --git a/.vim/after/ftplugin/gitcommit.vim b/.vim/after/ftplugin/gitcommit.vim @@ -1,2 +0,0 @@ -setlocal spell spelllang=en_us -setlocal noundofile diff --git a/.vim/after/ftplugin/go.vim b/.vim/after/ftplugin/go.vim @@ -1,2 +0,0 @@ -compiler go -set makeprg=go\ vet diff --git a/.vim/after/ftplugin/help.vim b/.vim/after/ftplugin/help.vim @@ -1 +0,0 @@ -setlocal nospell diff --git a/.vim/after/ftplugin/java.vim b/.vim/after/ftplugin/java.vim @@ -1,15 +0,0 @@ -" Break for code lines too -setlocal fo+=t - -" Reduce tab size for Java -setlocal sts=2 sw=2 - -" Wider text width for Java -setlocal tw=120 - -compiler javac -set makeprg=javac\ % - -execute InitializeClasspath() | execute BuildJavaMakeprg() - -let &comments='sO:* -,mO:* ,exO:*/,sr:/*,mb:*,ex:*/,b://' diff --git a/.vim/after/ftplugin/mail.vim b/.vim/after/ftplugin/mail.vim @@ -1 +0,0 @@ -setlocal spell spelllang=en_us tw=72 diff --git a/.vim/after/ftplugin/markdown.vim b/.vim/after/ftplugin/markdown.vim @@ -1,2 +0,0 @@ -" Enable spell checking by default -setlocal spell spelllang=en_us diff --git a/.vim/after/ftplugin/python.vim b/.vim/after/ftplugin/python.vim @@ -1,12 +0,0 @@ -" Break for non-comment lines (t), and insert comment char (r) -setlocal fo+=tr - -" Always set the compiler -compiler pylint - -" Check if Pipenv is available, and adjust makeprg if it is -if(filereadable('Pipfile')) - let &makeprg= 'pipenv run '.&makeprg.' %' -else - let &makeprg= &makeprg.' %' -endif diff --git a/.vim/after/ftplugin/rust.vim b/.vim/after/ftplugin/rust.vim @@ -1,8 +0,0 @@ -" Break on non-comment lines (t) and insert a comment character (r) -setlocal formatoptions+=tr - -" Always set the compiler -compiler rustc - -" Customize compiler if we're working on a crate -set makeprg=cargo\ clippy diff --git a/.vim/after/ftplugin/scss.vim b/.vim/after/ftplugin/scss.vim @@ -1 +0,0 @@ -setlocal expandtab softtabstop=2 shiftwidth=2 diff --git a/.vim/after/ftplugin/text.vim b/.vim/after/ftplugin/text.vim @@ -1,2 +0,0 @@ -" Enable spell checking by default -setlocal spell spelllang=en_us textwidth=72 diff --git a/.vim/after/ftplugin/vim.vim b/.vim/after/ftplugin/vim.vim @@ -1,5 +0,0 @@ -" Break non-comment lines too -setlocal fo+=t - -" Opinionated use of tabs over spaces -setlocal softtabstop=4 shiftwidth=4 expandtab diff --git a/.vim/after/ftplugin/yaml.vim b/.vim/after/ftplugin/yaml.vim @@ -1 +0,0 @@ -setlocal sts=2 sw=2 diff --git a/.vim/ftdetect/LICENSE.vim b/.vim/ftdetect/LICENSE.vim @@ -1 +0,0 @@ -au BufNewFile,BufRead LICENSE set filetype=LICENSE diff --git a/.vim/ftplugin/LICENSE.vim b/.vim/ftplugin/LICENSE.vim @@ -1 +0,0 @@ -setlocal comments= diff --git a/.vim/gvimrc b/.vim/gvimrc @@ -1,9 +0,0 @@ -nnoremap <Leader>rc :e $MYGVIMRC<CR> - - -if has('gui_gtk2') || has('gui_gtk3') - set guifont=Mono\ 10 -else - set guifont=Meslo\ LG\ M\ DZ\ Regular:h12,Menlo\ Regular:h12,Consolas:h11 -endif -set guioptions=egm diff --git a/.vim/pack/update_plugins b/.vim/pack/update_plugins @@ -1,16 +0,0 @@ -#!/bin/bash -update() -{ - echo "Updating $1" - cd $1 - git pull - cd - > /dev/null -} - -export -f update -cd bundle/opt/ -ls -1d */ | xargs -n 1 -P 10 -I {} bash -c 'update "$@"' _ {} -cd - -cd bundle/start/ -ls -1d */ | xargs -n 1 -P 10 -I {} bash -c 'update "$@"' _ {} -cd - diff --git a/.vim/skel/mit.skel b/.vim/skel/mit.skel @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) {{ year }} Daniel Moch - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/.vim/skel/reserved.skel b/.vim/skel/reserved.skel @@ -1 +0,0 @@ -Copyright (c) {{ year }}, Daniel Moch. All rights reserved. diff --git a/.vim/vimrc b/.vim/vimrc @@ -1,9 +0,0 @@ -if !&compatible && !exists('$POSIXLY_CORRECT') && v:version >= 700 - source ~/.vim/vimrc.normal - finish -end - -set runtimepath-=~/.vim -set runtimepath-=~/.vim/after -set compatible shortmess+=I t_Co=0 -silent! source ~/.exrc diff --git a/.vim/vimrc.normal b/.vim/vimrc.normal @@ -1,362 +0,0 @@ -" Vim starting {{{ -if has('vim_starting') - if (has('win32') || has('win64')) - set undodir=$HOME/vimfiles/undo - if v:servername !~ '.*[0-9]$' - silent! execute '!rmdir /S /Q "'.$HOME.'/vimfiles/vimtemp" &&' - \ ' mkdir "'.$HOME.'/vimfiles/vimtemp"' - endif - set backupdir=$HOME/vimfiles/vimtemp// - set directory=$HOME/vimfiles/vimtemp// - set spellfile=$HOME/vimfiles/en.utf-8.add - if exists('$HOME') && has('gui_running') && (argc() == 0) - cd $HOME - endif - else - set undodir=$HOME/.vim/undo - if v:servername !~ '.*[0-9]$' - silent! execute '!rm -rf "'.$HOME.'/.vim/vimtemp"' - silent! execute '!mkdir "'.$HOME.'/.vim/vimtemp"' - endif - set backupdir=$HOME/.vim/vimtemp// - set directory=$HOME/.vim/vimtemp// - set spellfile=$HOME/.vim/en.utf-8.add - endif - if has('win32') || has('win64') || $PATH =~ 'cygdrive' - set fileformats=dos,unix - endif - set undofile - if has('packages') - if isdirectory(expand('~/Documents/src/vim_plugins')) - set packpath+=~/Documents/src/vim_plugins - endif - elseif filereadable(expand('~/.vim/pack/bundle/start/vim-pathogen/autoload/pathogen.vim')) - runtime pack/bundle/start/vim-pathogen/autoload/pathogen.vim - if isdirectory(expand('~/Documents/src/vim_plugins')) - execute pathogen#infect('pack/bundle/start/{}', '~Documents/src/vim_plugins/pack/bundle/start{}') - else - execute pathogen#infect() - endif - execute pathogen#helptags() - endif - syntax off - filetype plugin indent on -endif -" }}} - -" Globals {{{ -let readline_has_bash = 1 -if exists('$TMUX') - if has('packages') - packadd vim-slime - endif - let g:slime_no_mappings = 1 - let g:slime_target = 'tmux' - let g:slime_paste_file = tempname() - let g:slime_default_config = {"socket_name": split($TMUX, ",")[0], "target_pane": ":.2"} -endif -" }}} - -" Helper functions {{{ -function! MyTmuxStatusLine(action) - if exists('$TMUX') - if a:action == 'off' - execute 'silent !tmux set -s status off' | redraw! - else - execute 'silent !tmux set -s status on' | redraw! - endif - endif -endfunction - -function! MyFileEncoding() - if &fileencoding != '' - return '['.&fileencoding.']' - else - return '' - endif -endfunction - -function! MyHexToggle() - if !&binary - setlocal binary - setlocal nonumber - let l:modified = &modified - %!xxd - if &ft - let b:filetype = &ft - endif - setlocal ft=xxd - let &modified = l:modified - else - setlocal nobinary - setlocal number - let l:modified = &modified - %!xxd -r - if exists('b:filetype') - let &ft=b:filetype - else - setlocal ft= - endif - let &modified = l:modified - endif -endfunction - -function! MySkeleton() - let l:skelfiles = glob('~/.vim/skel/*.skel', v:false, v:true) - let l:idx = 1 - let l:msg = 'Available licenses:' - for l:skelfile in l:skelfiles - let l:msg .= "\n\t".l:idx."\t".l:skelfile - let l:idx += 1 - endfor - let l:msg .= "\n\t".l:idx."\tNone" - echo l:msg - let l:selection = 0 - while l:selection < 1 || l:selection > l:idx - let l:selection = input("Use license: ") - endwhile - if l:selection == l:idx - return - endif - let l:skel = readfile(l:skelfiles[l:selection - 1]) - let l:comments = split(&comments, ',') - let l:idx = 0 - let l:firstcomment = '' - let l:comment = '' - let l:endspace = '' - let l:lastcomment = '' - let l:space = '' - for l:token in l:comments - if l:token =~ '^s[^O]' - let l:firstcomment = substitute(l:token, '^s.*:', '', '') - let l:comment = substitute(l:comments[l:idx + 1], '^m.*:', '', '') - if l:token =~ '^sr' - let l:offset = len(l:firstcomment) - len(l:comment) - let l:comment = repeat(' ', l:offset) . l:comment - let l:endspace = repeat(' ', l:offset) - endif - let l:lastcomment = substitute(l:comments[l:idx + 2], '^e.*:', '', '') - let l:space = (l:comments[l:idx + 1] =~ '^mb') ? ' ' : '' - break - elseif l:token =~ '^b\?:' - let l:comment = substitute(l:token, '^b\?:', '', '') - let l:firstcomment = l:comment - let l:lastcomment = l:comment - let l:rightalign = v:false - let l:space = (l:token =~ '^b') ? ' ' : '' - break - endif - let l:idx += 1 - endfor - let l:idx = 0 - for l:line in l:skel - if l:line =~ "^$" - let l:line = l:comment - else - let l:line = l:comment . l:space . l:line - endif - let l:line = substitute(l:line, '{{ year }}', "\\=strftime('%Y')", '') - let l:skel[l:idx] = l:line - let l:idx += 1 - endfor - let l:skel = [l:firstcomment] + l:skel + [l:endspace . l:lastcomment] - - let l:lines = join(l:skel, "\n") - silent execute '0put =printf(\"%s\", l:lines)' - set modified - normal G -endfunction - -function! MyPasteStatus() - if &paste && get(w:,'active_window',0) - return '[p]' - else - return '' - endif -endfunction - -function! MySpellStatus() - if &spell - return '[s]' - else - return '' - endif -endfunction - -function! MyItalicize() - if exists('*execute') - let l:higroups = split(execute(':highlight'), '\n') - for l:group in l:higroups - if l:group =~# 'gui=[\w,]*italic' - let l:groupname = split(l:group)[0] - let l:ctermcmd = '' - for l:token in split(l:group) - if l:token =~# '^cterm=' - let l:ctermcmd = l:token - endif - endfor - if l:ctermcmd == '' - let l:ctermcmd = 'cterm=italic' - else - if l:ctermcmd !~# 'italic' - let l:ctermcmd = l:ctermcmd.',italic' - endif - endif - execute 'highlight '.l:groupname.' '.l:ctermcmd - endif - endfor - endif -endfunction - -function! MyShowMode() - if get(w:, 'active_window', 0) - return '['.mode().']' - else - return '' - endif -endfunction - -function! OptStatus(function) - if exists('*'.a:function) - return call(a:function, []) - else - return '' - endif -endfunction - -function! InitializeClasspath() - if(filereadable('.vim_java_classpath')) - so .vim_java_classpath - endif -endfunction - -function! BuildJavaMakeprg() - if exists('b:vim_java_classpath') - let &makeprg = &makeprg.' -cp '.b:vim_java_classpath - endif -endfunction -" }}} - -" Commands {{{ -if !has('win32') && !has('win64') - command! -range=% IX silent execute <line1>.','.<line2>."w !curl -n -F" - \ ."'f:1=<-' ix.io | tr -d '\\n' | " - \."my copy" -endif -" }}} - -" Auto-commands {{{ -augroup myvimrc - autocmd! - if has('win32') || has('win64') - autocmd BufWritePost _*imrc silent! execute '!attrib +H' - \.bufname('%') | so % | call MyItalicize() - else - autocmd BufWritePost *imrc so % | call MyItalicize() - endif - autocmd VimResized * wincmd = - autocmd User GoyoEnter Limelight | execute MyTmuxStatusLine('off') - autocmd User GoyoLeave Limelight! | execute MyTmuxStatusLine('') - autocmd QuickFixCmdPost [^l]* nested cwindow - autocmd QuickFixCmdPost l* nested lwindow - autocmd QuickFixCmdPre [^l]* nested silent! cclose - autocmd QuickFixCmdPre l* nested silent! lclose - autocmd BufNewFile Makefile,*.py,*.cpp,*.java,LICENSE call MySkeleton() - autocmd VimEnter * let w:active_window = 1 | call MyItalicize() - autocmd WinEnter * let w:active_window = 1 - autocmd WinLeave * unlet! w:active_window - if has('win32') || has('win64') - autocmd GuiEnter * simalt ~x - elseif has('gui_macvim') - autocmd GuiEnter * set fullscreen - endif - autocmd ColorScheme * call MyItalicize() - autocmd BufWritePre /tmp/* setlocal noundofile -augroup END -" }}} - -" Key mappings {{{ -let mapleader=";" -nnoremap rc :New $MYVIMRC<CR> -nnoremap <Leader>g :GrepJob!<Space> -nnoremap <Leader>' :vnew<CR> -nnoremap <Leader>- :new<CR> -nnoremap <Leader>e :e **/ -nnoremap <Leader>s :ScratchBuffer<CR> -nnoremap <Leader>n :New<Space> -nnoremap <Leader>h :Help<Space> -nnoremap <Leader>l :ls<CR>:b -nnoremap <Leader>L :ls<CR>:Buffer -nnoremap <leader>b :Buffer<Space> -nnoremap <leader>x :call MyHexToggle()<CR> -if exists('$TMUX') - xmap <leader>r <Plug>SlimeRegionSend - nmap <leader>r <Plug>SlimeMotionSend - nmap <leader>rr <Plug>SlimeLineSend -endif -if has('win32') || has('win64') - nnoremap <Leader>o :execute 'silent ! start '.expand('<cWORD>')<CR> -else - nnoremap <Leader>o :execute 'silent !my-open ' - \ .expand(shellescape('<cWORD>')) \| redraw!<CR> -endif -nnoremap <Leader>c :silent! execute 'cclose' \| - \ silent! execute 'lclose'<CR> -nnoremap <F4> :setlocal spell spelllang=en_us<CR> -nnoremap <F5> :nohl<CR> -nnoremap <F6> :call MySkeleton()<CR> -nnoremap <F8> :Goyo<CR> -if has('win32') || has('win64') - nnoremap <F9> :MakeJob!<CR> -else - nnoremap <F9> :MakeJob!<CR> -endif -" }}} - -" General options {{{ -set statusline=%{MyShowMode()}%{MySpellStatus()}%{MyPasteStatus()}%<%f%m -set statusline+=%r%h%q%w%{OptStatus('fugitive#statusline')}%=[%{&ff}] -set statusline+=%{MyFileEncoding()}%y%{OptStatus('ObsessionStatus')} -set statusline+=[%p%%][Ln:%l/%L,Col:%v] -colorscheme djmoch -set ttyfast -set nowrap -set noshowmode -set showcmd -set textwidth=72 -set autoindent -set visualbell -set smartcase -set number -set foldmethod=marker -set ttimeoutlen=0 -if !exists('$TMUX') - set clipboard+=unnamed -endif -set laststatus=2 -set wildmenu -set wildmode=longest:full,full -set nofileignorecase -set history=10000 -set hlsearch -set incsearch -set mouse=a -set backspace=indent,eol,start -set backup -set wildignore+=tags,*.class,*.pyc,*.pyo,__pycache__,*.o -if has('win32') || has('win64') - set grepprg=findstr\ /n\ /S - set viminfo+=n$HOME/vimfiles/viminfo -else - set grepprg=ag\ --vimgrep\ -p\ ~/.cvsignore\ $* - set grepformat=%f:%l:%c:%m - set viminfo+=n$HOME/.vim/viminfo -endif -set autowrite -set pastetoggle=<F2> -if $SHELL =~ 'zsh' || $SHELL =~ 'bash' - set title -endif -let &titlestring=hostname() . ':%t%h' -set tags^=.git/tags -" }}}