aboutsummaryrefslogtreecommitdiff
path: root/vim
Commit message (Collapse)AuthorAgeFilesLines
...
| * Use b:undo variables correctlyTom Ryder2017-11-0713-32/+57
| | | | | | | | | | | | | | | | | | | | | | 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.
| * Update <Leader>b mapping to use new mapping nameTom Ryder2017-11-071-1/+1
| | | | | | | | The name of this mapping was changed in commit 44bd9a8.
| * Add commands to copy_linebreak.vimTom Ryder2017-11-072-1/+20
| | | | | | | | | | | | Just to be thorough; if +user_commands are available, offer :CopyLinebreakEnable, :CopyLinebreakDisable, and :CopyLinebreakToggle commands.
| * Give copy_linebreak.vim enable/disable funcs, mapsTom Ryder2017-11-072-26/+44
| | | | | | | | | | Add s:CopylinebreakDisable() and s:CopylinebreakEnable functions, and mapping targets for each of them, just to be thorough.
| * Add :FixedJoin commandTom Ryder2017-11-072-3/+13
| | | | | | | | | | This is optiona; if the user's Vim doesn't have the 'user_commands' feature, the command will just quietly not be created.
| * Add :StripTrailingWhitespace commandTom Ryder2017-11-072-2/+12
| | | | | | | | | | This is optional; if the user's Vim doesn't have the 'user_commands' feature, the command will just quietly not be created.
* | Bind <Leader>f to show current 'formatoptions'Tom Ryder2017-11-071-0/+5
| | | | | | | | | | | | 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.
* | Add leader bindings for date stampingTom Ryder2017-11-071-0/+9
| | | | | | | | \d adds local time, \D adds UTC time.
* | Add \p Vim binding to show filetypeTom Ryder2017-11-071-0/+5
|/
* Use consistent comment layout for Vim pluginsTom Ryder2017-11-064-9/+11
|
* Simplify 'formatoptions' configTom Ryder2017-11-061-55/+18
| | | | | We'll let toggle_option_flags.vim raise the errors, and we won't bother with the version number testing.
* Refactor toggle_option_flag.vimTom Ryder2017-11-061-23/+58
| | | | | | | | | | 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
* Correct a commentTom Ryder2017-11-061-1/+1
| | | | This likely got butchered by a wayward search-and-replace.
* Use stridx() instead of very-nomagic regex matchTom Ryder2017-11-061-9/+10
| | | | | 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.
* Use strlen() instead of len()Tom Ryder2017-11-061-1/+1
| | | | | | 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.
* Escape option value assign correctlyTom Ryder2017-11-061-1/+1
| | | | This allows e.g.: ':ToggleOptionFlag fillchars diff: '; note the whitespace!
* Extend toggle_option_flag.vim for string flagsTom Ryder2017-11-062-16/+26
| | | | | | | | 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
* Rename l:op to l:operation for clarityTom Ryder2017-11-061-3/+3
| | | | Just to avoid confusing it with something like l:option.
* Separate command building from execution in toggleTom Ryder2017-11-061-3/+7
| | | | | These are functionally equivalent; it's just clearer and more editing-friendly to do one thing at a time.
* Use idiomatic VimL regex for param validationTom Ryder2017-11-061-2/+2
| | | | \a and \L are, I think, perlre-style VimL regex inventions.
* Restore some judicious \m\C hedging in VimTom Ryder2017-11-062-4/+4
| | | | | These are technically not really needed, but this is more consistent with good style recommendations in the Google VimScript style guide.
* Remove redundant has('eval') VimL testTom Ryder2017-11-061-1/+1
| | | | | | | | 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.
* Caution about :execute not eval() in VimL commentsTom Ryder2017-11-062-4/+4
| | | | May as well refer to the actual command I'm using.
* Move pipes from end to start of continued linesTom Ryder2017-11-061-6/+6
| | | | | | | | | | | | | | | | | 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
* Remove \m\C prefix from inapplicable VimL regexesTom Ryder2017-11-061-2/+2
|
* Don't use VimL ==# for number comparisonsTom Ryder2017-11-063-5/+5
| | | | | | | | | | | 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.
* Don't overwrite plugin-specified user commandsTom Ryder2017-11-062-11/+11
| | | | | | | | | | | | | 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.
* Make background detection return not set valueTom Ryder2017-11-062-4/+9
| | | | This approach allows more flexibility from the caller's side.
* Complete ToggleOptionFlag commands with opt namesTom Ryder2017-11-061-2/+2
| | | | | Only a small subset of option names actually apply, so I'm not entirely sure this is actually better than nothing.
* Put missing exclamation mark back into shell checkTom Ryder2017-11-051-1/+1
| | | | Looks like this was mistakenly omitted in commit 09f8635.
* Don't report lines deleted after stripping spaceTom Ryder2017-11-051-1/+1
| | | | | Prepend the line :delete command with a :silent to stop it reporting the number of lines it removed.
* Move 'formatoptions-a' test near applicable blockTom Ryder2017-11-051-6/+6
| | | | Just to keep related things together.
* Precisely define 'formatoptions' 'a' flag presenceTom Ryder2017-11-051-1/+2
| | | | | | | | | | | | | :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
* Restructure 'format' flag logic around vim-tinyTom Ryder2017-11-051-24/+31
| | | | | | 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.
* Map <leader>j to toggle 'fo'-'j' flag in VimTom Ryder2017-11-051-7/+12
| | | | | 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.
* Use :echoerr not :echomsg for 'fo'-'a' absenceTom Ryder2017-11-051-1/+1
| | | | | A bit clearer as the mapping was clearly called in error, and results in not being able to do what was need.
* Use simpler error message for 'fo'-'a' absenceTom Ryder2017-11-051-1/+1
|
* Keep script var cache of 'a' 'fo' flag supportTom Ryder2017-11-051-2/+7
| | | | Use the result to decide how to map <Leader>a.
* Keep script var cache of 'j' 'fo' flag supportTom Ryder2017-11-051-3/+6
| | | | We'll use this in a subsequent commit to decide how to map <Leader>j.
* Lower threshold for 'formatoptions' 'a' flagTom Ryder2017-11-051-3/+3
| | | | I have found it works correctly on an instance of Vim 7.0.
* Block 'formatoptions' 'a' flag on old Vim versionsTom Ryder2017-11-051-6/+20
| | | | | If I ever care, this needs more careful testing to find the version in which the flag was added.
* Add 'abort' attribute to autoload functionTom Ryder2017-11-051-1/+1
| | | | | | | | | `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.
* Actually remove the html5 and targets submodulesTom Ryder2017-11-052-0/+0
| | | | | These were removed from .gitmodules in commits 59baf3a and cddacef respectively, but the directory stub from vim/bundle was not removed.
* Use BufReadPost hook for big_file_options.vimTom Ryder2017-11-051-4/+4
| | | | | | | 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.
* Merge branch 'feature/gvimrc-refa...' into developTom Ryder2017-11-051-5/+10
|\ | | | | | | | | | | * feature/gvimrc-refactor: Set 'guioptions' flag by flag Use variable setting approach for 'guifont'
| * Set 'guioptions' flag by flagTom Ryder2017-11-041-3/+8
| | | | | | | | | | This is a bit easier to read than having the flags meanings in a block comment above the line.
| * Use variable setting approach for 'guifont'Tom Ryder2017-11-041-2/+2
| | | | | | | | A little easier to read.
* | Merge branch 'feature/plugin-shor...' into developTom Ryder2017-11-058-207/+236
|\ \ | | | | | | | | | | | | | | | * feature/plugin-short-circuit: Add short-circuit boilerplate to plugins Simplify shell linting code with single vars
| * | Add short-circuit boilerplate to pluginsTom Ryder2017-11-047-199/+228
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | Simplify shell linting code with single varsTom Ryder2017-11-041-8/+8
| |/ | | | | | | | | Put the entire command line for the determined check and lint into the variable, so it can just be directly executed.