| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Setting or adding to b:undo_indent and b:undo_ftplugin variables, which
I only learned about just now, allows me to avoid the _GLOBAL.vim hack
and remove some files from both vim/indent/ and vim/ftplugin/.
These variables aren't subjected to :execute automatically in anything
older than Vim 7.0, but I don't think that's too much of a concern as
the only real reason they're needed are for changing filetypes in the
same buffer, which doesn't happen that often anyway.
|
| |
| |
| |
| | |
The name of this mapping was changed in commit 44bd9a8.
|
| |
| |
| |
| |
| |
| | |
Just to be thorough; if +user_commands are available, offer
:CopyLinebreakEnable, :CopyLinebreakDisable, and :CopyLinebreakToggle
commands.
|
| |
| |
| |
| |
| | |
Add s:CopylinebreakDisable() and s:CopylinebreakEnable functions, and
mapping targets for each of them, just to be thorough.
|
| |
| |
| |
| |
| | |
This is optiona; if the user's Vim doesn't have the 'user_commands'
feature, the command will just quietly not be created.
|
| |
| |
| |
| |
| | |
This is optional; if the user's Vim doesn't have the 'user_commands'
feature, the command will just quietly not be created.
|
| |
| |
| |
| |
| |
| | |
I think this option has become overloaded in recent versions and that
these would make more sense and be more manageable as separate but
interacting options.
|
| |
| |
| |
| | |
\d adds local time, \D adds UTC time.
|
|/ |
|
| |
|
|
|
|
|
| |
We'll let toggle_option_flags.vim raise the errors, and we won't bother
with the version number testing.
|
|
|
|
|
|
|
|
|
|
| |
Got carried away and rewrote a lot of this all in one hit.
* Show single-line error messages with an s:Error() function
* Flag early errors on nonexistent options
* Test for the flag both before and after trying to toggle it to use as
the basis for error reporting and return value, in a new s:Has()
function
|
|
|
|
| |
This likely got butchered by a wayward search-and-replace.
|
|
|
|
|
| |
I couldn't find this function at first, but it's what I need: a way to
check whether a string appears in another one.
|
|
|
|
|
|
| |
strlen() is older, and also more specific to what we want to do. len()
just happens to work on strings, but was introduced for counting Lists
and Dictionaries.
|
|
|
|
| |
This allows e.g.: ':ToggleOptionFlag fillchars diff: '; note the whitespace!
|
|
|
|
|
|
|
|
| |
This commit extends toggle_option_flag.vim to allow the exported
commands to toggle values of more than one character, for
comma-separated options like 'switchbuf', e.g.:
:ToggleOptionFlag switchbuf useopen
|
|
|
|
| |
Just to avoid confusing it with something like l:option.
|
|
|
|
|
| |
These are functionally equivalent; it's just clearer and more
editing-friendly to do one thing at a time.
|
|
|
|
| |
\a and \L are, I think, perlre-style VimL regex inventions.
|
|
|
|
|
| |
These are technically not really needed, but this is more consistent
with good style recommendations in the Google VimScript style guide.
|
|
|
|
|
|
|
|
| |
From what I understand from ":help if", ancient Vim and/or vim-tiny
without the 'eval' feature will simply gloss over all commands between
:if and :endif without executing them. Therefore as soon as we test a
version, we're implicitly excluding everything that doesn't have 'eval'
anyway.
|
|
|
|
| |
May as well refer to the actual command I'm using.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Google Vimscript Guide says:
<https://google.github.io/styleguide/vimscriptfull.xml#Whitespace>
> Place one space after the backslash denoting a line continuation.
>
> When continuing a multi-line command a pipe can be substituted for
> this space as necessary, as follows:
>
> autocommand BufEnter <buffer>
> \ if !empty(s:var)
> \| call some#function()
> \|else
> \| call some#function(s:var)
> \|endif
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The Google VimScript Guide says:
<https://google.github.io/styleguide/vimscriptfull.xml#Portability>
> Always use case-explicit operators for strings (=~# and =~?, never =~).
>
> This also applies to !~ == != > >= < and <=
> This only applies for strings. == and >= are fine for numbers, but ==#
> and >=# must be used for strings.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Google Vimscript Style Guide says:
<https://google.github.io/styleguide/vimscriptguide.xml#Commands>
> Excluding [!] prevents your plugin from silently clobbering existing
> commands. Command conflicts should be resolved by the user.
This makes sense to me as we can think of <Plug> mapping and user
commands as being the user-accessible portion of the interface, rather
than the functions which can be properly namespaced with
autoload#Syntax(), if exposed at all.
|
|
|
|
| |
This approach allows more flexibility from the caller's side.
|
|
|
|
|
| |
Only a small subset of option names actually apply, so I'm not entirely
sure this is actually better than nothing.
|
|
|
|
| |
Looks like this was mistakenly omitted in commit 09f8635.
|
|
|
|
|
| |
Prepend the line :delete command with a :silent to stop it reporting the
number of lines it removed.
|
|
|
|
| |
Just to keep related things together.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
:help version6.txt, /^Patch 6\.1\.142:
> Patch 6.1.142
> Problem: Defining paragraphs without a separating blank line isn't
> possible. Paragraphs can't be formatted automatically.
> Solution: Allow defining paragraphs with lines that end in white
> space. Added the 'w' and 'a' flags in 'formatoptions'.
> Files: runtime/doc/change.txt, src/edit.c, src/misc1.c,
> src/normal.c, src/option.h, src/ops.c, src/proto/edit.pro,
> src/proto/ops.pro, src/vim.h
|
|
|
|
|
|
| |
Put in appropriate 'eval' checks and adjust the order of evaluation so
that vim-tiny doesn't try to run all this and fail due to the absence of
'eval' for :let.
|
|
|
|
|
| |
This is implemented in the same way as done for 'fo'-'a'; testing for
the presence of the flag based on known version tests first.
|
|
|
|
|
| |
A bit clearer as the mapping was clearly called in error, and results in
not being able to do what was need.
|
| |
|
|
|
|
| |
Use the result to decide how to map <Leader>a.
|
|
|
|
| |
We'll use this in a subsequent commit to decide how to map <Leader>j.
|
|
|
|
| |
I have found it works correctly on an instance of Vim 7.0.
|
|
|
|
|
| |
If I ever care, this needs more careful testing to find the version in
which the flag was added.
|
|
|
|
|
|
|
|
|
| |
`vint -s` says:
> vim/autoload/detect_background.vim:16:1: Use the abort attribute for
> functions in autoload (see Google VimScript Style Guide (Functions))
All right, then. Doesn't seem to break vim.tiny or Vim 6.1.
|
|
|
|
|
| |
These were removed from .gitmodules in commits 59baf3a and cddacef
respectively, but the directory stub from vim/bundle was not removed.
|
|
|
|
|
|
|
| |
Using BufReadPre meant that it was too early to set the 'syntax' option
locally for the buffer. This fixes that, and also works correctly for
cases where the buffer does not necessarily correspond to a file on
disk.
|
|\
| |
| |
| |
| |
| | |
* feature/gvimrc-refactor:
Set 'guioptions' flag by flag
Use variable setting approach for 'guifont'
|
| |
| |
| |
| |
| | |
This is a bit easier to read than having the flags meanings in a block
comment above the line.
|
| |
| |
| |
| | |
A little easier to read.
|
|\ \
| | |
| | |
| | |
| | |
| | | |
* feature/plugin-short-circuit:
Add short-circuit boilerplate to plugins
Simplify shell linting code with single vars
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Set a g:loaded_* flag to prevent repeated reloads, and refuse to load at
all if &compatible is set or if required features are missing.
Some more accommodating plugins avoid the problems 'compatible' causes
by saving its value at startup into a script variable, setting the
option to the Vim default, and then restoring it when the plugin is
done, to prevent any of its flags from interfering in the plugin code:
let s:save_cpo = &cpo
set cpo&vim
...
let &cpo = s:save_cpo
unlet s:save_cpo
I don't want this boilerplate, so I'm going to do what Tim Pope's
modules seem to, and just have the plugin refuse to do a single thing if
'compatible' is set.
|
| |/
| |
| |
| |
| | |
Put the entire command line for the determined check and lint into the
variable, so it can just be directly executed.
|