Age | Commit message (Collapse) | Author |
|
Use FSwitch to swap .h and .m files in the current window when `<C-^>`
is pressed.
|
|
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.
|
|
|
|
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.
|
|
Use the plugin's ftplugin. This gives us the proper comment string.
|
|
Syntax highlighting for DomeKey mapping files.
|
|
Set the correct comment string for make.
|
|
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++.
|
|
The `:TabsGrep` command now takes a glob instead of a regex pattern.
|
|
Provides a `:TabsGrep` command that enables `:tabs` output to be
filtered, making it easier to find out which tab a file is on.
|
|
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.
|
|
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.
|
|
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.
|
|
I used this for testing purposes but it's no longer relevant.
|
|
Add doc comments to these functions.
|
|
If the command was executed as:
:6GitHubFileURL
we previously appended `#L6-L6` to the URL. This change appends only
`#L6` in that case.
|
|
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>`.
|
|
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.
|
|
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.
|
|
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>
|
|
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.
|
|
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.
|
|
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
|
|
Makes it just a bit easier to close the GitBlamer window. Since we
shouldn't need macros in this panel it should be fine.
|
|
Adding `syncbind` appears to fix the bug where in certain cases the
GitBlamer cursor line and the buffer cursor line weren't horizontally
aligned.
|
|
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)
|
|
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.
|
|
I don't really like these any more.
|
|
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).
|
|
Facilitates opening Rails locale files in alternate languages.
|
|
Speed up tests by disabling the test coverage report generator using the
STIF project's custom environment variable flag.
|
|
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.
|
|
Searches the `<cword>` with Ripgrep for more streamlined project
searching.
|
|
Adds two new commands that allow you to move to the beginning and end of
undo history.
|
|
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.
|
|
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.
|
|
Fixes a bug where pressing `gG` without first having used `[count]G` to
store a location caused an error.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
Instead of using Spring for RSpec only on the STIF project, use it for
all af83 projects.
|