Age | Commit message (Collapse) | Author |
|
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.
|
|
I kept getting E211 errors when switching Git branches with
added/missing files or E321 errors. Normally, I'd get the error once,
dismiss it, and be done with it, but on a new machine with a recent Vim
install, the errors kept coming back up every few seconds,
insupportable.
Unless I can think of something better, take a heavy-handed approach and
disable this on new Vims.
|
|
|
|
I wrote the `s:SaveCommentColor()` function using a lambda for
`filter()`ing. However, not all Vims have `lambda` support. And it
doesn't exist before Vim 7.4 I think. Use this guard to avoid causing
errors on startup for those Vims without lambdas.
|
|
|
|
When diff mode is deactivated, the old values for 'cursorline' and the
Comment highlight colour should be restored.
Thanks to Tony Mechelynck
(http://vim.1045645.n5.nabble.com/template/NamlServlet.jtp?macro=user_nodes&user=28373)
for the tip on how to save and restore highlight colours:
> The following is untested. It requires Vim version 7.
>
> function SaveCursorColor()
> redir => highlight
> silent hi Cursor
> redir END
> if highlight =~ 'links to '
> let s:hl-link = matchstr(highlight, 'links to \zs\S*')
> elseif highlight =~ '\<cleared\>'
> let s:hl-link = 'NONE'
> else
> let s:hl-link = ''
> for substr in ['term', 'cterm', 'ctermfg', 'ctermbg',
> \ 'gui', 'guifg', 'guibg', 'guisp']
> if highlight =~ substr . '='
> let s:hl-{substr} = matchstr(highlight,
> \ substr . '=\S*')
> else
> let s:hl-{substr} = ''
> endif
> endfor
> endif
> endfunction
> function RestoreCursorColor()
> if !exists('s:hl-link')
> echoerr 'Cursor not saved, cannot restore'
> return
> endif
> hi clear Cursor
> if s:hl-link == ''
> exe 'hi Cursor' s:hl-term s:hl-cterm s:hl-ctermfg
> \ s:hl-ctermbg s:hl-gui s:hl-guifg s:hl-guibg
> \ s:hl-guisp
> elseif hl-link != 'NONE'
> exe 'hi link Cursor' s:hl-link
> endif
> endfunction
>
>
> Best regards,
> Tony.
http://vim.1045645.n5.nabble.com/How-to-save-restore-the-hightlight-for-cursor-td1182624.html
|
|
Sometimes the run-on-save functionality doesn't work. This gives me a
quick way to run the formatter when it doesn't happen automatically.
|
|
|
|
The default is 10. Set it to a ridiculously large number so that we can
open one tab per file during a code review.
|
|
Make it faster to compile tests without running them.
|
|
The `Plug` mapping wasn't finding my `main` package from a sub-package.
Change it to force running for the main package in the `pwd` directory.
|
|
Makes the code a little nicer and more extensible without the line
continuations.
Only change the highlight colour for the 'twilight256' colour scheme.
|
|
* Changes `Comment` colour for better readability on red backgrounds.
* Turns of 'cursorline' so that diff background highlighting doesn't
get shadowed.
|
|
To enable `:GoCallers` by telling it to search in the root package.
|
|
Mappings to build projects and run tests.
|
|
So that hidden project files can be opened quickly like the rest.
|
|
For better documentation.
|
|
The Vim-Go plugin uses the location list for certain operations. Add
these shortcuts to make it quicker to navigate.
|
|
'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.
|
|
Now that I'm going to be doing more Go development, switch to the full
featured Vim Go plugin.
|
|
Switching to 'vim-go'.
|
|
For Courier Maildrop `.mailfilter` syntax highlighting. Makes it a bit
more pleasant to edit my new work email filters.
|
|
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
|
|
|
|
Trying out Typescript in a project. Instead of getting a Typescript Vim
plugin, just use the Javascript syntax highlighter for simplicity.
|
|
Includes visual and operator-pending mode mappings.
|
|
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.
|