aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2019-05-04Add ftdetect/typescript.vimTeddy Wing
Trying out Typescript in a project. Instead of getting a Typescript Vim plugin, just use the Javascript syntax highlighter for simplicity.
2018-12-13Update 'vim-grappele' to v0.1.0Teddy Wing
Includes visual and operator-pending mode mappings.
2018-12-13ftplugin/objc.vim: Switch alternates on <C-^>Teddy Wing
Use FSwitch to swap .h and .m files in the current window when `<C-^>` is pressed.
2018-12-13Add 'vim-fswitch' pluginTeddy Wing
Makes switching to alternate files much more efficient. Will be using this for Objective-C implementation and header files, but it could be useful in other contexts, even outside the C realm.
2018-12-13Add 'tabular' pluginTeddy Wing
2018-11-24ftplugin/todo.vim: Don't change highlighting of non-todo filesTeddy Wing
Previously, the custom highlighting I had added for TODO files would infect the highlighting of all other files in the same Vim session. Only change the highlighting of the `todoUndone` group so that it doesn't affect anything else.
2018-11-24Add ftplugin/dome_key.vimTeddy Wing
Use the plugin's ftplugin. This gives us the proper comment string.
2018-11-24Add 'vim-dome-key' pluginTeddy Wing
Syntax highlighting for DomeKey mapping files.
2018-11-24Add ftplugin/make.vimTeddy Wing
Set the correct comment string for make.
2018-11-24Add ftplugin/objc{,pp}.vimTeddy Wing
Filetype plugins for Objective-C. Turns out editing ObjC in Vim is somewhat surprisingly whoppingly better than Xcode. This gets indentation set to 4-space tabs and sets the comment correct prefix (Tcomment forces /* ... */). Include `objcpp` also because ObjC header files get recognised by Vim as ObjC++.
2018-04-19Update 'vim-tabs-grep' to v1.0.0Teddy Wing
The `:TabsGrep` command now takes a glob instead of a regex pattern.
2018-04-08Add 'vim-tabs-grep' pluginTeddy Wing
Provides a `:TabsGrep` command that enables `:tabs` output to be filtered, making it easier to find out which tab a file is on.
2018-04-06github-url: Copy the URL to the clipboard in addition to printing itTeddy Wing
Previously all we did was `echo` the generated URL to the command line. This was mainly for debugging purposes, but it strikes me that this would be nice to keep so that users can validate that the correct URL was generated. In addition to doing this, though, we need to provide an easy way to send that URL string into other programs like chat or an input field in a web browser. Copy the URL to the Mac OS X clipboard to make it easier to share.
2018-04-06github-url: Add `--no-patch` to `git show` commandTeddy Wing
If there's a diff in the index, that will get included in the output of this command, meaning that just after the SHA, there will be a multi-line diff string that completely messes up the constructed URL. Use the `--no-patch` flag to suppress diff output.
2018-04-06github-url: Move functions into `autoload`Teddy Wing
Improve performance by eliminating the functions from the `plugin` file. Also introduces a new `github_url#GitHubURL()` function that serves as an entry point into the plugin. Add a `g:loaded_github_url` check to prevent plugin re-sourcing and be a good Vim citizen.
2018-04-06github-url: Get rid of useless `echo`Teddy Wing
I used this for testing purposes but it's no longer relevant.
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.