From d103b2a72ed0152303f381ab91ea7b2a3721591b Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Fri, 21 Mar 2014 23:59:10 +0100 Subject: [PATCH 01/16] setup.sh: add missing newline --- setup.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.sh b/setup.sh index e2576be..e112aaa 100755 --- a/setup.sh +++ b/setup.sh @@ -22,6 +22,7 @@ set -e . ../lib.sh + # Create directories. mkdir -p vim/cache -- 2.44.2 From 51acc1fceca54aff868e32ce31c10459c4fbaac6 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sat, 22 Mar 2014 00:02:12 +0100 Subject: [PATCH 02/16] ftplugin/*.xpt.vim: print snippets: move cursor after snippet --- vim/ftplugin/java/java.xpt.vim | 4 ++-- vim/ftplugin/perl/perl.xpt.vim | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vim/ftplugin/java/java.xpt.vim b/vim/ftplugin/java/java.xpt.vim index 07cd2fa..38a25f2 100644 --- a/vim/ftplugin/java/java.xpt.vim +++ b/vim/ftplugin/java/java.xpt.vim @@ -58,7 +58,7 @@ public class `E('%:t:r')^ { XPT p -System.out.println(`cursor^); +System.out.println(`value^); XPT pe -System.err.println(`cursor^); +System.err.println(`value^); diff --git a/vim/ftplugin/perl/perl.xpt.vim b/vim/ftplugin/perl/perl.xpt.vim index 5259466..f33e09a 100644 --- a/vim/ftplugin/perl/perl.xpt.vim +++ b/vim/ftplugin/perl/perl.xpt.vim @@ -60,7 +60,7 @@ use warnings; XPT p -print `cursor^; +print `value^; XPT pe -print STDERR `cursor^; +print STDERR `value^; -- 2.44.2 From 22d5ff950888fe89cde0f4cfbd405194bd61cd41 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sat, 22 Mar 2014 00:06:26 +0100 Subject: [PATCH 03/16] ftplugin/perl/perl.xpt.vim: add pd, u, udd snippets --- vim/ftplugin/perl/perl.xpt.vim | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/vim/ftplugin/perl/perl.xpt.vim b/vim/ftplugin/perl/perl.xpt.vim index f33e09a..9c734be 100644 --- a/vim/ftplugin/perl/perl.xpt.vim +++ b/vim/ftplugin/perl/perl.xpt.vim @@ -6,7 +6,7 @@ " Maintainer: Simon Ruderich " License: GPL v3+ -" Copyright (C) 2012 Simon Ruderich +" Copyright (C) 2012-2014 Simon Ruderich " " This file is free software: you can redistribute it and/or modify " it under the terms of the GNU General Public License as published by @@ -64,3 +64,15 @@ print `value^; XPT pe print STDERR `value^; + +XPT pd +print Dumper(`value^); + + +XPT u +use `package^; +`cursor^ + +XPT udd +use Data::Dumper; +`cursor^ -- 2.44.2 From 45b796b942b37b428cee30b5e3a3792f84dd1488 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sun, 23 Mar 2014 01:52:44 +0100 Subject: [PATCH 04/16] vim/bundle/xptemplate: update to 2224413e57e1d91607ee6f99a273a374405261ab --- vim/bundle/xptemplate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/bundle/xptemplate b/vim/bundle/xptemplate index b531a31..2224413 160000 --- a/vim/bundle/xptemplate +++ b/vim/bundle/xptemplate @@ -1 +1 @@ -Subproject commit b531a310675959cd93a6968f2dbff97f4880be8c +Subproject commit 2224413e57e1d91607ee6f99a273a374405261ab -- 2.44.2 From 85fea365744e1deda5213e2a900c5bc563350090 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Thu, 3 Apr 2014 22:15:13 +0200 Subject: [PATCH 05/16] vimrc: also highlight NOTE as todo --- vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vimrc b/vimrc index fb56e0c..df56e12 100644 --- a/vimrc +++ b/vimrc @@ -809,7 +809,7 @@ if has('syntax') if exists('*matchadd') " Highlight some important keywords in all documents. - let l:todos = ['TODO', 'XXX', 'FIXME', + let l:todos = ['TODO', 'XXX', 'FIXME', 'NOTE', \ 'CHANGED', 'REMOVED', 'DELETED'] " Compatibility fix for Vim 6.4 which can't handle for in function " (without function it's ignored). -- 2.44.2 From e68ab201d8e682ac4d5b7f93d293c920c078e116 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Tue, 29 Apr 2014 15:33:52 +0200 Subject: [PATCH 06/16] vimrc: minor statusline cleanup --- vimrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vimrc b/vimrc index df56e12..26c4f5f 100644 --- a/vimrc +++ b/vimrc @@ -449,10 +449,10 @@ if has('statusline') set statusline+=: if has('modify_fname') && v:version >= 700 " some functions need 7.0 set statusline+=%{SRF()} " path to current file - set statusline+=\ " space after path else - set statusline+=%f\ " path to current file in buffer + set statusline+=%f " path to current file in buffer endif + set statusline+=\ " space after path set statusline+=%h " [help] if buffer is help file set statusline+=%w " [Preview] if buffer is preview buffer set statusline+=%m " [+] if buffer was modified, -- 2.44.2 From 85752ff8c965dd916dfc4588d15cf9c7ba37e292 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Tue, 29 Apr 2014 15:35:20 +0200 Subject: [PATCH 07/16] vimrc: fix syntax when reloading vimrc --- vimrc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vimrc b/vimrc index 26c4f5f..4860c7f 100644 --- a/vimrc +++ b/vimrc @@ -763,7 +763,11 @@ inoreabbrev completly completely " Activate syntax coloring. if has('syntax') - syntax enable + " But only if it wasn't already active. Prevents breaking the syntax + " coloring when reloading the vimrc. Thanks to johnLate for the idea. + if !exists('g:syntax_on') + syntax enable + endif " Don't highlight more than 500 columns as I normally don't have that long " lines and they slow down syntax coloring. Thanks to Derek Wyatt -- 2.44.2 From 0e88dff40a8e3b25ab16f3b0effb294feb7a1024 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Tue, 29 Apr 2014 15:50:10 +0200 Subject: [PATCH 08/16] after/syntax/perl.vim: support Inline::C highlighting --- vim/after/syntax/perl.vim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vim/after/syntax/perl.vim b/vim/after/syntax/perl.vim index ebedc23..7a45bc1 100644 --- a/vim/after/syntax/perl.vim +++ b/vim/after/syntax/perl.vim @@ -4,7 +4,7 @@ " Maintainer: Simon Ruderich " License: GPL v3+ -" Copyright (C) 2012 Simon Ruderich +" Copyright (C) 2012-2014 Simon Ruderich " " This file is free software: you can redistribute it and/or modify " it under the terms of the GNU General Public License as published by @@ -31,3 +31,9 @@ syntax match Error "\<\(continue\|break\)\>" if exists('g:colors_name') && g:colors_name == 'simon' highlight link perlStatementControl statementControl endif + +" Highlight for Inline::C in __DATA__/__END__ section +unlet b:current_syntax +syntax include @InlineC syntax/c.vim +syntax region perlInlineC start='^__C__$' skip='.' end='.' contains=@InlineC +syntax cluster perlDATA add=perlInlineC -- 2.44.2 From a54fb194ea28fb0fdd6dc22f8a30e8a0f107c518 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Tue, 29 Apr 2014 15:51:29 +0200 Subject: [PATCH 09/16] vimrc: also fix jK typo Not sure how exactly I manage to type this though. --- vimrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vimrc b/vimrc index 4860c7f..4f38ca0 100644 --- a/vimrc +++ b/vimrc @@ -491,8 +491,10 @@ cnoremap jk " And fix my typos ... inoremap JK inoremap Jk +inoremap jK cnoremap JK cnoremap Jk +cnoremap jK " Disable arrow keys for all modes except command modes. Thanks to James Vega " (http://git.jamessan.com/?p=etc/vim.git;a=summary). -- 2.44.2 From 005ce3d0ee890555ce3dd0c71de790370e6d3e53 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Tue, 29 Apr 2014 15:53:37 +0200 Subject: [PATCH 10/16] xptemplate: add VHDL snippets --- vim/ftplugin/vhdl/vhdl.xpt.vim | 67 ++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 vim/ftplugin/vhdl/vhdl.xpt.vim diff --git a/vim/ftplugin/vhdl/vhdl.xpt.vim b/vim/ftplugin/vhdl/vhdl.xpt.vim new file mode 100644 index 0000000..adf93b2 --- /dev/null +++ b/vim/ftplugin/vhdl/vhdl.xpt.vim @@ -0,0 +1,67 @@ +" vim: ft=xpt + +" XPTemplate template file. +" +" Language: VHDL +" Maintainer: Simon Ruderich +" License: GPL v3+ + +" Copyright (C) 2014 Simon Ruderich +" +" This file is free software: you can redistribute it and/or modify +" it under the terms of the GNU General Public License as published by +" the Free Software Foundation, either version 3 of the License, or +" (at your option) any later version. +" +" This file is distributed in the hope that it will be useful, +" but WITHOUT ANY WARRANTY; without even the implied warranty of +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +" GNU General Public License for more details. +" +" You should have received a copy of the GNU General Public License +" along with this file. If not, see . + + +XPTemplate priority=lang + +let s:f = g:XPTfuncs() + +XPTinclude + \ _common/common + + +XPT vhdl +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +`cursor^ + + +XPT slv +std_logic_vector(`from^ downto `to^) + + +XPT entity +entity `name^ is + port( + `cursor^ + ); +end entity; + +XPT architecture +architecture `behavioral^ of `entity^ is +begin + `cursor^ +end architecture; + +XPT process +process`list^ +begin + `cursor^ +end process; + +XPT if +if `condition^ then + `cursor^ +end if; -- 2.44.2 From 608699cd71b2d45b86c255eef3d6ad8e4fba59f7 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Tue, 29 Apr 2014 16:08:10 +0200 Subject: [PATCH 11/16] xptemplate: use f as trigger to create the basic skeleton f for file. --- vim/ftplugin/c/c.xpt.vim | 4 ++-- vim/ftplugin/java/java.xpt.vim | 4 ++-- vim/ftplugin/perl/perl.xpt.vim | 2 +- vim/ftplugin/vhdl/vhdl.xpt.vim | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/vim/ftplugin/c/c.xpt.vim b/vim/ftplugin/c/c.xpt.vim index 588d7c2..aaeb7db 100644 --- a/vim/ftplugin/c/c.xpt.vim +++ b/vim/ftplugin/c/c.xpt.vim @@ -6,7 +6,7 @@ " Maintainer: Simon Ruderich " License: GPL v3+ -" Copyright (C) 2012 Simon Ruderich +" Copyright (C) 2012-2014 Simon Ruderich " " This file is free software: you can redistribute it and/or modify " it under the terms of the GNU General Public License as published by @@ -30,7 +30,7 @@ endif XPTemplate priority=personal -XPT c +XPT f XSET description|post=S(V(), '^description$', 'XXX') /* * `description^ diff --git a/vim/ftplugin/java/java.xpt.vim b/vim/ftplugin/java/java.xpt.vim index 38a25f2..c6749c8 100644 --- a/vim/ftplugin/java/java.xpt.vim +++ b/vim/ftplugin/java/java.xpt.vim @@ -6,7 +6,7 @@ " Maintainer: Simon Ruderich " License: GPL v3+ -" Copyright (C) 2012 Simon Ruderich +" Copyright (C) 2012-2014 Simon Ruderich " " This file is free software: you can redistribute it and/or modify " it under the terms of the GNU General Public License as published by @@ -30,7 +30,7 @@ endif XPTemplate priority=personal -XPT java +XPT f XSET description|post=S(V(), '^description$', 'XXX') /* * `description^ diff --git a/vim/ftplugin/perl/perl.xpt.vim b/vim/ftplugin/perl/perl.xpt.vim index 9c734be..c2b4314 100644 --- a/vim/ftplugin/perl/perl.xpt.vim +++ b/vim/ftplugin/perl/perl.xpt.vim @@ -30,7 +30,7 @@ endif XPTemplate priority=personal -XPT perl +XPT f XSET description|post=S(V(), '^description$', 'XXX') #!/usr/bin/perl diff --git a/vim/ftplugin/vhdl/vhdl.xpt.vim b/vim/ftplugin/vhdl/vhdl.xpt.vim index adf93b2..6707b9c 100644 --- a/vim/ftplugin/vhdl/vhdl.xpt.vim +++ b/vim/ftplugin/vhdl/vhdl.xpt.vim @@ -30,7 +30,7 @@ XPTinclude \ _common/common -XPT vhdl +XPT f library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; -- 2.44.2 From cb310f8c9c3ace582f4ed56128e733fc6b1d0998 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Tue, 29 Apr 2014 16:28:44 +0200 Subject: [PATCH 12/16] vimrc: set secure --- vimrc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vimrc b/vimrc index 4f38ca0..8b394d0 100644 --- a/vimrc +++ b/vimrc @@ -41,6 +41,11 @@ endif " Make sure Vim (and not Vi) settings are used. set nocompatible +" Disallow :autocmd, shell and write commands in .vimrc and .exrc files in the +" current directory. Only used if 'exrc' is enabled (off by default), +" precaution just in case somebody enables 'exrc'. +set secure + " Use UTF-8 for all internal data (buffers, registers, etc.). This doesn't " affect reading files in different encodings, see 'fileencodings' for that. set encoding=utf-8 -- 2.44.2 From 4b75b7303116e43b1d842f8102dbb8a78cc880ce Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Tue, 29 Apr 2014 16:30:29 +0200 Subject: [PATCH 13/16] vimrc: split verbatim into verbatim and list mapping --- vimrc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vimrc b/vimrc index 8b394d0..64a6225 100644 --- a/vimrc +++ b/vimrc @@ -622,9 +622,11 @@ if has('eval') nnoremap t :call UseTabs() endif " Enable "verbatim" mode. Used to view files with long lines or without syntax -" coloring. -nnoremap v :set nolist nowrap nospell synmaxcol=0 +" coloring. 'list' is not changed, see next mapping. +nnoremap v :setlocal nowrap nospell synmaxcol=0 \ :2match +" Toggle 'list'. +nnoremap l :set invlist " Make last active window the only window. Similar to o. nnoremap O po -- 2.44.2 From d783a62c8dbe9ed1528e0a1b714f323b82fe358d Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sat, 21 Jun 2014 14:30:46 +0200 Subject: [PATCH 14/16] use set -eu --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index e112aaa..6884298 100755 --- a/setup.sh +++ b/setup.sh @@ -18,7 +18,7 @@ # along with this program. If not, see . -set -e +set -eu . ../lib.sh -- 2.44.2 From 0ca8eae3ee251e2943e510098381ff9fa7e972bd Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Tue, 19 Aug 2014 16:13:08 +0200 Subject: [PATCH 15/16] term2gui.pl: read from STDIN --- term2gui.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/term2gui.pl b/term2gui.pl index 6da84f4..274ad2c 100755 --- a/term2gui.pl +++ b/term2gui.pl @@ -3,7 +3,7 @@ # Convert a terminal color scheme for 256 color terminals to a GUI color # scheme by adding the appropriate gui* options. -# Copyright (C) 2012 Simon Ruderich +# Copyright (C) 2012-2014 Simon Ruderich # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -281,7 +281,7 @@ sub xterm2rgb { } -while (<>)) { +while () { # Only handle lines with highlight commands. if (/^\s*\bhi(?:ghlight)?\b/) { foreach my $setting (m/\bcterm(?:fg|bg)?=\S+/g) { -- 2.44.2 From 2c098407bbb00ef750c89a8c0db507c7919be705 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Tue, 19 Aug 2014 16:15:52 +0200 Subject: [PATCH 16/16] vimrc: update comments --- vimrc | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/vimrc b/vimrc index 64a6225..63741d7 100644 --- a/vimrc +++ b/vimrc @@ -164,7 +164,8 @@ endif " existing files. set fileencodings=utf-8,latin1 -" Always use unix line-endings for new files. +" Always use unix line-endings for new files. DOS line endings in existing +" files are recognized. set fileformats=unix,dos " Wrap text after 78 characters. @@ -263,7 +264,7 @@ set number if exists('+numberwidth') set numberwidth=1 endif -" Display the ruler with current line/file position. If 'statusline' is used +" Display the ruler with current line/file position. If 'statusline' is used, " then this only affects . set ruler " Display partial commands in the status line. @@ -824,7 +825,7 @@ if has('syntax') " Highlight some important keywords in all documents. let l:todos = ['TODO', 'XXX', 'FIXME', 'NOTE', \ 'CHANGED', 'REMOVED', 'DELETED'] - " Compatibility fix for Vim 6.4 which can't handle for in function + " Compatibility fix for Vim 6.4 which can't parse for in functions " (without function it's ignored). execute ' for l:x in l:todos' \ '| call matchadd("Todo", l:x)' @@ -861,32 +862,32 @@ if has('syntax') " C let g:c_no_if0_fold = 1 " fix weird double fold in #if0 in recent versions - " Haskell. + " Haskell let g:hs_highlight_delimiters = 1 let g:hs_highlight_boolean = 1 let g:hs_highlight_types = 1 let g:hs_highlight_more_types = 1 - " Java. + " Java let g:java_highlight_java_lang_ids = 1 " color java.lang.* identifiers - " Perl. + " Perl let g:perl_fold = 1 let g:perl_fold_blocks = 1 let g:perl_nofold_packages = 1 let g:perl_include_pod = 1 " syntax coloring for PODs - " PHP. + " PHP let g:php_folding = 3 " fold functions let g:php_short_tags = 0 " no short tags (), not always usable let g:php_sql_query = 1 " highlight SQL queries in strings - " Python. + " Python let g:python_highlight_all = 1 - " Shell. + " Shell let g:sh_noisk = 1 " don't add . to 'iskeyword' let g:sh_is_posix = 1 " POSIX shell (e.g. dash) is compatible enough let g:sh_fold_enabled = 7 " functions (1), heredoc (2) and if/do/for (4) - " Vim. + " Vim let g:vimsyn_embed = 0 " don't highlight embedded languages let g:vimsyn_folding = 'af' " folding for autogroups (a) and functions (f) - " XML. + " XML let g:xml_syntax_folding = 1 endif @@ -961,7 +962,7 @@ endif " AUTO COMMANDS " Use a custom auto group to prevent problems when the vimrc files is sourced -" twice. +" multiple times. if has('autocmd') augroup vimrc @@ -1044,8 +1045,7 @@ if has('autocmd') autocmd FileType gitcommit let g:secure_modelines_allowed_items = [] | \ setlocal textwidth=72 " Fix 'include' setting for shell files to recognize '.' and 'source' -" commands. Use &l:include instead of setlocal which requires excessive -" escaping of \. +" commands. autocmd FileType sh let &l:include = '^\s*\(\.\|source\)\s\+' " Use the same comment string as for Vim files in Vimperator files. autocmd FileType vimperator setlocal commentstring=\"%s -- 2.44.2