aboutsummaryrefslogtreecommitdiffstats
path: root/vimrc
AgeCommit message (Collapse)Author
2024-04-05vimrc: Add `[b` and `]b` buffer cycling mappingsHEADmasterTeddy Wing
I've had these on `<leader>k` and `<leader>j` since the early days, but those mappings no longer feel logical to me. It seems that `[b` and `]b` are unbound, so I decided to bind these to buffer switching, for the rare times when I need it. Eventually I'll probably remove one or the other set depending on what I end up sticking with.
2023-09-25vimrc: Only turn on 'smoothscroll' if it's availableTeddy Wing
Keep supporting older versions of Vim.
2023-09-25vimrc: Turn on 'smoothscroll'Teddy Wing
I learned about this recently. According to https://vi.stackexchange.com/questions/11315/visual-scrolling-visual-c-e-and-c-y-across-wrapped-lines/42278#42278 it was added in Vim 9.0.0640. This allows scrolling within a soft-wrapped line, useful for writing prose, and very useful for reading files consisting of a single line, like a big JSON file or minified HTML.
2022-08-24vimrc: Turn off Vim-Go goimports on saveTeddy Wing
The new version of Vim-Go that I upgraded to added a new auto-format on save hook that runs goimports. Turn if off like we did with its automatic gofmt.
2022-08-20vimrc: Add `:Co` command, alias for `:Copy`Teddy Wing
I use this command frequently, and `:Copy` used to tab-complete first with `:Co<Tab>`, but since I installed the Context.vim plugin, the latter takes completion precedence. Add this alias to give `:Copy` the highest precedence.
2022-06-28vimrc: Add `m,` mapping to save sessionTeddy Wing
I've been testing this binding as a candidate for a potential replacement of my existing `<leader>mk` mapping. It's easier on the hands than the existing one. Since `,` doesn't seem to be a valid mark location, and it's right next to the "m" key on a Qwerty keyboard, this seemed like an ideal combination of keys for a relatively frequent action.
2022-06-01vimrc: Disable context.vim by defaultTeddy Wing
Enable it by default in AODocs paths.
2022-06-01vimrc: Add `yp` mapping to paste from the "0 registerTeddy Wing
Makes it easier to search and replace with `n` and visual selection. Though perhaps `gn` would solve this? Though not in cases where I need to replace something that's different from the search pattern.
2022-05-26vimrc: Remove Slimv settingsTeddy Wing
I removed the Slimv plugin in b0f617dcc33b2207dfb87b899a655f62ecad53ca. We no longer need these settings.
2022-05-26vimrc: Don't let Paredit change filetype plugin and indent settingsTeddy Wing
Paredit turns filetype indent on globally, messing up all files, not just Lisp files. Prevent Paredit from changing these settings. I don't think we really need Paredit's filetype indent as that's already handled by Vlime.
2021-09-21vimrc: Add `<C-w>N` to open a new empty buffer in a vertical splitTeddy Wing
Like `<C-w>n` except that instead of opening a new buffer in a horizontal split, it opens a vertical one. This can be preferred depending on the existing window layout.
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.