aboutsummaryrefslogtreecommitdiff
path: root/vim/config
Commit message (Collapse)AuthorAgeFilesLines
...
* | Add \p Vim binding to show filetypeTom Ryder2017-11-071-0/+5
|/
* 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.
* 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-061-1/+1
| | | | May as well refer to the actual command I'm using.
* 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.
* Make background detection return not set valueTom Ryder2017-11-061-2/+4
| | | | This approach allows more flexibility from the caller's side.
* 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.
* Limit search highlighting hooks to Vim >= 7.1Tom Ryder2017-11-051-1/+1
| | | | 'InsertEnter' and 'InsertLeave' are not autocmd events in Vim 6.1.
* Add explanatory note for choosing imperfect remapTom Ryder2017-11-051-1/+4
| | | | | | 'vnoremap' also includes select mode, which I very seldom use anyway; in this context it's not worth breaking compatibility with old Vims to use the more accurate 'xnoremap'.
* Adjust plugin code layout a lotTom Ryder2017-11-0412-24/+58
| | | | | | | | | | | | | 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.
* Merge branch 'feature/spin-vim-plug' into developTom Ryder2017-11-046-180/+21
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * feature/spin-vim-plug: Rename toggle plugin again, use commands not funcs Add short documentation for new custom plugins Use same comment boilerplate for custom plugins Check 'eval' feature for loading command_typos.vim Wrap detect_background.vim func call in 'silent!' Rename and refactor option toggle plugin Don't suggest mappings in Vim plugin comments Move Vim background detection logic into plugin Specify an install-vim-autoload target Spin 'fo' toggle out into new flag toggler plugin Spin copyable linebreak config into new plugin Spin stable join config out into new plugin Use <Plug> prefix, make space strip configurable Rename a misnamed variable in big_file.vim Rename bigfile plugin to big_file Move trailing space strip config into plugin Separate command typos config to plugin
| * 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.
| * Wrap detect_background.vim func call in 'silent!'Tom Ryder2017-11-041-1/+1
| | | | | | | | | | | | This prevents older versions of Vim like 6.2 from throwing "E1017: Missing braces" on merely parsing this code, even though they don't evaluate it.
| * 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.
| * Move Vim background detection logic into pluginTom Ryder2017-11-041-25/+2
| |
| * 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.
| * Spin copyable linebreak config into new pluginTom Ryder2017-11-041-34/+4
| | | | | | | | | | Calling this one copy_linebreak.vim. Renamed both the internal function and the plugin key.
| * Spin stable join config out into new pluginTom Ryder2017-11-041-21/+4
| | | | | | | | | | Again using the <Plug> mapping abstraction and not defining the mapping for the user.
| * Use <Plug> prefix, make space strip configurableTom Ryder2017-11-041-0/+2
| | | | | | | | | | | | This properly abstracts out the StripTrailingWhitespace mapping rather than forcing it to <leader>x within the plugin itself. A bit nicer this way.
| * Move trailing space strip config into pluginTom Ryder2017-11-031-57/+0
| |
| * Separate command typos config to pluginTom Ryder2017-11-031-15/+0
| | | | | | | | | | Tentatively named command_typos.vim. I've just moved this as-is for now, but it will need review, especially the hardcoded mappings.
* | Check for 'eval' feature before mapleader :letTom Ryder2017-11-041-2/+4
| | | | | | | | | | This was causing a tiny build of Vim to raise errors about :let being an unavailable command.
* | Specify scope of mapleader variablesTom Ryder2017-11-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | `vint -s` says: vim/config/leader.vim:2:5: Make the scope explicit like `g:mapleader` (see Anti-pattern of vimrc (Scope of identifier)) vim/config/leader.vim:3:5: Make the scope explicit like `g:maplocalleader` (see Anti-pattern of vimrc (Scope of identifier)) This does still seem to work with the prefixes, despite not being the way the documentation specifies the variables.
* | Use underscore as local map leaderTom Ryder2017-11-041-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This should allow me to mentally separate actions specific to a buffer type from actions that apply to buffers in general. It also removes the overlap of <leader>l for 'list' toggling and filetype linting. From ":help maplocalleader": > <LocalLeader> is just like <Leader>, except that it uses > "maplocalleader" instead of "mapleader". <LocalLeader> is to be used > for mappings which are local to a buffer. Example: > > :map <buffer> <LocalLeader>A oanother line<Esc> > > In a global plugin <Leader> should be used and in a filetype plugin > <LocalLeader>. "mapleader" and "maplocalleader" can be equal. > Although, if you make them different, there is a smaller chance of > mappings from global plugins to clash with mappings for filetype > plugins. For example, you could keep "mapleader" at the default > backslash, and set "maplocalleader" to an underscore.
* | Use <Leader>/<LocalLeader> correctly in Vim configTom Ryder2017-11-037-13/+13
| | | | | | | | | | | | | | From ":help <LocalLeader>": > In a global plugin <Leader> should be used and in a filetype plugin > <LocalLeader>. "mapleader" and "maplocalleader" can be equal.
* | Merge branch 'hotfix/v0.4.2' into developTom Ryder2017-11-031-8/+13
|\ \ | | | | | | | | | | | | | | | * hotfix/v0.4.2: Require eval feature for netrw opts assignment Bump version number to 0.4.2
| * | Require eval feature for netrw opts assignmentTom Ryder2017-11-031-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tiny builds of Vim that exclude the eval feature throw errors at the :let commands in this file: $ vim.tiny Error detected while processing /home/tom/.vim/config/netrw.vim: line 2: E319: Sorry, the command is not available in this version: let g:netrw_banner = 0 line 5: E319: Sorry, the command is not available in this version: let g:netrw_silent = 1 line 8: E319: Sorry, the command is not available in this version: let g:netrw_liststyle = 3 line 11: E319: Sorry, the command is not available in this version: let g:netrw_list_hide = '^\.$,^tags$' Press ENTER or type command to continue This code was not being run on such builds before commit 538b71c, because it was in an "after" directory for the netrw plugin and would have been skipped. Wrapping a check for has('eval') around this whole file fixes the problem. netrw.vim won't run without this feature anyway.
* | | Merge branch 'hotfix/v0.4.1' into developTom Ryder2017-11-031-2/+2
|\| | | |/ |/| | | | | | | * hotfix/v0.4.1: Don't show search option state on mode changes Bump version number to 0.4.1
| * Don't show search option state on mode changesTom Ryder2017-11-031-2/+2
| | | | | | | | | | | | | | Commit 92f2c78 added these suffixes to the option settings to show the value of the option after it had been set, but this isn't actually appropriate for the autocmd here; it means the value of 'hlsearch' is echoed every time insert mode is entered or left.
* | Move misplaced command.vim fileTom Ryder2017-11-031-1/+3
|/ | | | | Looks like this was added in a1ee04d for v0.4.0 and was intended to replace the file in its correct path at vim/config/comment.vim.
* Merge branch 'feature/vim-plugin' into developTom Ryder2017-11-021-28/+0
|\ | | | | | | | | | | | | | | | | | | | | * feature/vim-plugin: Have bigfileturn local syntax off (configurably) Make bigfile 'synmaxcol' setting configurable Refactor plugin function for dependency injection Rename variable and autocmd to use plugin prefix Make bigfile size variable an option with default Expand comment header for bigfile.vim Move Vim big file options config into plugin
| * Move Vim big file options config into pluginTom Ryder2017-11-021-28/+0
| | | | | | | | | | | | | | | | | | | | | | Created targets install-vim-doc and install-vim-plugin with accompanying subdirectories of "vim". Added a very short summary of what the plugin does to bigfile.txt. I intend to spin off at least a couple of the blocks of my Vim configuration that are starting to coalesce into distinct plugins unto themselves, and will place the files in these directories.
* | Move 'tildeop' setting to new case.vim fileTom Ryder2017-11-011-0/+0
| | | | | | | | | | Since it pertains to the casing of text, and there are potentially other items that could go in here too.
* | Move 'shellpipe' setting to more logical locationTom Ryder2017-11-012-3/+3
|/ | | | | | It makes more sense next to 'shellslash' in vim/config/command.vim than it does in vim/config/term.vim; the latter file is supposed to describe settings related to the terminal, not the shell.
* Complete a partially-written commentTom Ryder2017-10-311-1/+1
| | | | This was added in 52671ad, but not finished.
* Show Vim option values after leader-key toggleTom Ryder2017-10-305-13/+12
| | | | | | | | | | | | Using the very weird syntax: :setlocal option! option? We can toggle the option and print its new value in the same line. For the line breaking options, we only show the value of the 'linebreak' option, because otherwise we print three lines of messages, which requires an <Enter> press, even if we put all three `option?` calls on one :setlocal line.
* Toggle Vim 'hlsearch' and 'incsearch' locallyTom Ryder2017-10-301-4/+4
| | | | | | | | That is, \h and \i shouldn't change the value of the search highlighting or incremental search features globally, just per-buffer. I'm not actually completely sure I want this, but it does seem tidier at the moment.
* Note that StripTrailingWhitespace() does whole docTom Ryder2017-10-301-1/+1
| | | | | Just in case somebody tried to use it to strip whitespace only from a selected range. It could maybe be extended to do this somehow.
* Move 'joinspaces' Vim config to join subfileTom Ryder2017-10-302-4/+3
| | | | | It makes much more sense in this file than it did in the whitespace configuration file.
* Reimplement stable normal-mode J join mappingTom Ryder2017-10-301-4/+24
| | | | | | | | | | | | | This is a tidier method of preserving the cursor position after a normal-mode join that doesn't involve wiping away a mark, though I don't use those too often anyway. It still works with a preceding count via the `v:count1` variable, with an accidental feature: this joins the *next* v:count1 lines, as opposed to joining a *total* of v:count1 lines counting the current one. The latter is what Vim does, but the former is what I'd actually expect, thinking of it as a "repeated operation", so I'm going to leave it this way.
* Add some comments to 'formatoptions' switchingTom Ryder2017-10-301-0/+10
| | | | Just for clarity of reading.