Age | Commit message (Collapse) | Author |
|
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.
|
|
Doesn't clobber saved location when using `G` without a count.
|
|
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.
|
|
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.
|
|
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.
|
|
A mapping to invoke our new 'whitespace-method-chain' plugin.
|
|
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.
|
|
Don't force the function to load on startup.
|
|
Give the plugin a clearer name.
|
|
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
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
Get rid of this freaking good-for-nothing command that keeps g'all dang
messing me the frak up and closing my windows!
|
|
When hitting <C-w> to initiate a window command, I kept accidentally
hitting <C-w>q and quitting the window I was in. This was extremely
aggravating, because (1) it would be surprising and confusing for a
couple seconds, and (2) I'd have to stop what I was doing and get my
workspace back to what it was before.
I was accidentally hitting it because the 'w' and 'q' keys are so close
together.
The only difference I can see between <C-w>q and <C-w>c is that the 'q'
version will quit Vim if the current window is the last one. I don't see
myself needing that functionality with 'ZQ' readily available. Since
closing a window is a destructive operation, I prefer it being farther
away on the keyboard (even though 'c' is right next to 'v' and that
confusion has messed me up sometimes).
All that said, get rid of this command that has a more useful
equivalent, that I don't see myself using, and that has messed me up at
least three times already.
|
|
Was getting annoyed at having to manually split function arguments from
a single line to multiple lines. Planned on writing a little custom
plugin to do this, but this one seems more well thought out and
featureful than what I was thinking of. It also seems lighter and not as
presumptive as another alternative I found:
https://github.com/AndrewRadev/splitjoin.vim
|
|
Finally getting annoyed enough about not being able to '.'-repeat
surround.vim commands. It's really nice to have repeating just work now.
|
|
Using `<leader>z` works well, but now I want to be able to run a single
test so I can iterate while writing it.
|
|
Create a new project-specific config for AF83. Add a project-specific
mapping to save the current Vim session to a file called 'vimsession'.
|
|
Make it easier to insert `byebug` debug statements. Currently working in
Rails so assuming `byebug` is already required. Might want to add new
maps or modify these later if I end up needing to do a `require
'byebug'` beforehand.
These keys didn't seem to be used for anything, so I figured they would
be a nice quick combination for this. Didn't really feel like adding a
long leader command to do it.
|
|
When writing bulleted lists, don't start wrapped lines with '*'. Just
wrote a mail message an noticed this was a problem. Copied my
gitcommit.vim config to resolve this.
|
|
Blech, CoffeeScript! Having to read & write some recently, so add
support for it.
|
|
Load *.jbuilder files as Ruby so that they can be edited like Ruby files
and have Ruby syntax colours.
|
|
A plugin that will insert a given month from the `cal` program and
format it such that I can insert `*`s next to days to flag them.
I've been doing this manually for years and it finally seemed time to
automate the process.
|
|
My tastes have changed over time. These days I normally prefer to remove
indentation on empty lines, and this is my general default working on
codebases with other people. Change our Ruby config to remove
indentation on empty lines so I don't have to keep doing it myself
manually.
|
|
Typing <leader>tf was too many keys. I wanted to shorten the command a
bit to make running tests really quick.
|
|
Leverage 'vim-rspec' to make it easy for us to run the current spec
file.
|
|
Make it more efficient to run RSpec tests right in Vim. It's been nearly
4 weeks since I started writing Rails code full time and I'd like to see
if I can have a nicer system for running only the tests I'm interested
in or working on at the moment.
|
|
It's been a few years and it turns out there's some cool new stuff in
Surround, like support for arbitrary characters and other goodies.
|
|
I want the HTML matchit command to be available in *.html.erb files.
Normally, these files get loaded as `filetype=eruby`.
The trouble with that is that not all eruby is HTML, so I can't load the
matcher in the 'eruby' filetype because it might not make sense.
Create a new special filetype for *.html.erb files that uses the normal
eruby syntax, but includes the HTML matchit command.
|
|
Don't use a cursorline in TODO files because in my colour scheme it
makes the text of normal priority to-dos unreadable as it overrides the
line background so you end up with dark text on a dark background.
|
|
Override the `g:netrw_bufsettings` variable to make Netrw always open
with line numbers. This should make it easier to navigate to a specific
file in the tree.
Copied the settings from the original value and changed `nonu` to `nu`.
Following this Stack Overflow answer from Benoit to get this working:
http://stackoverflow.com/questions/8730702/how-do-i-configure-vimrc-so-that-line-numbers-display-in-netrw-in-vim/8731175#8731175
|
|
Special overrides for *.todo files. Here we unlet `b:did_ftplugin` to
allow the plugin's ftplugin to execute. Normally, we override
`b:did_ftplugin` to disable filetype functionality. In this case,
though, we do want the ftplugin code that comes with vim-twodo to be
loaded and useable.
We also set a custom colour for regular todos that fits with our default
twilight256 colour scheme.
|
|
This plugin has been sitting uncommitted in my .vim for many months now.
I originally hadn't added it to the repo because it wasn't published.
Now that it is, I can use the plugin's public Git link.
Helps me keep track of my to-dos.
|
|
Based on my current Vim settings, splits open to the right (I have
`splitright` turned on).
This causes the blame window to open to the right of the file in
question, which is weird, since normally that metadata appears to the
left of the file.
Open the Blamer split on the left by default to make the formatting more
consistent with the normal `git blame` output.
|
|
A new plugin that cycles through a list of languages to use when spell
checking. Using a couple of mappings, we can quickly change the
`spelllang` to the language we want to write or read in.
Languages are currently set to English and French, since those are the
two that I use. The mappings are bound to `[l` and `]l` (in
unimpaired.vim style) since those didn't seem to be used by anything.
|