aboutsummaryrefslogtreecommitdiff
path: root/vim
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Add lint mapping for VimscriptTom Ryder2017-11-041-0/+5
| | | | Runs `vint -s`; the -s includes stylistic suggestions.
* 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.
* Add check and lint mappings for shell scriptTom Ryder2017-11-041-0/+22
| | | | | The commands to use in this case are dependent on the particular shell being used.
* Add tidy mapping for HTMLTom Ryder2017-11-041-0/+4
| | | | | | | | | | | This mapping mirrors the one for Perl that passes the content of the buffer through a program to tidy it (i.e. not merely check but actively change it). The tidy(1) option chosen here, -quiet, is the bare minimum to make this invocation useful. We would never want the boilerplate it otherwise emits to be in the buffer after a call. Everything else should be applied in a configuration file, which I'll do in a separate feature.
* Break long lines in check/lint/tidy mappingsTom Ryder2017-11-042-5/+12
|
* Make all lint/check/tidy maps local and silentTom Ryder2017-11-042-5/+5
| | | | | | That is, apply <buffer> and <silent> to each of them, to make them only apply to the current buffer and to prevent them from echoing the command they're running.
* Improve comments on check/lint/tidy mapsTom Ryder2017-11-032-4/+4
|
* Use long form options for tidy(1) Vim callTom Ryder2017-11-031-2/+2
|
* Use direct :write !cmd instead of shellescape()Tom Ryder2017-11-032-17/+7
| | | | | | | | | This is a much better method of calling external programs on the buffer's contents, not just because it avoids the mess of :execute evaluation but also because it doesn't require that there actually be a filename for the current buffer. This drastically simplifies the HTML tidy(1) call in particular.
* Use full ':execute' not just ':exe' in VimLTom Ryder2017-11-032-3/+3
| | | | We should probably avoid this sort of abbreviation in scripts.
* Check for availability of Vim shellescape()Tom Ryder2017-11-032-10/+17
| | | | | It doesn't seem to be in very old Vims; worth testing for to avoid errors if I try to use the function.
* Revert "Adjust UrlLink() to yank word without t...Tom Ryder2017-11-031-3/+1
| | | | | | | | I thought text objects were introduced to Vim a lot later than they actually were; this works fine even in Vim 6, so I'll leave it as it's nicer. This reverts commit ffb5cbc7c681e2fdcb780dbdc51cf3458a937791.
* Adjust UrlLink() to yank word without text objectsTom Ryder2017-11-031-1/+3
|
* Refactor UrlLink() function normal! commandsTom Ryder2017-11-031-2/+10
| | | | | | | | | Tidy up the 'normal!' commands and comment them in appropriate groups. Take advantage of the natural command-termination at the end of a 'normal!' string to end insert mode. It would be better to do all of this with pure VimL functions, but I don't know how yet.
* Use single quotes for HTML link mapping :executeTom Ryder2017-11-031-2/+2
| | | | Saves some backslashing, just like in shell and Perl!
* Refactor HTML tidy(1) mappingTom Ryder2017-11-031-1/+4
| | | | | Move the logic into a script function. Use single quotes for the strings, too, since we don't need interpolation.
* Use <Leader>/<LocalLeader> correctly in Vim configTom Ryder2017-11-039-18/+18
| | | | | | | 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-032-40/+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-023-28/+72
|\ | | | | | | | | | | | | | | | | | | | | * 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
| * Have bigfileturn local syntax off (configurably)Tom Ryder2017-11-021-0/+10
| |
| * Make bigfile 'synmaxcol' setting configurableTom Ryder2017-11-021-2/+7
| | | | | | | | | | Defaults to 256 columns and only sets it if the option's value isn't already lower than that.
| * Refactor plugin function for dependency injectionTom Ryder2017-11-021-13/+21
| | | | | | | | | | | | | | Pass the filename to check and the size limit into the function directly from the autocmd hook. Improve commenting and spacing as we go.
| * Rename variable and autocmd to use plugin prefixTom Ryder2017-11-021-4/+4
| | | | | | | | | | | | Just removing an underscore from the variable name so that g:big_file_size becomes g:bigfile_size, and remove the "dotfiles" prefix from the autocmd.
| * Make bigfile size variable an option with defaultTom Ryder2017-11-021-2/+4
| | | | | | | | | | This arranges for g:big_file_size only to set itself to 10 MiB if the variable is not already set, presumably by the user in their vimrc.
| * Expand comment header for bigfile.vimTom Ryder2017-11-021-1/+8
| | | | | | | | Include some author and license metadata.
| * Move Vim big file options config into pluginTom Ryder2017-11-022-0/+12
| | | | | | | | | | | | | | | | | | | | | | 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.
* | Make 'shellslash' setting conditional on featureTom Ryder2017-11-011-0/+39
|/ | | | | | | | | | | | :help 'shellslash' says: > 'shellslash' only works when a backslash can be used as a path > separator. To test if this is so use: > if exists('+shellslash') This has actually already been done before in 795fd10, but the change was lost in a merge with a branch that restructured the whole Vim configuration.
* Correct variable name in commentTom Ryder2017-11-011-3/+2
| | | | | | This was unintentionally committed in e36efd4. The correct name of the variable is b:is_ksh. b:is_kornshell_proper was a rejected first revision of the name.
* Remove extraneous spacing between wordsTom Ryder2017-11-011-1/+1
| | | | No functional effect.
* Reload indent global defaults before each filetypeTom Ryder2017-10-313-0/+9
| | | | | | Just to be comprehensive, reinstate the global defaults for all the indenting options via the indent/_GLOBAL.vim stub each time the filetype is changed.
* Use clunkier, more compatible indent option resetTom Ryder2017-10-311-6/+5
| | | | | | This method of re-setting the numeric indent local options to their global analogues looks a bit gross, but seems to work on much older versions of Vim (6.2 in this testing).
* Remove duplicated 'encoding' Vim configurationTom Ryder2017-10-311-5/+0
| | | | | This setting is already in vim/config/encoding.vim, having been copied there in 505a2c2; it was intended to be moved rather than copied.
* 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.
* 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.