aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2019-11-18vimrc: Add gS mapping to ArgWrapTeddy Wing
After reading Drew Neil's Follow My Leader again (http://vimcasts.org/blog/2014/02/follow-my-leader/), I discovered this issue in which Tim Pope suggests mappings for the SplitJoin plugin: https://github.com/AndrewRadev/splitjoin.vim/issues/14#issuecomment-9666431 This inspired my to add a mapping for `ArgWrap`. I decided not to before because `:ar<Tab><Enter>` seemed like it wasn't much effort to type. But, why not make this a touch quicker? At first I considered `cJ`, which is available: nnoremap cJ :ArgWrap<cr> However, in the aforementioned issue, Pope suggests `gS` as being a free lhs sequence, which seems nicer.
2019-11-18ftdetect/json.vim: Disable on Vim < 8Teddy Wing
Recent Vims have a built-in JSON syntax plugin which is a little easier to read than the JavaScript highlighting. Use the built-in one on Vim 8 and higher.
2019-11-18projects/aodocs.vim: Add <C-x>u command mapping to insert UFO ticket folderTeddy Wing
Add a shortcut to quickly insert the UFO ticket folder path at the command line to save me the trouble of having to type & complete it manually.
2019-11-04Add ftplugin/javascript.vimTeddy Wing
Add bindings to insert `debugger` statements in JavaScript.
2019-10-27git-shortcuts: Add commit movement omapsTeddy Wing
Omaps for `[[` and `]]` commit motion commands.
2019-10-27Add 'git-shortcuts' pluginTeddy Wing
An ftplugin that provides `[[` and `]]` mappings to move between commits in `git log` output.
2019-10-21Remove ftplugin/gitcommit_pullreq_editmsg.vimTeddy Wing
Now that I effectively removed the `checktime` augroup in cc86bdf4af5212a3b2a7960e65c402eac71091c1, this is no longer necessary. Also, it errors because `checktime` no longer exists.
2019-10-15projects/aodocs.vim: Set Shell indentation rulesTeddy Wing
2019-09-30projects/aodocs.vim: Set CSS indentation rulesTeddy Wing
2019-09-30projects/aodocs.vim: Add mappings to enable/disable ESLint debuggerTeddy Wing
Mappings for JavaScript files that add and remove the `no-debugger: warn` rule to `.eslintrc`.
2019-09-26surround.vim: Add `s` for GitHub suggestion surroundingTeddy Wing
Use `s` to wrap text in a GitHub suggestion. Before: Text After: ``` suggestion Text ```
2019-09-26ftplugin/go.vim: Change `<leader>cf` mapping to `<leader>cd`Teddy Wing
This mapping conflicted with the `<leader>cf` mapping in my `vimrc` that copies the current filename/relative path to the clipboard.
2019-09-11github-url: Fix URL generation when `:pwd` is below repository rootTeddy Wing
If the `:pwd` was a subdirectory of the repository root, the path in the constructed GitHub URL would not include any subdirectories up to and including the current working directory. This created an incorrect path in the URL, resulting in a 404.
2019-09-02projects/aodocs.vim: Add comment leader 'formatoptions'Teddy Wing
Automatically insert the comment leader to facilitate JSDoc comments.
2019-08-01ftplugin/netrw.vim: Remove `nowrap` from `g:netrw_bufsettings`Teddy Wing
This seemed to cause files I opened with Netrw to have `set nowrap`, overriding the `set wrap` I have in my vimrc.
2019-07-21Add ftplugin/gitcommit_pullreq_editmsg.vimTeddy Wing
Disable 'better autoread' for PULLREQ_EDITMSG files. GitHub's `hub` CLI may be doing some polling on the file or something because I keep getting prompts to "Load file" after a while when writing pull request descriptions.
2019-07-11projects/aodocs.vim: Set HTML indentation rulesTeddy Wing
2019-07-03projects/aodocs.vim: Add mappings to run `ufo-cache-syncclient` programTeddy Wing
Mappings to modify the client build cache without leaving Vim. Use `:silent` combined with `<C-l>` to avoid the hit-enter prompt.
2019-07-03vimrc: Use Undotree on WindowsTeddy Wing
The Vim I'm using on Windows has `+python/dyn` and `+python3/dyn` (no `+python3`), but it doesn't seem like it has a Python interpreter that Vim can find. Use Undotree instead of Gundo there since it doesn't require Python.
2019-06-20Add ftplugin/lua.vimTeddy Wing
* Set 'commentstring' * Fix comment wrapping by adding `--` to 'comments'. Otherwise no leading comment markers would be inserted when text wrapped to the next line.
2019-06-19vimrc: Ignore `.git` directory in `g:pick_command`Teddy Wing
Since I allowed hidden files, I get everything in `.git` included in the Pick list. Filter out these files to make the list a bit less overwhelming.
2019-06-17vimrc: Don't preserve indentation on empty linesTeddy Wing
Over the years and as I've been using Vim, I've gradually stopped liking this style, and now prefer blank lines without whitespace. Rather than continuing to override the default for different filetypes, it feels like it's time to change the default.
2019-06-16vimrc: Disable modelinesTeddy Wing
Counteract CVE-2019-12735, arbitrary code execution in Vim/Neovim from modelines: https://github.com/numirias/security/blob/master/doc/2019-06-04_ace-vim-neovim.md Sad to disable something that I use on occasion, but it should be done.
2019-06-08projects/aodocs.vim: Silence Git commit title length mappingsTeddy Wing
Otherwise the function call appears in the command line which is distracting.
2019-06-08projects/aodocs.vim: Make commit title length variable based on issue IDTeddy Wing
Make the commit title length 72 characters plus the length of the ID followed by a colon and space.
2019-06-08projects/aodocs.vim: Allow longer Git commit titlesTeddy Wing
Since AODocs commit message style prefers putting Jira IDs at the very start of commit messages, give myself more room in the title. Personally I think references should be at the end of a commit message, so I'm going to take back the extra characters. TODO: Dynamically calculate the issue ID length and adjust the textwidth to 72 + that value.
2019-06-08vimrc: Move RSpec mappings to ftplugin/ruby.vimTeddy Wing
Since I'm not writing Ruby regularly right now, move these mappings to the Ruby ftplugin so I don't accidentally try to run a spec in another language where it makes no sense.
2019-06-08diff_corrections: Use better autocmdsTeddy Wing
Thanks to Christian Brabandt (https://vi.stackexchange.com/users/71/christian-brabandt) for describing better autocmds for detecting diff mode: https://vi.stackexchange.com/questions/12847/automatically-disable-cursorline-when-in-diff-mode/12852#12852 And for making the patch (https://github.com/vim/vim/commit/04f62f881c5743d2fdaf7324f6a715381f0d5fcf) that allows diff mode to be detected with the OptionSet event.
2019-06-05ftplugin/gitcommit.vim: Turn on 'formatoptions' `n`Teddy Wing
This formats numbered lists so that they wrap to the beginning of the text, instead of being flush with the number. Before: 1. A list that goes beyond the text width and wraps to the number. After: 1. A list that goes beyond the text width and wraps to the text. Thanks to this blog post from Edward Yang for prompting me to read the |fo-table| help again more closely: http://blog.ezyang.com/2010/03/vim-textwidth/
2019-06-05Add 'jira-text-formatting-notation-help' pluginTeddy Wing
Plugin that opens a window containing the text formatting guide for Jira. The guide is taken from: $ w3m -dump 'https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=all' Since I'm using the go-jira CLI, I need the reference for any special formatting I want to use. I figured it would help to have that information right next to my Vim buffer instead of having to switch to a browser and open the web page.
2019-06-03diff_corrections: Set 'wrap'Teddy Wing
Soft wrap in diffs. Recently encountered diffs with super long lines and thought it would be nice to be able to see everything on one page without having to scroll horizontally.
2019-06-03diff_corrections: Add `cx` mapping to close tabTeddy Wing
Add a mapping to quickly close a tab. Makes it easier to close files that I've finished reviewing. Thanks to user9433424 (https://vi.stackexchange.com/users/6960/user9433424) on the Vi Stack Exchange for the very detailed explanation of how to restore a mapping: https://vi.stackexchange.com/questions/7734/how-to-save-and-restore-a-mapping/7735#7735 Using user9433424's mapping restore code, and ignoring the case where a mapping is defined both globally and local to a buffer.
2019-06-03vimrc: Focus Undotree window when toggledTeddy Wing
Match Gundo's behaviour.
2019-06-03vimrc: Use Gundo when -python3 and Undotree when +python3Teddy Wing
I got this error today when opening Gundo: "__Gundo__" [New File] Error detected while processing function gundo#GundoToggle[1]..<SNR>102_GundoToggle[6]..<SNR>102_GundoOpen[31]..<SNR>102_GundoRenderPreview: line 2: Traceback (most recent call last): File "<string>", line 1, in <module> File "HOME/.vim/bundle/gundo/autoload/gundo.py", line 474, in GundoRenderPreview _output_preview_text(_generate_preview_diff(current, node_before, node_after)) File "HOME/.vim/bundle/gundo/autoload/gundo.py", line 382, in _generate_preview_diff before_time, after_time)) File "/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/difflib.py", line 1177, in unified_diff _check_types(a, b, fromfile, tofile, fromfiledate, tofiledate, lineterm) File "/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/difflib.py", line 1312, in _check_types raise TypeError('all arguments must be str, not: %r' % (arg,)) TypeError: all arguments must be str, not: 74 Didn't really want to bother investigating, so I tried Undotree and it worked. Since I have different Vims on different machines, keep Gundo as before, but use Undotree instead when compiled with +python3.
2019-06-03Add 'undotree' pluginTeddy Wing
2019-06-01Add ftdetect/git.vimTeddy Wing
Copy one of the Git file detectors from `/usr/local/share/vim/vim74/filetype.vim`. This gives me `gitcommit` filetype features for merge and tag messages even when using a Vim older than 7.4 (Vim 7.3, the default on many Macs, only sets COMMIT_EDITMSG to the `gitcommit` filetype). Additionally, set `gitcommit` on `PULLREQ_EDITMSG` files. This gives me the same features for pull request messages using GitHub's `hub` command line tool (in particular spell checking).
2019-06-01vimrc: Turn on persistent undoTeddy Wing
On a couple of occasions I've thought it would be useful to have this, so let's activate it.
2019-06-01Add ftplugin/javascript.vimTeddy Wing
Don't preserve indentation on empty lines in JavaScript files.
2019-06-01vimrc: Add `<leader>tc` mapping to close current tabTeddy Wing
Add a mapping to close tabs with multiple windows more quickly.
2019-05-25plugin/better_autoread.vim: Disable automatic `checktime` on Vim 8Teddy Wing
I kept getting E211 errors when switching Git branches with added/missing files or E321 errors. Normally, I'd get the error once, dismiss it, and be done with it, but on a new machine with a recent Vim install, the errors kept coming back up every few seconds, insupportable. Unless I can think of something better, take a heavy-handed approach and disable this on new Vims.
2019-05-24projects/aodocs.vim: Set indentation in JavaScript and JSON filesTeddy Wing
2019-05-17diff-corrections: Don't load if the lambda feature isn't availableTeddy Wing
I wrote the `s:SaveCommentColor()` function using a lambda for `filter()`ing. However, not all Vims have `lambda` support. And it doesn't exist before Vim 7.4 I think. Use this guard to avoid causing errors on startup for those Vims without lambdas.
2019-05-17diff-corrections/plugin: Add load guardTeddy Wing
2019-05-17diff-corrections: Restore old 'cursorline' and Comment highlightTeddy Wing
When diff mode is deactivated, the old values for 'cursorline' and the Comment highlight colour should be restored. Thanks to Tony Mechelynck (http://vim.1045645.n5.nabble.com/template/NamlServlet.jtp?macro=user_nodes&user=28373) for the tip on how to save and restore highlight colours: > The following is untested. It requires Vim version 7. > > function SaveCursorColor() > redir => highlight > silent hi Cursor > redir END > if highlight =~ 'links to ' > let s:hl-link = matchstr(highlight, 'links to \zs\S*') > elseif highlight =~ '\<cleared\>' > let s:hl-link = 'NONE' > else > let s:hl-link = '' > for substr in ['term', 'cterm', 'ctermfg', 'ctermbg', > \ 'gui', 'guifg', 'guibg', 'guisp'] > if highlight =~ substr . '=' > let s:hl-{substr} = matchstr(highlight, > \ substr . '=\S*') > else > let s:hl-{substr} = '' > endif > endfor > endif > endfunction > function RestoreCursorColor() > if !exists('s:hl-link') > echoerr 'Cursor not saved, cannot restore' > return > endif > hi clear Cursor > if s:hl-link == '' > exe 'hi Cursor' s:hl-term s:hl-cterm s:hl-ctermfg > \ s:hl-ctermbg s:hl-gui s:hl-guifg s:hl-guibg > \ s:hl-guisp > elseif hl-link != 'NONE' > exe 'hi link Cursor' s:hl-link > endif > endfunction > > > Best regards, > Tony. http://vim.1045645.n5.nabble.com/How-to-save-restore-the-hightlight-for-cursor-td1182624.html
2019-05-17ftplugin/go.vim: Add a mapping to run `goimports`Teddy Wing
Sometimes the run-on-save functionality doesn't work. This gives me a quick way to run the formatter when it doesn't happen automatically.
2019-05-17ftplugin/gitcommit.vim: Turn on spell checking in Git commitsTeddy Wing
2019-05-17plugin/diff_corrections.vim: Increase 'tabpagemax' to 200Teddy Wing
The default is 10. Set it to a ridiculously large number so that we can open one tab per file during a code review.
2019-05-17ftplugin/go.vim: Add mapping to `:GoTestCompile`Teddy Wing
Make it faster to compile tests without running them.
2019-05-17ftplugin/go.vim: Make `go run` mapping run root main packageTeddy Wing
The `Plug` mapping wasn't finding my `main` package from a sub-package. Change it to force running for the main package in the `pwd` directory.
2019-05-11diff-corrections: Move corrections to `autoload`Teddy Wing
Makes the code a little nicer and more extensible without the line continuations. Only change the highlight colour for the 'twilight256' colour scheme.