diff --git a/.gitmodules b/.gitmodules index 8b13789..9e9c33e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1 +1,27 @@ - +[submodule "bundle/fugitive"] + path = vim/bundle/fugitive + url = https://github.com/tpope/vim-fugitive.git +[submodule "bundle/nerdtree"] + path = vim/bundle/nerdtree + url = https://github.com/scrooloose/nerdtree.git +[submodule "bundle/airline"] + path = vim/bundle/airline + url = https://github.com/vim-airline/vim-airline +[submodule "bundle/vim-colorschemes"] + path = vim/bundle/colorschemes + url = https://github.com/flazz/vim-colorschemes +[submodule "bundle/vim-scala"] + path = vim/bundle/vim-scala + url = https://github.com/derekwyatt/vim-scala +[submodule "bundle/vimwiki"] + path = vim/bundle/vimwiki + url = https://github.com/vimwiki/vimwiki.git +[submodule "bundle/vim-graphql"] + path = vim/bundle/vim-graphql + url = https://github.com/jparise/vim-graphql +[submodule "bundle/typescript-vim"] + path = vim/bundle/typescript-vim + url = https://github.com/leafgarland/typescript-vim +[submodule "bundle/vim-elixir"] + path = vim/bundle/vim-elixir + url = https://github.com/elixir-lang/vim-elixir.git diff --git a/vim/.vimrc b/vim/.vimrc new file mode 100644 index 0000000..8b793ce --- /dev/null +++ b/vim/.vimrc @@ -0,0 +1,89 @@ +execute pathogen#infect() + +syntax on +filetype plugin indent on + +" Window settings +set winminwidth=20 +set winwidth=100 +set winheight=20 + +" Wrapping +set nowrap +set linebreak " wrap nicer + +" Keeps lines below the cursor +set scrolloff=2 + +" Tabbing +" I added this monster because Python doesn't play nice with my usual +" settings, or some such nonsense. Anyway, it appears to work. +function! SetupTabbing() + set tabstop=2 + set expandtab + set shiftwidth=2 + set softtabstop=2 + set sw=2 + set autoindent + set smartindent + set smarttab +endfunction +command! -bar SetupTabbing call SetupTabbing() +SetupTabbing + +" makes LaTeX use spell checking, word wrapping +autocmd FileType tex set wrap spell +autocmd FileType make set noexpandtab +autocmd FileType python SetupTabbing +autocmd FileType markdown set wrap spell + +let java_allow_cpp_keywords=1 + +set ruler +set number +set relativenumber +set backspace=indent,eol,start +set hlsearch + +set splitright +set splitbelow + +map :NERDTreeToggle + + +" Enable airline by default +set laststatus=2 +let g:airline#extensions#tabline#enabled = 1 + +" Ignore *.pyc files. +let NERDTreeIgnore = ['\.pyc$'] + +" +"" I think this is some command for OS X compatibility? I don't know. Leaving +"" it here so that I can find it later if I need it. +"set term=xterm-color +set t_Co=256 + +colorscheme 256-grayvim +"colorscheme gentooish + +"let mapleader = "'" +"set pastetoggle=p +"map w :set wrap +"map e :set nowrap + +let g:vimwiki_list = [ {'path': '~/vimwiki'}, {'path': '~/Code/vimwiki-client-notes'} ] + +" fixes webpack file watchers +set backupcopy=yes + +" put swap files out of the current directory +set dir=$HOME/.vim/tmp/swap +if !isdirectory(&dir) | call mkdir(&dir, 'p', 0700) | endif + +set autoread +set updatetime=100 +au FileChangedShell * checktime +au CursorHold * checktime +au CursorHoldI * checktime + diff --git a/vim/autoload/pathogen.vim b/vim/autoload/pathogen.vim new file mode 100644 index 0000000..59a75c1 --- /dev/null +++ b/vim/autoload/pathogen.vim @@ -0,0 +1,353 @@ +" pathogen.vim - path option manipulation +" Maintainer: Tim Pope +" Version: 2.4 + +" Install in ~/.vim/autoload (or ~\vimfiles\autoload). +" +" For management of individually installed plugins in ~/.vim/bundle (or +" ~\vimfiles\bundle), adding `execute pathogen#infect()` to the top of your +" .vimrc is the only other setup necessary. +" +" The API is documented inline below. + +if exists("g:loaded_pathogen") || &cp + finish +endif +let g:loaded_pathogen = 1 + +" Point of entry for basic default usage. Give a relative path to invoke +" pathogen#interpose() (defaults to "bundle/{}"), or an absolute path to invoke +" pathogen#surround(). Curly braces are expanded with pathogen#expand(): +" "bundle/{}" finds all subdirectories inside "bundle" inside all directories +" in the runtime path. +function! pathogen#infect(...) abort + for path in a:0 ? filter(reverse(copy(a:000)), 'type(v:val) == type("")') : ['bundle/{}'] + if path =~# '^\%({\=[$~\\/]\|{\=\w:[\\/]\).*[{}*]' + call pathogen#surround(path) + elseif path =~# '^\%([$~\\/]\|\w:[\\/]\)' + call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')') + call pathogen#surround(path . '/{}') + elseif path =~# '[{}*]' + call pathogen#interpose(path) + else + call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')') + call pathogen#interpose(path . '/{}') + endif + endfor + call pathogen#cycle_filetype() + if pathogen#is_disabled($MYVIMRC) + return 'finish' + endif + return '' +endfunction + +" Split a path into a list. +function! pathogen#split(path) abort + if type(a:path) == type([]) | return a:path | endif + if empty(a:path) | return [] | endif + let split = split(a:path,'\\\@]','\\&','') + endif +endfunction + +" Like findfile(), but hardcoded to use the runtimepath. +function! pathogen#runtime_findfile(file,count) abort + let rtp = pathogen#join(1,pathogen#split(&rtp)) + let file = findfile(a:file,rtp,a:count) + if file ==# '' + return '' + else + return fnamemodify(file,':p') + endif +endfunction + +" Section: Deprecated + +function! s:warn(msg) abort + echohl WarningMsg + echomsg a:msg + echohl NONE +endfunction + +" Prepend all subdirectories of path to the rtp, and append all 'after' +" directories in those subdirectories. Deprecated. +function! pathogen#runtime_prepend_subdirectories(path) abort + call s:warn('Change pathogen#runtime_prepend_subdirectories('.string(a:path).') to pathogen#infect('.string(a:path.'/{}').')') + return pathogen#surround(a:path . pathogen#slash() . '{}') +endfunction + +function! pathogen#incubate(...) abort + let name = a:0 ? a:1 : 'bundle/{}' + call s:warn('Change pathogen#incubate('.(a:0 ? string(a:1) : '').') to pathogen#infect('.string(name).')') + return pathogen#interpose(name) +endfunction + +" Deprecated alias for pathogen#interpose(). +function! pathogen#runtime_append_all_bundles(...) abort + if a:0 + call s:warn('Change pathogen#runtime_append_all_bundles('.string(a:1).') to pathogen#infect('.string(a:1.'/{}').')') + else + call s:warn('Change pathogen#runtime_append_all_bundles() to pathogen#infect()') + endif + return pathogen#interpose(a:0 ? a:1 . '/{}' : 'bundle/{}') +endfunction + +if exists(':Vedit') + finish +endif + +let s:vopen_warning = 0 + +function! s:find(count,cmd,file,lcd) + let rtp = pathogen#join(1,pathogen#split(&runtimepath)) + let file = pathogen#runtime_findfile(a:file,a:count) + if file ==# '' + return "echoerr 'E345: Can''t find file \"".a:file."\" in runtimepath'" + endif + if !s:vopen_warning + let s:vopen_warning = 1 + let warning = '|echohl WarningMsg|echo "Install scriptease.vim to continue using :V'.a:cmd.'"|echohl NONE' + else + let warning = '' + endif + if a:lcd + let path = file[0:-strlen(a:file)-2] + execute 'lcd `=path`' + return a:cmd.' '.pathogen#fnameescape(a:file) . warning + else + return a:cmd.' '.pathogen#fnameescape(file) . warning + endif +endfunction + +function! s:Findcomplete(A,L,P) + let sep = pathogen#slash() + let cheats = { + \'a': 'autoload', + \'d': 'doc', + \'f': 'ftplugin', + \'i': 'indent', + \'p': 'plugin', + \'s': 'syntax'} + if a:A =~# '^\w[\\/]' && has_key(cheats,a:A[0]) + let request = cheats[a:A[0]].a:A[1:-1] + else + let request = a:A + endif + let pattern = substitute(request,'/\|\'.sep,'*'.sep,'g').'*' + let found = {} + for path in pathogen#split(&runtimepath) + let path = expand(path, ':p') + let matches = split(glob(path.sep.pattern),"\n") + call map(matches,'isdirectory(v:val) ? v:val.sep : v:val') + call map(matches,'expand(v:val, ":p")[strlen(path)+1:-1]') + for match in matches + let found[match] = 1 + endfor + endfor + return sort(keys(found)) +endfunction + +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Ve :execute s:find(,'edit',,0) +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit :execute s:find(,'edit',,0) +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vopen :execute s:find(,'edit',,1) +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vsplit :execute s:find(,'split',,1) +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vvsplit :execute s:find(,'vsplit',,1) +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabedit :execute s:find(,'tabedit',,1) +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit :execute s:find(,'pedit',,1) +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vread :execute s:find(,'read',,1) + +" vim:set et sw=2 foldmethod=expr foldexpr=getline(v\:lnum)=~'^\"\ Section\:'?'>1'\:getline(v\:lnum)=~#'^fu'?'a1'\:getline(v\:lnum)=~#'^endf'?'s1'\:'=': diff --git a/vim/bundle/airline b/vim/bundle/airline new file mode 160000 index 0000000..9d1196f --- /dev/null +++ b/vim/bundle/airline @@ -0,0 +1 @@ +Subproject commit 9d1196f40aac7bbef5cec0c9307e80e207a4dfca diff --git a/vim/bundle/colorschemes b/vim/bundle/colorschemes new file mode 160000 index 0000000..28a989b --- /dev/null +++ b/vim/bundle/colorschemes @@ -0,0 +1 @@ +Subproject commit 28a989b28457e38df620e4c7ab23e224aff70efe diff --git a/vim/bundle/fugitive b/vim/bundle/fugitive new file mode 160000 index 0000000..9835920 --- /dev/null +++ b/vim/bundle/fugitive @@ -0,0 +1 @@ +Subproject commit 9835920a3c91236021fc8c88cc4157304e24356b diff --git a/vim/bundle/nerdtree b/vim/bundle/nerdtree new file mode 160000 index 0000000..4ebbb53 --- /dev/null +++ b/vim/bundle/nerdtree @@ -0,0 +1 @@ +Subproject commit 4ebbb533c3faf2c480211db2b547972bb3b60f2b diff --git a/vim/bundle/typescript-vim b/vim/bundle/typescript-vim new file mode 160000 index 0000000..4dc79bd --- /dev/null +++ b/vim/bundle/typescript-vim @@ -0,0 +1 @@ +Subproject commit 4dc79bd1b0c43c16cae146bee065f2acc6d2b789 diff --git a/vim/bundle/vim-elixir b/vim/bundle/vim-elixir new file mode 160000 index 0000000..1c9344d --- /dev/null +++ b/vim/bundle/vim-elixir @@ -0,0 +1 @@ +Subproject commit 1c9344d8032374ca3767b1aaa0001edee9602e35 diff --git a/vim/bundle/vim-graphql b/vim/bundle/vim-graphql new file mode 160000 index 0000000..88abf6e --- /dev/null +++ b/vim/bundle/vim-graphql @@ -0,0 +1 @@ +Subproject commit 88abf6e7f418f399478359c8bf279f000615c2ef diff --git a/vim/bundle/vim-scala b/vim/bundle/vim-scala new file mode 160000 index 0000000..842baaf --- /dev/null +++ b/vim/bundle/vim-scala @@ -0,0 +1 @@ +Subproject commit 842baaff633b61fcc92e1db10042f0ed9571cf95 diff --git a/vim/bundle/vimwiki b/vim/bundle/vimwiki new file mode 160000 index 0000000..3a87437 --- /dev/null +++ b/vim/bundle/vimwiki @@ -0,0 +1 @@ +Subproject commit 3a8743700581923c6fd2684510dad48a8b2b8c64