Age | Commit message (Collapse) | Author |
|
This includes a change that allows `gopls` to be disabled:
https://github.com/fatih/vim-go/commit/e3a0e1ead2c14aa27d1d34950c0c43a7b296e368
|
|
|
|
A command that opens the Jira ticket ID cWORD in the browser.
|
|
|
|
* Move functions into autoload
* Remove unused `s:Activate()` and `s:Deactivate()`. These were
development ideas.
* Add a load guard
|
|
A mapping that toggles <Space> to insert '\ ', automatically escaping
spaces when entering file names (such as when creating files with spaces
in their names).
Working, but I now need to clean up the code.
|
|
After trying a few different approaches, finally settled on a mapping
implementation for `c#` that seems to work both at the start and in the
middle of a word.
Previously, as the TODO on line 1 indicates, if the cursor was on the
start of the word, we'd move to the previous match using `c#`. However,
if the cursor was in the middle of the word, `c#` would move to the
start of the word, when it should instead move to the previous match.
First tried to solve the movement problem using `search()`. Managed to
find a formula that did what I wanted, but search highlighting isn't
applied when searching within functions. This function (in particular
the 'z' flag) allows us to move to the previous match even when starting
in the middle of the word:
call search('\C' . expand('<cword>'), 'bz')<CR>
I then tried an <expr> mapping against a function that would call:
call search('\<', 'bc')
first to move to the start of the word (even when already on the start
of the word), then return the `?...` command to run the search for the
previous match. This, however, didn't work because the above mentioned
`search()` call wasn't part of the <expr> mapping, and it's likely the
search was undone, similar to what I encountered next.
I then tried to run an `execute 'normal! ?...'` command to run the
search, preceded still by the aforementioned `search()` call to move to
the beginning of the word. This did not work because it turns out that
searches in a function are undone when that function returns:
:h function-search-undo
This behaviour is also the likely reason why my `search()` + <expr>
function didn't work.
Finally, tried an <expr> mapping containing both the `search()` call to
move to the beginning of the word and the `?...` command to search for
the previous match (all returned in the <expr> string). Once I got the
syntax right, this seems to do exactly what I want.
Left the in-between code states for reference. I'll be cleaning those up
later.
|
|
The printed commands were distracting.
|
|
Enable project search within Vim using Ripgrep.
|
|
Mappings for case sensitive versions # and *. Not completely figured out
yet.
|
|
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.
|
|
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.
|
|
Recent Vims have a built-in JSON syntax plugin which is a little easier
to read than the JavaScript highlighting. Use the built-in one on Vim 8
and higher.
|
|
Add a shortcut to quickly insert the UFO ticket folder path at the
command line to save me the trouble of having to type & complete it
manually.
|
|
Add bindings to insert `debugger` statements in JavaScript.
|
|
Omaps for `[[` and `]]` commit motion commands.
|
|
An ftplugin that provides `[[` and `]]` mappings to move between commits
in `git log` output.
|
|
Now that I effectively removed the `checktime` augroup in
cc86bdf4af5212a3b2a7960e65c402eac71091c1, this is no longer necessary.
Also, it errors because `checktime` no longer exists.
|
|
|
|
|
|
Mappings for JavaScript files that add and remove the
`no-debugger: warn` rule to `.eslintrc`.
|
|
Use `s` to wrap text in a GitHub suggestion.
Before:
Text
After:
``` suggestion
Text
```
|
|
This mapping conflicted with the `<leader>cf` mapping in my `vimrc` that
copies the current filename/relative path to the clipboard.
|
|
If the `:pwd` was a subdirectory of the repository root, the path in the
constructed GitHub URL would not include any subdirectories up to and
including the current working directory. This created an incorrect path
in the URL, resulting in a 404.
|
|
Automatically insert the comment leader to facilitate JSDoc comments.
|
|
This seemed to cause files I opened with Netrw to have `set nowrap`,
overriding the `set wrap` I have in my vimrc.
|
|
Disable 'better autoread' for PULLREQ_EDITMSG files. GitHub's `hub` CLI
may be doing some polling on the file or something because I keep
getting prompts to "Load file" after a while when writing pull request
descriptions.
|
|
|
|
Mappings to modify the client build cache without leaving Vim. Use
`:silent` combined with `<C-l>` to avoid the hit-enter prompt.
|
|
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.
|
|
* Set 'commentstring'
* Fix comment wrapping by adding `--` to 'comments'. Otherwise no
leading comment markers would be inserted when text wrapped to the
next line.
|
|
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.
|
|
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.
|
|
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.
|
|
Otherwise the function call appears in the command line which is
distracting.
|
|
Make the commit title length 72 characters plus the length of the ID
followed by a colon and space.
|
|
Since AODocs commit message style prefers putting Jira IDs at the very
start of commit messages, give myself more room in the title.
Personally I think references should be at the end of a commit message,
so I'm going to take back the extra characters.
TODO: Dynamically calculate the issue ID length and adjust the textwidth
to 72 + that value.
|
|
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.
|
|
Thanks to Christian Brabandt
(https://vi.stackexchange.com/users/71/christian-brabandt) for
describing better autocmds for detecting diff mode:
https://vi.stackexchange.com/questions/12847/automatically-disable-cursorline-when-in-diff-mode/12852#12852
And for making the patch
(https://github.com/vim/vim/commit/04f62f881c5743d2fdaf7324f6a715381f0d5fcf)
that allows diff mode to be detected with the OptionSet event.
|
|
This formats numbered lists so that they wrap to the beginning of the
text, instead of being flush with the number.
Before:
1. A list that goes beyond the text width and
wraps to the number.
After:
1. A list that goes beyond the text width and
wraps to the text.
Thanks to this blog post from Edward Yang for prompting me to read the
|fo-table| help again more closely:
http://blog.ezyang.com/2010/03/vim-textwidth/
|
|
Plugin that opens a window containing the text formatting guide for
Jira.
The guide is taken from:
$ w3m -dump 'https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=all'
Since I'm using the go-jira CLI, I need the reference for any special
formatting I want to use. I figured it would help to have that
information right next to my Vim buffer instead of having to switch to a
browser and open the web page.
|
|
Soft wrap in diffs. Recently encountered diffs with super long lines and
thought it would be nice to be able to see everything on one page
without having to scroll horizontally.
|
|
Add a mapping to quickly close a tab. Makes it easier to close files
that I've finished reviewing.
Thanks to user9433424
(https://vi.stackexchange.com/users/6960/user9433424) on the Vi Stack
Exchange for the very detailed explanation of how to restore a mapping:
https://vi.stackexchange.com/questions/7734/how-to-save-and-restore-a-mapping/7735#7735
Using user9433424's mapping restore code, and ignoring the case where a
mapping is defined both globally and local to a buffer.
|
|
Match Gundo's behaviour.
|
|
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.
|
|
|
|
Copy one of the Git file detectors from
`/usr/local/share/vim/vim74/filetype.vim`. This gives me `gitcommit`
filetype features for merge and tag messages even when using a Vim older
than 7.4 (Vim 7.3, the default on many Macs, only sets COMMIT_EDITMSG to
the `gitcommit` filetype).
Additionally, set `gitcommit` on `PULLREQ_EDITMSG` files. This gives me
the same features for pull request messages using GitHub's `hub` command
line tool (in particular spell checking).
|
|
On a couple of occasions I've thought it would be useful to have this,
so let's activate it.
|
|
Don't preserve indentation on empty lines in JavaScript files.
|
|
Add a mapping to close tabs with multiple windows more quickly.
|