aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2018-04-06github-url: Document functionsTeddy Wing
Add doc comments to these functions.
2018-04-06github-url: Don't add ending line to URL if it wasn't part of the rangeTeddy Wing
If the command was executed as: :6GitHubFileURL we previously appended `#L6-L6` to the URL. This change appends only `#L6` in that case.
2018-04-06github-url: Add `<count>` to commandTeddy Wing
Using a `count` of 0 allows us to determine in `s:FileURL` whether a range was given on the command line. This count needs to be passed into the function explicitly with `<count>`.
2018-04-06Add 'github-url' pluginTeddy Wing
A rough working implementation of a plugin that generates a GitHub URL for the current file. It gets the base URL from the current Git repo's `origin` remote and uses the current commit SHA. Lines can also be highlighted by passing a range to the command. This makes it easier to share a bit of code that I see in the editor with other people on my team in chat or the issue tracker.
2018-04-06vimrc: Add `z<C-]>` mappingTeddy Wing
For jumping to a tag, `<C-]>` is great, but I usually like to have the current buffer stay open and look at the tag source in a different window. This new mapping gives me a quick way to do that.
2018-03-28git-blamer: Run `git show` on <Enter>Teddy Wing
When the `<Enter>` key is pressed in the GitBlamer window, run `!git show` on the commit from the current cursor line of the blame. This allows a changed line to be inspected in the context of its original changeset. It also saves me time from my previous workflow: cpe^Zgit show <Apple-P><Enter>
2018-03-25git-blamer: Refocus original window when blamer buffer is closedTeddy Wing
Previously, when the GitBlamer window was closed, the window it was opened from would not be re-focused. Because of this, you couldn't just pick up where you left off, you had to run a window command first. This change re-focuses the original window automatically, bringing you right where you were before opening GitBlamer. Unfortunately, this seemingly simple want is not easy to do in VimL. There's a `WinLeave` autocmd, but that event gets executed _before_ leaving a window. Similarly, the `BufWinLeave` autocmd we already had gets executed before the buffer is removed from the window. Because these events happen before the window is left, running the `wincmd w` command doesn't work. We need a way to run the command after the window is closed, allowing us to work with the new window layout and window numbers. In order to run `wincmd w` at the proper time, we add a new autocmd upon closing the GitBlamer window that gets executed when any window is entered. That autocmd refocuses the correct window and removes itself, having served its purpose. I used a tab variable to store the window number because it was a way to allow multiple GitBlamer instances in different tabs. Otherwise, the autocmd would be attached to a window that isn't correct in other tabs. Also, augroups can't have dynamic names, so we can't create them programmatically, preventing us from having multiple autocmds with different window numbers for different tabs. The disadvantage of using a tab variable is that window focus restoration doesn't work when multiple GitBlamers are opened in a single tab.
2018-03-24git-blamer: Fix bug when `nowrap`Teddy Wing
If `nowrap` is set, the plugin causes an error because it tries to concatenate the `restore` variable which hasn't been defined. Define the variable outside the `if &l:wrap` condition to ensure it's available for concatenation.
2018-03-07git-blamer: Set `nowrap` on bufferTeddy Wing
In order to get the cursor lines to correctly match up horizontally in all cases, set 'nowrap' on the buffer. To set 'wrap' back, follow fugitive.vim's example: https://github.com/tpope/vim-fugitive/blob/f3ccb0c12ee4985b8808f83059830a24cc92821c/plugin/fugitive.vim#L2038-L2040
2018-03-07git-blamer: Add `q` mapping to quit windowTeddy Wing
Makes it just a bit easier to close the GitBlamer window. Since we shouldn't need macros in this panel it should be fine.
2018-03-07git-blamer: Use `syncbind` to aid horizontal line alignmentTeddy Wing
Adding `syncbind` appears to fix the bug where in certain cases the GitBlamer cursor line and the buffer cursor line weren't horizontally aligned.
2018-03-07git-blamer: Use `cursor()` instead of `setpos()`Teddy Wing
Use the `cursor()` function to set the position of the cursor. This call is simpler than `setpos()`, and more descriptive than `execute l:top_line` (that was inspired by fugitive.vim, https://github.com/tpope/vim-fugitive/blob/f3ccb0c12ee4985b8808f83059830a24cc92821c/plugin/fugitive.vim#L2048-L2064)
2018-03-07git-blamer: Align cursor lines of buffer and GitBlamer windowTeddy Wing
Take the mechanism that Fugitive.vim uses: https://github.com/tpope/vim-fugitive/blob/f3ccb0c12ee4985b8808f83059830a24cc92821c/plugin/fugitive.vim#L2048-L2064 This positions the cursor lines on the same horizontal line so that blame information can be read on the same line as the code it corresponds to. Not sure, but it doesn't seem to work exactly right on one of my machines, but did appear to work correctly on another. Could just be the fault of 'wrap' though.
2018-03-07git-blamer: Remove terminating whitespaceTeddy Wing
I don't really like these any more.
2018-03-07git-blamer: Fix bug causing `cursorbind` to be set on other windowsTeddy Wing
In some instances with more than one window open, closing the GitBlamer window would cause other windows in the tab to have `cursorbind` (and presumably `scrollbind`) set. Fix the bug by setting `scrollbind` and `cursorbind` on the buffer (these are window-local variables, we'll have to find out if it's weird to set them on a buffer), and store the "restore" command in a buffer-local variable (local to the GitBlamer window).
2018-03-05Add 'vim-rails-locale-alternate' pluginTeddy Wing
Facilitates opening Rails locale files in alternate languages.
2018-02-19projects/af83.vim: Add `NO_RCOV=1` to `g:rspec_command`Teddy Wing
Speed up tests by disabling the test coverage report generator using the STIF project's custom environment variable flag.
2018-02-13ftplugin/mail.vim: Activate Vim's mail ftpluginTeddy Wing
I was using a different machine and composing an email, but there I wasn't getting a `textwidth` setting of 72. Instead it was unset. Ensure the default mail ftplugin gets sourced so we get the proper `textwidth`, plus some other niceties.
2018-02-10vimrc: Add <leader>w mapping to search with RipgrepTeddy Wing
Searches the `<cword>` with Ripgrep for more streamlined project searching.
2018-02-06Create 'vim-latearliest' pluginTeddy Wing
Adds two new commands that allow you to move to the beginning and end of undo history.
2018-02-05vimrc: Make <leader>sp mapping use `setlocal`Teddy Wing
Toggling spell checking should not happen for the entire Vim session, only for the current buffer. We don't want to be editing regular text and then switch into a code file and find spell checking turned on.
2018-01-20vimrc: Add <leader>sp mapping to toggle spell checkingTeddy Wing
One frustration that happens every so often is having to manually type `:set spe<Tab><CR>` or `:set nosp<Tab><CR>` to turn spell checking on and off. It's not often that I need to toggle spell checking, but when I do, I notice it as being bothersome. I think it's finally time to add a mapping for this.
2017-12-20Update 'vim-grappele' to v0.0.5Teddy Wing
Fixes a bug where pressing `gG` without first having used `[count]G` to store a location caused an error.
2017-12-13projects/af83.vim: Add abbreviations for OuibusTeddy Wing
I'm not supposed to write this word, so change it to the code word automatically if I happen to write it accidentally in a commit message. Interestingly, the bars (`|`) need to go either right next to the backslashes (`\`) or right after the right-hand side, as in: inoreabbrev <buffer> Ouibus the socle commun| Otherwise, if a space is before the `|`, that space becomes part of the abbreviation's right-hand side.
2017-12-05ftplugin/ruby.vim: Add mapping to reset the Rails test databaseTeddy Wing
Occasionally I need to drop and reload the Rails test database. Recently I've been working on something that requires a "truncation"-cleaned test, and have had to reset my database regularly while writing the test to eliminate inconsistent state. This command gives me the ability to reset with a single key press. I've been testing it out for a few days in a Vim session and have found it very helpful.
2017-12-05ftplugin/ruby.vim: Add `RubyNewHashSyntax` commandTeddy Wing
I've had to use a similar pattern a couple of times in the past to convert files or sections of files from the old Ruby hash syntax (`:key => 'value'`) to the new syntax (`key: 'value'`). Give the pattern and substitution a command to make it readily available the next time I need to use it.
2017-11-28vimrc: Log statistics of RSpec command usageTeddy Wing
When any of my RSpec commands are used, log a message to a file that says which one was just used. These statistics will be used for an experiment, gathering frequency data over time. That data will then be used to determine how often the lowercase variants are used, and how often the uppercase variants are used. If uppercase occurs more often than lowercase, the commands should be swapped, because lowercase takes less time to type.
2017-11-14Add ftplugin/slim.vimTeddy Wing
Ugh, I hate Slim. But I increasingly have to deal with it in projects. Fix what's within our power to fix, and give ourselves Ruby indentation in Slim files.
2017-09-26vimrc: Add mapping to run nearest RSpec with unicode "flag in hole"Teddy Wing
Like our unicode "hole" mapping to run the whole spec file, use "flag in hole" (U+26F3) to run the nearest spec test. This corresponds to Shift-extra ISO key on my keyboard.
2017-09-22ftplugin/ruby.vim: Add command to stop SpringTeddy Wing
I love Spring, it makes it so much nicer to run tests in Rails apps. That's why I set 'vim-rspec' to use it. However, sometimes it gets confused and doesn't load the latest code, and a load error occurs. Recently I started a new project and those errors occur every few times I run the tests. It's absolutely unbearable. To make life a tiny bit easier, make a command that allows us to stop Spring from Vim, to avoid having to <C-z> and type the command by hand. You can tell I was frustrated when I decided to make this command.
2017-09-19vimrc: Add mapping to run RSpec file with unicode "hole" characterTeddy Wing
I'm now doing some work on a machine with an ISO keyboard layout, which gives me one extra key compared to my normal ANSI layout (really cool!). To take full advantage of this, I created a custom software keyboard layout that changes the extra key next to the left "Shift" key to a unicode U+1F573 "hole" character. Since I'm not actually going to be typing that character, it gives me an easy hook for remapping. This new mapping allows me to run a spec file with a single key press.
2017-09-19vimrc: Add <leader>mk mapping to save Vim sessionTeddy Wing
I had previously defined this command as 'af83'-project-specific. Now I've become used to it and want to use it everywhere, so promote it to a global mapping.
2017-09-19vimrc: Set 'backspace=indent,eol,start'Teddy Wing
I installed my Vim config on another machine recently and noticed that it didn't automatically set 'bs=2', like in my normal environment. Put this in our vimrc because it should just work everywhere.
2017-08-11vimrc: Add window number to statuslineTeddy Wing
Thanks to "aegray" for asking how to jump to a specific window using automatic numbers instead of using `<C-w>hjklw` on Freenode#vim. This prompted me to look up `:h winnr()`, which I remember from a long time ago, and learn that you can use the window numbers with `<C-w>w`, as in `3<C-w>w`. This will make it much easier to move around between my sometimes many windows. In order to be able to tell which window has which number, add the `winnr()` to the statusline.
2017-08-10Add ftplugin/haskell.vimTeddy Wing
Add syntax formatting settings for Haskell. Want 4-space tabs and a maximum of 80 characters per line. Using this style guide: https://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.md
2017-07-31projects/af83.vim: Move `g:rspec_command` setting from stif.vim hereTeddy Wing
Instead of using Spring for RSpec only on the STIF project, use it for all af83 projects.
2017-07-09Update 'vim-grappele' to v0.0.4Teddy Wing
Doesn't clobber saved location when using `G` without a count.
2017-07-04vimrc: Add ZA mapping to update all buffers and quitTeddy Wing
Tested this out for a while without committing it and it turns out I actually started using this mapping frequently enough, so I'm saving it. The real impetus for this is that I recently (in the last couple months) set: $ git config commit.verbose 1 to get a diff of changes to be committed in my Vim commit buffer. This is really handy. Often I end up opening Vim windows to see the rest of the diff while still having my commit message open and visible. Thus my normal workflow of writing a commit message and committing with ZZ no longer works in these cases where there are multiple windows open. To more quickly save the commit message and quit all windows, this command comes in really handy.
2017-05-31Add projects/stif.vimTeddy Wing
A project-specific config for the STIF app. Set a custom RSpec command for rspec.vim that runs the Spring preloader instead of calling RSpec directly. This allows us to eliminate the slow-as-molasses Rails startup time when iterating on code with tests.
2017-05-10Update 'vim-gitcha' to v0.0.2Teddy Wing
Show the completion menu even when there's only one result so we can still read the commit message subject. This allows for easy validation that we've autocompleted the right commit SHA.
2017-05-04vimrc: Add <leader>sm mapping to split chained method callsTeddy Wing
A mapping to invoke our new 'whitespace-method-chain' plugin.
2017-05-04whitespace-method-chain: Silence commandsTeddy Wing
If the commands result in errors, they should fail silently, because we may have exected them on things that don't match, like a line that has no '.'s or a single-line buffer.
2017-05-04whitespace-method-chain: Move function to autoloadTeddy Wing
Don't force the function to load on startup.
2017-05-04Rename 'whitespace-chain' to 'whitespace-method-chain'Teddy Wing
Give the plugin a clearer name.
2017-05-04Add 'whitespace-chain' pluginTeddy Wing
A new plugin to split method chains onto multiple lines. For example: scope.line.result(distinct: true).paginate becomes: scope .line .result(distinct: true) .paginate
2017-05-04projects/af83.vim: Set a custom .agignore for PickTeddy Wing
When opening files with Pick and pick.vim, use a project-level .agignore file to ignore files and directories that shouldn't be searched when fuzzy-finding. This allows us to eliminate vendor directories like `node_modules` from the search path.
2017-04-29Add ftplugin/gitcommit_gitcha.vimTeddy Wing
Unlet `b:did_ftplugin` to allow 'vim-gitcha' to work. By default we override `b:did_ftplugin` to disable filetype plugins, but here we want the ftplugin to work.
2017-04-29Add 'vim-gitcha' pluginTeddy Wing
Provides completion of Git SHAs in commit messages. Super handy for referencing other commits without having to copy-paste and use the mouse. Was getting tired of that routine.
2017-04-29Add ftdetect/slim.vimTeddy Wing
Working on a Rails project that uses Slim templates. Looks like we have HAML syntax highlighting built-in, so just use that to highlight Slim files.
2017-04-24vimrc: Make <C-w><C-q> a no-opTeddy Wing
Get rid of this freaking good-for-nothing command that keeps g'all dang messing me the frak up and closing my windows!