diff options
author | Teddy Wing | 2015-07-27 00:11:11 -0400 |
---|---|---|
committer | Teddy Wing | 2015-07-27 00:11:11 -0400 |
commit | aa43b8334aea182a442f6a88854065ec9a1f3c24 (patch) | |
tree | 148da7be614cecc6c9385e2d3c91ca71afbd7d59 | |
parent | dcb5dc94893ba546a52085c92d9e982a4d6a1464 (diff) | |
download | dotvim-aa43b8334aea182a442f6a88854065ec9a1f3c24.tar.bz2 |
Track project-specific config files
* Remove project files from the ignore list
* Add project config files as they are now
* Create a new untracked file to keep track of project directory paths
The reason why I never tracked project files in the repo was because I
didn't want my file paths to be shared publicly. But over time I've been
making changes to my `flashnotes.vim` config and wanted to be able to
track those changes, especially the `ctags` ones.
Now, I'm able to track those config files and still hide my file paths
from public view using a set of environment variables defined in
`.vim/projects/file-paths.vim`.
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | projects/flashnotes.vim | 18 | ||||
-rw-r--r-- | projects/union-capital.vim | 5 | ||||
-rw-r--r-- | vimrc | 3 |
4 files changed, 27 insertions, 1 deletions
@@ -8,7 +8,7 @@ /backup/undo/** # Custom -/projects/ +/projects/file-paths.vim # Defaults !.gitkeep diff --git a/projects/flashnotes.vim b/projects/flashnotes.vim new file mode 100644 index 0000000..e3ac873 --- /dev/null +++ b/projects/flashnotes.vim @@ -0,0 +1,18 @@ +" Flashnotes +augroup Flashnotes + autocmd! + autocmd BufRead,BufEnter $VIM_PROJECT_PATH_FLASHNOTES/*.{scss,js,html} setlocal expandtab tabstop=2 softtabstop=2 shiftwidth=2 textwidth=100 + + " Generate a new ctags file for Python sources. Use tmux to run the command in the background. + autocmd BufRead,BufEnter $VIM_PROJECT_PATH_FLASHNOTES/*.{py} + \ nnoremap <buffer> <leader>gc :silent! execute '!tmux new -d "ctags --languages=Python --python-kinds=-i --excmd=number -f $VIM_PROJECT_PATH_FLASHNOTES_ROOT/tags -R $VIM_PROJECT_PATH_FLASHNOTES/ $VIM_PROJECT_PATH_VIRTUALENVS"' \| redraw!<cr> | + \ setlocal tags+=tags; " Look for tags file and recurse up directories + + " Generage a new ctags file for JavaScript sources + autocmd BufRead,BufEnter $VIM_PROJECT_PATH_FLASHNOTES/*.{js} + \ nnoremap <buffer> <leader>gc :silent! execute '!tmux new -d "ctags --options=$VIM_PROJECT_PATH_FLASHNOTES_ROOT/.ctags.conf --languages=js --excmd=number -f $VIM_PROJECT_PATH_FLASHNOTES_ROOT/jstags -R $VIM_PROJECT_PATH_FLASHNOTES/flashnotes/static/js"' \| redraw!<cr> | + \ setlocal tags+=jstags; + + " We have so many files, Command-T's default of 30000 isn't enough! + autocmd BufRead,BufEnter $VIM_PROJECT_PATH_FLASHNOTES/* let g:CommandTMaxFiles=50000 +augroup END diff --git a/projects/union-capital.vim b/projects/union-capital.vim new file mode 100644 index 0000000..c385aed --- /dev/null +++ b/projects/union-capital.vim @@ -0,0 +1,5 @@ +" Union Capital - Random Hacks of Kindness Hackathon +augroup Union_Capital_RHoK + autocmd! + autocmd BufRead,BufEnter $VIM_PROJECT_PATH_UNION_CAPITAL/* setlocal expandtab tabstop=2 softtabstop=2 shiftwidth=2 +augroup END @@ -672,6 +672,9 @@ command! -nargs=* Wrap set wrap linebreak nolist " Project Settings " ================ +" Source environment variables set to project paths +source ~/.vim/projects/file-paths.vim + " Source all files in the ~/.vim/projects directory " http://stackoverflow.com/a/4500936 for f in split(glob('~/.vim/projects/*.vim'), '\n') |