aboutsummaryrefslogtreecommitdiff
path: root/vim/config/format.vim
Commit message (Collapse)AuthorAgeFilesLines
* Adjust some whitespace and comment layoutTom Ryder2017-11-101-0/+1
|
* Move nrformats.vim content to format.vimTom Ryder2017-11-101-0/+4
|
* 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.
* 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.
* Don't use VimL ==# for number comparisonsTom Ryder2017-11-061-2/+2
| | | | | | | | | | | 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.
* 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.
* Adjust plugin code layout a lotTom Ryder2017-11-041-4/+8
| | | | | | | | | | | | | Including renaming big_file.vim and accompanying functions yet again, to big_file_options.vim. Trying to keep complex autocmd and mapping definitions on long lines broken up semantically; definition and options on one line, patterns or mapping key on the next, and the command to run on the last. Also trying to make sure that <silent>, <buffer>, and <unique> are applied in the correct places, and that all mapping commands are using the :<C-U> idiom for the command prefix.
* Rename toggle plugin again, use commands not funcsTom Ryder2017-11-041-8/+8
| | | | | | This method makes a bit more sense, and amounts to slightly less verbose mapping commands. It does really on the +user_commands feature being available, however.
* Rename and refactor option toggle pluginTom Ryder2017-11-041-8/+8
| | | | | | | | Renamed to flag_toggle.vim and placed in autoload using the namespaced autoload function syntax. I'm not sure this is the right approach yet, but I seem to pretty rarely use a Vim earlier than 7.1 these days.
* Spin 'fo' toggle out into new flag toggler pluginTom Ryder2017-11-041-27/+8
| | | | | | | | | This is an experimental new plugin that provides a command to toggle individual single-character flags in an option with a value of a set of such flags, in my case 'formatoptions'. A fair bit of evil eval()ing via :execute here, but I've tried to control it with some strict patern matching.
* Add some comments to 'formatoptions' switchingTom Ryder2017-10-301-0/+10
| | | | Just for clarity of reading.
* Move execution out of 'formatoptions' conditionalTom Ryder2017-10-301-2/+3
| | | | Just to do one thing at a time.
* Use full `execute` command, not `exec`Tom Ryder2017-10-301-2/+2
| | | | It's probably best not to use abbreviations in scripts.
* Use clearer method for 'formatoptions' flag toggleTom Ryder2017-10-301-2/+5
| | | | | On looking at this again, I was uncomfortable with `eval`ing an operation. This seems a bit less evil.
* Use explicit case-sensitive 'formatoptions' matchTom Ryder2017-10-301-1/+1
| | | | | | | | Per Google's VimScript style recommendations <https://google.github.io/styleguide/vimscriptguide.xml>: > Always use case-explicit operators for strings (=~# and =~?, never > =~).
* Switch on local formatoptions setting, not globalTom Ryder2017-10-301-1/+1
| | | | | The actual option settings performed by the function are local, so the test should be, too.
* Apply name conventions, scoping to Vim identifiersTom Ryder2017-10-301-4/+4
| | | | | | | | | | | | | | | | | | The Google VimScript Style Guide says <https://google.github.io/styleguide/vimscriptguide.xml#Naming>: >In general, use plugin-names-like-this, FunctionNamesLikeThis, >CommandNamesLikeThis, augroup_names_like_this, >variable_names_like_this. Adjusted variable, function, and `augroup` names accordingly, including setting script scope for some of the functions and their calls (`s:` and `<SID>` prefixes). Initially I tried using `prefix#`, but it turns out that this is a namespacing contention for publically callable functions like `pathogen#infect`, and none of these functions need to be publically callable.
* Use ==# consistently in Vim configTom Ryder2017-10-301-1/+1
| | | | | | | | | | | | I got a set of warnings from vim-vint about using just "==" for these comparisons: >Use robust operators `==#` or `==?` instead of `==` (see Google >VimScript Style Guide (Matching)) It does seem a lot more sensible to be explicit about case sensitivity, and not to lean on the configured 'ignorecase' value, especially if the user changes it.
* Move format .vimrc config into subfileTom Ryder2017-10-281-0/+31
The ToggleFormatFlag function might actually be better implemented as some sort of plugin.