aboutsummaryrefslogtreecommitdiffstats
path: root/vimrc
AgeCommit message (Collapse)Author
2020-10-27vimrc: Make the `<leader>p` command repeatableTeddy Wing
Allow us to repeat system pasting using `.`.
2020-10-21vimrc: Turn off `g:go_code_completion_enabled`Teddy Wing
I was having trouble with completion and I have a feeling that this setting is confusing things.
2020-10-21vimrc: Make the `gS` command repeatableTeddy Wing
Allow repeating the ArgWrap mapping via 'repeat.vim' to make it even easier to use.
2020-10-13vimrc: Replace `t` cabbrev with `T` command aliasTeddy Wing
Alias `T` to `TComment` instead of using a cabbrev. The abbreviation would mess up commands with "t" in them, like turning `tjump` into `TCommentjump`. Replace the abbreviation with a new `T` command that acts as an alias for `TComment`. I didn't include argument completion because I don't use that. Otherwise, replicate the `TComment` command's definition and pass all parameters to it. This gives us a short alias for commenting, and `T` is the first completion with `:t<Tab>`.
2020-09-28vimrc: Add `<leader>db` mapping to open files with TBuffer using PickTeddy Wing
I've been using my `TBuffer` command recently, but don't like how I have to type out parts of the file name interspersed with "*"s, and press `<Tab>` to ensure I'm getting the right file in case there are multiple matches. Make it easier to use `TBuffer` by allowing fuzzy finding with Pick. This allows us to filter the list of buffers, choosing one to pass to `TBuffer`. Used the buffer list because the function is readily available, and because there's no easy way to get a list of all buffer names in all tabs. I'd probably have to map over `gettabinfo()`, and get the buffer name for each window. Or manually filter the `:tabs` output. Chose `db` because `dt` is taken for opening a file in a new tab, and the word "tab" ends in "b". Now that I think about it, though, this command deals with buffers, so it probably makes more sense to put it under the "b" namespace.
2020-09-22vimrc: Add i_^r^f mapping to insert the current filenameTeddy Wing
Since this removes the path and extension, it makes it easier to use than `<C-r>%` when I want to insert a title or symbol based on the file's name.
2020-09-13vimrc: Set a fixed tall quickfix window height for vim-goTeddy Wing
By default, vim-go sets the quickfix window's height to be the number of quickfix items. This is problematic when, for example, there's a single error item, and the quickfix window opens below a narrow window (for example, in one of three vertical splits). In that case, the error gets line wrapped, and quickfix window is only one line tall, meaning I can't read the full error. Set the window height to Vim's default of 10 lines. Vim-go will collapse the height to 10 lines if the variable is set to a number greater than 10, and 5 lines was too short in practise.
2020-06-20vimrc: Add count support to `[q`, `]q`, `[w`, `]w`Teddy Wing
Allow these next/previous mappings for the quickfix and location list to take counts.
2020-02-26vimrc: Add `<C-w>e` mapping to open the current buffer in a new tabTeddy Wing
2020-02-26vimrc: Add `<leader>cF` mapping to copy the absolute path of a fileTeddy Wing
Analogue to `<leader>cf`, which copies the relative path.
2020-02-26vimrc: Turn off vim-go fmt on saveTeddy Wing
Got to be too annoying.
2020-02-26vimrc: Turn off vim-go ftplugin definition mappingsTeddy Wing
Since I turned `gopls` off, vim-go complains when I try to use a "go to definition" mapping. Turn off vim-go's overrides so I can use ctags, which is much faster than any of the Go tools.
2020-02-26vimrc: Turn off `gopls` in vim-goTeddy Wing
The `gopls` tool is super slow and eats up way too many computing resources.
2019-12-09vimrc: Set 'grepprg' to RipgrepTeddy Wing
Enable project search within Vim using Ripgrep.
2019-11-18vimrc: Add v_<leader>w mapping to search with RipgrepTeddy Wing
We already have an n_<leader>w mapping. This new one gives us the ability to refine the search term to include more than a single word. now we can include multiple words and punctuation in searches.
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-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-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-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-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-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-01vimrc: Add `<leader>tc` mapping to close current tabTeddy Wing
Add a mapping to close tabs with multiple windows more quickly.
2019-05-10vimrc: Include hidden files in the Pick listTeddy Wing
So that hidden project files can be opened quickly like the rest.
2019-05-10vimrc: Use long CLI options to `ag` in `g:pick_command`Teddy Wing
For better documentation.
2019-05-08vimrc: Add next/previous shortcuts for the location listTeddy Wing
The Vim-Go plugin uses the location list for certain operations. Add these shortcuts to make it quicker to navigate.
2019-05-08vimrc: Add basic 'vim-go' settingsTeddy Wing
'vim-go' displays this error message when running older versions of Vim: vim-go requires Vim 7.4.2009 or Neovim 0.3.1, but you're using an older version. Please update your Vim for the best vim-go experience. If you really want to continue you can set this to make the error go away: let g:go_version_warning = 0 Note that some features may error out or behave incorrectly. Please do not report bugs unless you're using Vim 7.4.2009 or newer or Neovim 0.3.1.O If I'm running a version of Vim that would cause the error message to display, I'm probably not editing Go code, so it doesn't matter. In this case, the error message just interferes with normal operations. Use `goimports` instead of `go fmt` for on-save formatting.
2019-05-04vimrc: Have Gundo use Python 3 when Vim is compiled with `+python3`Teddy Wing
After recently installing my vimrc on a newer machine and trying Gundo, I ended up with this error message: Gundo requires Vim to be compiled with Python 2.4+ Fortunately, it also supports Python 3 via a flag. Thanks to Carl Patenaude Poulin (https://bitbucket.org/cpoulin) for this solution: https://bitbucket.org/sjl/gundo.vim/issues/42/about-python3-support#comment-32289592
2019-05-04vimrc: Use `.agignore` in Pick commandTeddy Wing
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-02-10vimrc: Add <leader>w mapping to search with RipgrepTeddy Wing
Searches the `<cword>` with Ripgrep for more streamlined project searching.
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-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-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-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-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-04vimrc: Add <leader>sm mapping to split chained method callsTeddy Wing
A mapping to invoke our new 'whitespace-method-chain' plugin.
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!
2017-04-07vimrc: Make <C-w>q command a no-opTeddy Wing
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.
2017-03-13vimrc: Add `<leader>Z` mapping to run a single RSpec testTeddy Wing
Using `<leader>z` works well, but now I want to be able to run a single test so I can iterate while writing it.
2017-02-21vimrc: Change <leader>tf mapping to <leader>zTeddy Wing
Typing <leader>tf was too many keys. I wanted to shorten the command a bit to make running tests really quick.
2017-02-17vimrc: Add <leader>tf mapping to run current RSpec fileTeddy Wing
Leverage 'vim-rspec' to make it easy for us to run the current spec file.
2016-04-18vimrc: Remove the `Wrap` commandTeddy Wing
I never use this command, so I don't really see a need to keep it in my vimrc. Removing it along with the "Commands" section marker (since that was our only command defined here).
2016-02-15vimrc: Configure SlimvTeddy Wing
* Set a Lisp implementation (SBCL) * Define the SWANK command (copied from Slimv's documentation). The docs provide three different command options, one that creates a new OS X Terminal window using `osascript` (which I didn't really like as it's intrusive), and the other two using `screen` and `tmux`. Opted for the `screen` version.