aboutsummaryrefslogtreecommitdiff
path: root/vim/ftdetect
Commit message (Collapse)AuthorAgeFilesLines
* Require at least one char in ftdetect filenamesTom Ryder2018-09-051-3/+3
|
* Clarify perl.vim ftdetect comment a bitTom Ryder2018-07-181-1/+1
|
* Add explicit group to ftdetect ruleTom Ryder2018-07-101-1/+1
| | | | | This isn't strictly necessary, as it's sourced into the group from filetype.vim, but making it explicit appeases vint.
* Add extra Perl file detection rulesTom Ryder2018-07-091-0/+9
|
* Consolidate .vimrc and .vim/filetype.vimTom Ryder2018-06-0640-244/+0
| | | | And add .vim/script.vim, to be composed in the next commit
* Add mail ftdetect rulesTom Ryder2018-06-031-0/+4
|
* Remove accidentally committed ";" fileTom Ryder2018-06-031-12/+0
|
* Add shebang and opening tag detect for PHPTom Ryder2018-06-032-0/+20
|
* Refine shebangs in filetype detectionTom Ryder2018-06-036-8/+8
|
* Implement personal filetype.vimTom Ryder2018-06-0339-12/+209
| | | | | | | | | | | | | | | | | This implements only the syntax highlighting for file types I regularly use and care about, implemented in the way I want them to work, with files named per type in ftdetect/*.vim. I have chosen only file types with which I regularly deal and for which syntax highlighting and filetype/indent plugins are actually useful. Most other files, e.g. system config files I edit infrequently and only with sudoedit(8), don't really benefit from that. Much of this is just copied from the distribution filetype.vim file, but some of it I do specifically in a way I want, such as the shell decision logic. We'll see how well this works.
* Remove help ftdetect rulesTom Ryder2018-01-261-4/+0
| | | | No longer applicable since pathogen.vim was removed in 3e2740f.
* Force muttrc filetype from ftdetect rulesTom Ryder2017-11-131-1/+1
| | | | | Looks like these were getting categorised as "rc", or "M$ Resource files", in the core filetype.vim.
* Add path rules for detecting Vim help filesTom Ryder2017-11-121-0/+4
| | | | | This matches .txt files in any 'doc' directory with 'vim' or '.vim' in its ancestry.
* Remove superfluous augroups around ftdetect defsTom Ryder2017-11-085-43/+27
| | | | | | | | | | From :help ftdetect, item 2: > 2. Create a file that contains an autocommand to detect the file type. > Example: > au BufRead,BufNewFile *.mine set filetype=mine > Note that there is no "augroup" command, this has already been done > when sourcing your file.
* 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
* Apply name conventions, scoping to Vim identifiersTom Ryder2017-10-305-5/+5
| | | | | | | | | | | | | | | | | | 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 conventional indent for continued VimL linesTom Ryder2017-10-305-17/+17
| | | | | | | | | | | | | | | I had four spaces, but with a 'shiftwidth' of 2, 6 is the conventional value. From :help ft-vim-indent: >For indenting Vim scripts there is one variable that specifies the >amount of indent for a continuation line, a line that starts with a >backslash: > > :let g:vim_indent_cont = &sw * 3 > >Three times shiftwidth is the default value.
* Rearrange and better explain ksh syntax workaroundTom Ryder2017-10-301-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | Move the rule setting the custom b:is_ksh variable used for this workaround (established in 52615f6) into an ftplugin file, rather than into ftdetect; the latter seems a much more appropriate place since by this point we've definitely decided the file type is "sh". From the revised comment in this changeset: >Setting g:is_posix above also prompts Vim's core syntax/sh.vim script >to set g:is_kornshell and thereby b:is_kornshell to the same value as >g:is_posix. > >That's very confusing, so before it happens we'll copy b:is_kornshell's >value as determined by filetype.vim and ~/.vim/ftdetect/sh.vim into a >custom variable b:is_ksh, before its meaning gets confused. > >b:is_ksh as a name is more inline with b:is_bash and b:is_sh, anyway, >so we'll just treat b:is_kornshell like it's both misnamed and broken. > >We can then switch on our custom variable in ~/.vim/after/syntax/sh.vim >to apply settings that actually *are* unique to Korn shell and its >derivatives.
* Add detection, tweak indent/whitespace for CSV/TSVTom Ryder2017-10-302-0/+14
| | | | | | | | | | | | | | Vim does not seem to have any built-in detection or settings for CSV or TSV files, so I've added a couple here, based on filename patterns matching the .csv and .tsv extensions. If either of these types are detected, the 'autoindent' and 'expandtab' options are both switched off, as they're undesirable, especially in TSVs where a literal tab is almost certainly what's intended. Ideally, these same two setting would apply to any filetype not otherwise categorisable, but I can't figure out a way to do that safely yet; there was an attempt made in d3d998c.
* Use :setfiletype in lieu of :setlocal filetype=Tom Ryder2017-10-303-5/+5
| | | | | | | | | | | | | | | | | | Use this recommended syntax in the custom ftplugin settings. Seems to be the recommended way to set filetype idempotently, and is present even in very old Vim (6.2 tested). From the Vim documentation for :setfiletype: >Set the 'filetype' option to {filetype}, but only if not done yet in a >sequence of (nested) autocommands. This is short for: > :if !did_filetype() > : setlocal filetype={filetype} > :endif >This command is used in a filetype.vim file to avoid setting the >'filetype' option twice, causing different settings and syntax files to >be loaded.
* Use consistent long-line indentTom Ryder2017-10-301-2/+2
| | | | | | Use four spaces for the indent of lines that are continuations of the previous line, using VimL's bizarre backslashed syntax, to keep them distinct from the indentation to show control structures.
* Merge two ftdetect rules for Muttrc filesTom Ryder2017-10-301-7/+1
| | | | | | Put the patterns together with a comma to keep them in the same rule. I suspect my original intention was to keep things clear, but this doesn't seem so bad now.
* Clear autocommands in ftdetect augroupsTom Ryder2017-10-303-0/+3
| | | | | | | | | | Clear autocommand definitions for each of the ftdetect augroups with `autocmd!` as the first command within them. This avoids ending up with doubled-up autocmd definitions if the configuration file is re-sourced, and is pretty standard good Vimscript practice. It's done correctly elsewhere in my Vim configuration, for example in config/undo.vim, but it's been unintentionally omitted here.
* Move vim/after/ftdetect to vim/ftdetectTom Ryder2017-10-303-0/+49
There's no particular reason to run these file detection rules after the plugins have run, so we'll put them in a more expected directory. I've created a new Makefile target to install this, `install-vim-ftdetect`, which is included as a prerequisite of the `install-vim` target.