From 9858af6f41ff7d9f295384c45ef21d2f3892fbd3 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 30 Oct 2017 15:03:46 +1300 Subject: Move filetype-specific indent options into indent/ I'm still getting used to the structure of the configuration here, and had mistakenly put these indent-related settings into files in the ftplugin directory. --- vim/ftplugin/c.vim | 6 ------ vim/ftplugin/csv.vim | 3 --- vim/ftplugin/html.vim | 18 ------------------ vim/ftplugin/perl.vim | 7 ------- vim/ftplugin/php.vim | 6 ------ vim/ftplugin/sh.vim | 7 ------- vim/ftplugin/tsv.vim | 3 --- vim/ftplugin/vim.vim | 4 ---- vim/indent/c.vim | 6 ++++++ vim/indent/csv.vim | 3 +++ vim/indent/html.vim | 18 ++++++++++++++++++ vim/indent/perl.vim | 6 ++++++ vim/indent/php.vim | 7 +++++++ vim/indent/sh.vim | 6 ++++++ vim/indent/tsv.vim | 3 +++ vim/indent/vim.vim | 4 ++++ 16 files changed, 53 insertions(+), 54 deletions(-) delete mode 100644 vim/ftplugin/c.vim delete mode 100644 vim/ftplugin/csv.vim delete mode 100644 vim/ftplugin/html.vim delete mode 100644 vim/ftplugin/php.vim delete mode 100644 vim/ftplugin/tsv.vim delete mode 100644 vim/ftplugin/vim.vim create mode 100644 vim/indent/c.vim create mode 100644 vim/indent/csv.vim create mode 100644 vim/indent/html.vim create mode 100644 vim/indent/perl.vim create mode 100644 vim/indent/sh.vim create mode 100644 vim/indent/tsv.vim create mode 100644 vim/indent/vim.vim diff --git a/vim/ftplugin/c.vim b/vim/ftplugin/c.vim deleted file mode 100644 index 1be25bf5..00000000 --- a/vim/ftplugin/c.vim +++ /dev/null @@ -1,6 +0,0 @@ -" Explicitly set indent level; this matches the global default, but it's tidy -" to enforce it in case we changed from a filetype with different value (e.g. -" VimL) -setlocal shiftwidth=4 -setlocal softtabstop=4 -setlocal tabstop=4 diff --git a/vim/ftplugin/csv.vim b/vim/ftplugin/csv.vim deleted file mode 100644 index 3d78df97..00000000 --- a/vim/ftplugin/csv.vim +++ /dev/null @@ -1,3 +0,0 @@ -" Manual indenting and literal tabs for CSVs -setlocal noautoindent -setlocal noexpandtab diff --git a/vim/ftplugin/html.vim b/vim/ftplugin/html.vim deleted file mode 100644 index 654aa407..00000000 --- a/vim/ftplugin/html.vim +++ /dev/null @@ -1,18 +0,0 @@ -" Explicitly set indent level; this matches the global default, but it's tidy -" to enforce it in case we changed from a filetype with different value (e.g. -" VimL) -setlocal shiftwidth=4 -setlocal softtabstop=4 -setlocal tabstop=4 - -" Run tidy -eq -utf8 on file for the current buffer -nnoremap v :exe "!tidy -eq -utf8 " . shellescape(expand("%")) - -" Make a bare URL into a link to itself -function! UrlLink() - normal yiW - execute "normal i0\">\" - normal E - execute "normal a\" -endfunction -nnoremap r :call UrlLink() diff --git a/vim/ftplugin/perl.vim b/vim/ftplugin/perl.vim index 08d41008..dad2ce35 100644 --- a/vim/ftplugin/perl.vim +++ b/vim/ftplugin/perl.vim @@ -1,10 +1,3 @@ -" Explicitly set indent level; this matches the global default, but it's tidy -" to enforce it in case we changed from a filetype with different value (e.g. -" VimL) -setlocal shiftwidth=4 -setlocal softtabstop=4 -setlocal tabstop=4 - " Run perl -c on file for the current buffer nnoremap pc :exe "!perl -c " . shellescape(expand("%")) " Run perlcritic on the file for the current buffer diff --git a/vim/ftplugin/php.vim b/vim/ftplugin/php.vim deleted file mode 100644 index 1be25bf5..00000000 --- a/vim/ftplugin/php.vim +++ /dev/null @@ -1,6 +0,0 @@ -" Explicitly set indent level; this matches the global default, but it's tidy -" to enforce it in case we changed from a filetype with different value (e.g. -" VimL) -setlocal shiftwidth=4 -setlocal softtabstop=4 -setlocal tabstop=4 diff --git a/vim/ftplugin/sh.vim b/vim/ftplugin/sh.vim index 25e433e7..2b73611e 100644 --- a/vim/ftplugin/sh.vim +++ b/vim/ftplugin/sh.vim @@ -1,10 +1,3 @@ -" Explicitly set indent level; this matches the global default, but it's tidy -" to enforce it in case we changed from a filetype with different value (e.g. -" VimL) -setlocal shiftwidth=4 -setlocal softtabstop=4 -setlocal tabstop=4 - " Default to POSIX shell, as I never write Bourne, and if I write Bash or Ksh " it'll be denoted with either a shebang or an appropriate extension. At the " time of writing, changing this also prompts sh.vim to set g:is_kornshell, diff --git a/vim/ftplugin/tsv.vim b/vim/ftplugin/tsv.vim deleted file mode 100644 index 53841357..00000000 --- a/vim/ftplugin/tsv.vim +++ /dev/null @@ -1,3 +0,0 @@ -" Manual indenting and literal tabs for TSVs -setlocal noautoindent -setlocal noexpandtab diff --git a/vim/ftplugin/vim.vim b/vim/ftplugin/vim.vim deleted file mode 100644 index b958fe54..00000000 --- a/vim/ftplugin/vim.vim +++ /dev/null @@ -1,4 +0,0 @@ -" Observe VimL conventions for two-space indents -setlocal shiftwidth=2 -setlocal softtabstop=2 -setlocal tabstop=2 diff --git a/vim/indent/c.vim b/vim/indent/c.vim new file mode 100644 index 00000000..1be25bf5 --- /dev/null +++ b/vim/indent/c.vim @@ -0,0 +1,6 @@ +" Explicitly set indent level; this matches the global default, but it's tidy +" to enforce it in case we changed from a filetype with different value (e.g. +" VimL) +setlocal shiftwidth=4 +setlocal softtabstop=4 +setlocal tabstop=4 diff --git a/vim/indent/csv.vim b/vim/indent/csv.vim new file mode 100644 index 00000000..3d78df97 --- /dev/null +++ b/vim/indent/csv.vim @@ -0,0 +1,3 @@ +" Manual indenting and literal tabs for CSVs +setlocal noautoindent +setlocal noexpandtab diff --git a/vim/indent/html.vim b/vim/indent/html.vim new file mode 100644 index 00000000..654aa407 --- /dev/null +++ b/vim/indent/html.vim @@ -0,0 +1,18 @@ +" Explicitly set indent level; this matches the global default, but it's tidy +" to enforce it in case we changed from a filetype with different value (e.g. +" VimL) +setlocal shiftwidth=4 +setlocal softtabstop=4 +setlocal tabstop=4 + +" Run tidy -eq -utf8 on file for the current buffer +nnoremap v :exe "!tidy -eq -utf8 " . shellescape(expand("%")) + +" Make a bare URL into a link to itself +function! UrlLink() + normal yiW + execute "normal i0\">\" + normal E + execute "normal a\" +endfunction +nnoremap r :call UrlLink() diff --git a/vim/indent/perl.vim b/vim/indent/perl.vim new file mode 100644 index 00000000..1be25bf5 --- /dev/null +++ b/vim/indent/perl.vim @@ -0,0 +1,6 @@ +" Explicitly set indent level; this matches the global default, but it's tidy +" to enforce it in case we changed from a filetype with different value (e.g. +" VimL) +setlocal shiftwidth=4 +setlocal softtabstop=4 +setlocal tabstop=4 diff --git a/vim/indent/php.vim b/vim/indent/php.vim index d0fb1f8f..9e084f24 100644 --- a/vim/indent/php.vim +++ b/vim/indent/php.vim @@ -2,3 +2,10 @@ " to stop it processing its ridiculous expression-based indenting that never " seems to do what I want. Just plain autoindent is fine. let b:did_indent = 1 + +" Explicitly set indent level; this matches the global default, but it's tidy +" to enforce it in case we changed from a filetype with different value (e.g. +" VimL) +setlocal shiftwidth=4 +setlocal softtabstop=4 +setlocal tabstop=4 diff --git a/vim/indent/sh.vim b/vim/indent/sh.vim new file mode 100644 index 00000000..1be25bf5 --- /dev/null +++ b/vim/indent/sh.vim @@ -0,0 +1,6 @@ +" Explicitly set indent level; this matches the global default, but it's tidy +" to enforce it in case we changed from a filetype with different value (e.g. +" VimL) +setlocal shiftwidth=4 +setlocal softtabstop=4 +setlocal tabstop=4 diff --git a/vim/indent/tsv.vim b/vim/indent/tsv.vim new file mode 100644 index 00000000..53841357 --- /dev/null +++ b/vim/indent/tsv.vim @@ -0,0 +1,3 @@ +" Manual indenting and literal tabs for TSVs +setlocal noautoindent +setlocal noexpandtab diff --git a/vim/indent/vim.vim b/vim/indent/vim.vim new file mode 100644 index 00000000..b958fe54 --- /dev/null +++ b/vim/indent/vim.vim @@ -0,0 +1,4 @@ +" Observe VimL conventions for two-space indents +setlocal shiftwidth=2 +setlocal softtabstop=2 +setlocal tabstop=2 -- cgit v1.2.3