Iain Patterson [Wed, 14 Jul 2010 10:15:31 +0000 (11:15 +0100)]
BufExplorer tweaks.
Tweak highlighting to make the current and alternate buffers more
noticeable and hidden buffers more subtle.
Map 0 to search for the active buffer.
Map 1-9 to search for matching buffer numbers, selecting unique matches.
Iain Patterson [Wed, 14 Jul 2010 10:40:02 +0000 (11:40 +0100)]
Show alternate buffer in statusline.
Toggle showing alternate buffer number and name for the current buffer,
if it exists, with <Leader>#. Off by default.
Iain Patterson [Thu, 8 Jul 2010 12:47:22 +0000 (13:47 +0100)]
Back compatibility.
Make sure more things which rely on particular features are wrapped in
has("feature") conditionals and wrap more stuff in version checks.
User functions were introduced in Vim 5.2.
VIMRUNTIME was introduced in Vim 5.4
The system() command was introduced in Vim 5.4.
The statusline option could not be modified before Vim 5.4.
Iain Patterson [Mon, 12 Jul 2010 12:25:51 +0000 (13:25 +0100)]
Bash 4 stuff.
Unset command_not_found_handle so typos and missing commands don't trigger
whatever annoying handler the vendor has set up.
Iain Patterson [Thu, 15 Jul 2010 15:03:38 +0000 (16:03 +0100)]
Added xterm-88color terminfo.
Macs don't have it. Ancient Linux might not. Solaris probably doesn't.
Iain Patterson [Mon, 28 Jun 2010 09:54:05 +0000 (10:54 +0100)]
Restore more old Git completion behaviour.
If we can't figure out a head print nothing rather than (unknown) as
this can get annoying when becoming other users and/or changing into
trees without permissions on the .git directory.
Iain Patterson [Fri, 25 Jun 2010 10:34:08 +0000 (11:34 +0100)]
Git completion from Git 1.7 with tweaks.
Preserve check for bash3+ before trying completion.
Remove the space between branch name and symbols.
Iain Patterson [Fri, 4 Jun 2010 12:44:42 +0000 (13:44 +0100)]
Put the cursor over the description placeholder.
Previously we did a reverse search for <enter description here> but
changed to finding the Description header so it was always visible.
Still look for Description but immediately put the cursor down a line
ready to type.
Iain Patterson [Mon, 31 May 2010 21:24:22 +0000 (22:24 +0100)]
Brought .vimperratorrc.local into version control.
Iain Patterson [Fri, 28 May 2010 14:45:46 +0000 (15:45 +0100)]
Handle tsort failure.
If tsort fails just source the scripts in the order they're found.
Iain Patterson [Fri, 26 Feb 2010 07:44:25 +0000 (07:44 +0000)]
Use vim alias for P4EDITOR etc.
Iain Patterson [Fri, 14 May 2010 13:09:19 +0000 (14:09 +0100)]
Allow ordering of profile scripts.
If "# profile-required: X" appears in a file under .profile.d then
ensure that X (which may be a list) is processed before the script in
question.
Always source OS.bashrc, PATH.bashrc and BECOME.bashrc before everything
else, if they exist.
Use this functionality to ensure that p4.bashrc isn't sourced before
vim.bashrc so that P4EDITOR can be set.
Iain Patterson [Wed, 19 May 2010 13:26:30 +0000 (14:26 +0100)]
Set formatting in changelist window.
Iain Patterson [Thu, 29 Apr 2010 09:33:37 +0000 (10:33 +0100)]
Move __ps1 call from .bash_profile to ps1.bashrc.
Don't force __ps1 to be called from .bash_profile. Anyone cloning the
repository should be free to discard the prompt changes.
Iain Patterson [Mon, 26 Apr 2010 10:01:54 +0000 (11:01 +0100)]
Ensure VISUAL is set when becoming.
Iain Patterson [Wed, 21 Apr 2010 13:27:22 +0000 (14:27 +0100)]
Removed pointless line left over from earlier versions.
Iain Patterson [Wed, 21 Apr 2010 13:27:04 +0000 (14:27 +0100)]
Try to change to directory from which become was run.
Iain Patterson [Thu, 25 Mar 2010 17:04:46 +0000 (17:04 +0000)]
Preserve umask.
We set umask 077 to ensure that the become script is not readable by
other users. Set the mask back to what it was beforehand.
Iain Patterson [Wed, 24 Mar 2010 15:12:39 +0000 (15:12 +0000)]
Don't set LD_RUN_PATH.
For starters it was cloning PATH when LD_LIBRARY_PATH would be more
appropriate.
More importantly it isn't needed most of the time. Indeed I'm usually
unsetting it whenever I build stuff so that the run path doesn't leak
into compiled code.
Set it manually as and when appropriate.
Iain Patterson [Tue, 23 Mar 2010 16:58:55 +0000 (16:58 +0000)]
Don't break SCREENDIR.
Use $HOME not ~ as the directory name is quoted.
Iain Patterson [Sun, 21 Mar 2010 11:47:16 +0000 (11:47 +0000)]
Typo.
Iain Patterson [Thu, 18 Mar 2010 22:23:05 +0000 (22:23 +0000)]
Don't leak file descriptor.
Iain Patterson [Wed, 17 Mar 2010 13:28:57 +0000 (13:28 +0000)]
Exploit bash POSIXLY_CORRECT mode.
Avoid ugly --rcfile lines in ps output by exploiting the fact that a
POSIX mode bash will read startup commands from the file specified in
ENV.
Set ENV and POSIXLY_CORRECT for startup, unsetting them and disabling
POSIX mode as the first actions in the new shell.
Iain Patterson [Mon, 15 Mar 2010 13:34:50 +0000 (13:34 +0000)]
Mantis 402.
Don't use mktemp in become and became. Some systems don't have it and
others want different arguments.
Iain Patterson [Thu, 11 Mar 2010 11:53:25 +0000 (11:53 +0000)]
More checks in become.
Check target user is valid before proceeding.
Don't delegate X11 cookie to non-root users by default.
Iain Patterson [Wed, 10 Mar 2010 14:20:00 +0000 (14:20 +0000)]
SCREENDIR checks.
Use bash builtin -g to check for setgid screen.
Make SCREENDIR if it doesn't already exist.
Iain Patterson [Fri, 5 Mar 2010 12:14:01 +0000 (12:14 +0000)]
Allow passing Kerberos credentials when becoming.
Use the -k flag to become to pass Kerberos credentials to the
target user even if this is not root.
Iain Patterson [Fri, 26 Feb 2010 07:50:03 +0000 (07:50 +0000)]
Removed unnecessary subshell for tty -s check.
Iain Patterson [Thu, 18 Feb 2010 10:44:46 +0000 (10:44 +0000)]
Sanity check path rules with embedded variables.
Iain Patterson [Fri, 12 Feb 2010 10:51:17 +0000 (10:51 +0000)]
Add target UID to KRB5CCNAME when becoming.
Iain Patterson [Fri, 5 Feb 2010 13:53:00 +0000 (13:53 +0000)]
become overhaul.
Pass commands to sudo through stdin.
Use these commands to set the environment for the destination user.
Replace all $HOME paths with $PROFILE_HOME, set when becoming.
Make .become/all optional as its functionality has been moved.
Iain Patterson [Fri, 21 Aug 2009 14:09:30 +0000 (15:09 +0100)]
Formatting.
Iain Patterson [Mon, 1 Feb 2010 13:43:55 +0000 (13:43 +0000)]
Fix MarkLine highlighting.
Marks which are highlighted with MarkLine weren't being highlighted
correctly since the big sign code refactoring.
Iain Patterson [Tue, 26 Jan 2010 13:11:25 +0000 (13:11 +0000)]
Handle git p4 submit.
git p4 submit includes the diff in its change spec so just copy that
rather than doing a diff manually.
Iain Patterson [Fri, 15 Jan 2010 14:06:57 +0000 (14:06 +0000)]
Handle Kerberos credentials when becoming users other than root.
Iain Patterson [Mon, 25 Jan 2010 10:55:31 +0000 (10:55 +0000)]
Restore window height when leaving Vim.
Iain Patterson [Wed, 13 Jan 2010 18:00:19 +0000 (18:00 +0000)]
Don't leave credentials laying around after sudo.
Add kdestroy to EXIT trap.
Iain Patterson [Mon, 4 Jan 2010 15:54:06 +0000 (15:54 +0000)]
Don't bother resizing a GUI window before exit.
Restoring the original terminal size is only worthwhile when we're
running in an actual terminal. Shrinking a GUI window and then closing
it makes no sense.
Iain Patterson [Mon, 4 Jan 2010 15:22:46 +0000 (15:22 +0000)]
Handle credentials cache when sudoing.
If we become root and a credentials cache is already available then take
a copy of it and use the copy.
Don't look for existing caches if we don't already have one. That gets
complicated.
Iain Patterson [Mon, 4 Jan 2010 15:29:02 +0000 (15:29 +0000)]
Whitespace.
Iain Patterson [Mon, 4 Jan 2010 14:48:32 +0000 (14:48 +0000)]
Match CursorColumn highlighting to CursorLine.
Iain Patterson [Mon, 10 Aug 2009 10:36:51 +0000 (11:36 +0100)]
Added git submit alias.
Alias git submit to ``git commit -vuno''.
Iain Patterson [Sun, 3 Jan 2010 15:48:07 +0000 (15:48 +0000)]
Allow forcing source of .bash_profile.
By default .bash_profile is sourced only if we have a controlling
terminal or the shell is a login shell. Add the ability to force
sourcing by passing the "force" argument to the source command.
. ~/.bash_profile force
For use in situations where no terminal is available but a full
environment setup is required.
Iain Patterson [Thu, 17 Dec 2009 10:52:04 +0000 (10:52 +0000)]
Decide whether or not a terminal can be resized.
Use resize.bashrc to set the RESIZABLE environment variable.
If RESIZABLE is 0 the current terminal cannot be resized.
If RESIZABLE is the same as TERM in can be resized.
Maintain a list of terminals we know can't be resized, eg sun-color.
Maintain a list of terminals which we can't be sure about, eg screen
since whether or not screen can be resized depends on the (unknown)
capabilities of the underlying terminal.
For any other terminal assume it can be resized.
In vim, set the g:resizable variable based on the value of RESIZABLE
(and set it to 1 in the GUI). Call Can_Resize() before trying to resize
the window.
Allow setting g:resizable manually to override this logic.
Iain Patterson [Thu, 10 Dec 2009 14:53:39 +0000 (14:53 +0000)]
Remove gratuitous exports.
Don't export variables which exist only for the shell's benefit.
Iain Patterson [Wed, 9 Dec 2009 16:12:43 +0000 (16:12 +0000)]
Ignore dups in history.
Iain Patterson [Fri, 10 Jul 2009 15:17:59 +0000 (16:17 +0100)]
New Vim script for P4 merge.
Iain Patterson [Mon, 7 Dec 2009 15:43:39 +0000 (15:43 +0000)]
Windows 64-bit compatibility.
Native 64-bit builds of Vim define win64. Check for that in addition to
win32 when determining if we are on Windows.
Iain Patterson [Mon, 7 Dec 2009 15:32:49 +0000 (15:32 +0000)]
Use a shorter title string on Windows.
Titles must fit on to taskbar entries which are usually short.
Iain Patterson [Sun, 22 Nov 2009 15:28:53 +0000 (15:28 +0000)]
Added git again alias.
Alias git again to ``git commit --amend -C HEAD''.
Iain Patterson [Wed, 18 Nov 2009 16:04:21 +0000 (16:04 +0000)]
Remove absolute paths from ts.
Paths should have been set correctly by shell startup. Leaving them in
breaks cross-platform compatibility.
Iain Patterson [Wed, 18 Nov 2009 15:46:57 +0000 (15:46 +0000)]
Fix missing exit code in prompt.
The exit code from the last command was not being shown when the command
failed. This was a bug introduced by the fixing of escape sequences for
iTerm.
Iain Patterson [Thu, 15 Oct 2009 14:13:22 +0000 (15:13 +0100)]
Remove broken urxvt vimselection plugin.
Half the time it doesn't work and we end up pasting junk into another
window.
Iain Patterson [Thu, 15 Oct 2009 10:09:44 +0000 (11:09 +0100)]
Show more information in screen status.
Show server load in hardstatus.
Show date in window list.
Iain Patterson [Thu, 12 Nov 2009 15:59:08 +0000 (15:59 +0000)]
Allow xterm window resizing.
Red Hat disables window resizing through xterm escape sequences.
Explicitly re-enable this functionality.
Iain Patterson [Thu, 12 Nov 2009 20:33:57 +0000 (20:33 +0000)]
Mantis 361
Hack to make dark grey actually dark when Vim is run under screen in an
88-colour terminal.
Iain Patterson [Wed, 4 Nov 2009 22:01:40 +0000 (22:01 +0000)]
Fix diffs of files with spaces.
Show diffs correctly in p4 and svn Vim scripts when files to diff contain spaces.
Iain Patterson [Wed, 4 Nov 2009 17:19:15 +0000 (17:19 +0000)]
Handle case where tput doesn't work.
Iain Patterson [Mon, 26 Oct 2009 14:36:52 +0000 (14:36 +0000)]
Fix prompt escape sequences for iTerm.
iTerm doesn't like setting bold/normal and colour change at the same
time. Trying to do so yields broken colour settings with blinking and
other strangeness.
Fix it by splitting bold information from the requested colour escape
sequence and setting both separately.
Iain Patterson [Mon, 5 Oct 2009 16:01:38 +0000 (17:01 +0100)]
Signs tidyup.
Maintain a list of signs and (un)define them dynamically.
We don't have arrays in Vim 6 so use some string trickery for this.
Place signs in a loop and replace Prep_Signs() with calls to Prep_Sign()
within the sign loop.
Iain Patterson [Tue, 6 Oct 2009 09:27:26 +0000 (10:27 +0100)]
Vim 5 parser strangeness.
Protect unsupported "silent" command in an exec.
This is necessary even though the command is called in a block only
executed by Vim 6 or later.
Iain Patterson [Tue, 6 Oct 2009 10:08:26 +0000 (11:08 +0100)]
Highlight cursor line when focus is lost.
Set cursorline on FocusLost.
Unset cursorline on FocusGained iff it wasn't set before focus was lost.
Iain Patterson [Fri, 18 Sep 2009 15:04:14 +0000 (16:04 +0100)]
Fix setting paths on old bash.
Prevent bash 2 from segfaulting when considering directories in
PATH.bashrc.
Iain Patterson [Fri, 18 Sep 2009 12:16:54 +0000 (13:16 +0100)]
Environment overhaul.
Store XXXdirs files in ~/.PATH and add subdirectories for SYSTEM and
ARCHITECTURE under there.
Remove duplicate entries from paths set in PATH.bashrc.
Also read XXXdirs.pre and XXXdirs.post.
.pre entries are guaranteed to come before whatever was already defined
or is defined with XXXdirs.
.post entries are guaranteed to be present but may not necessarily be
last if they were already defined.
Add paths under opt to default XXXdirs.pre files.
Add /lib to libdirs.post on Solaris as the Solaris linker uses the value
of LD_LIBRARY_PATH to override system defaults.
Iain Patterson [Tue, 15 Sep 2009 12:59:34 +0000 (13:59 +0100)]
Don't use SCREENDIR under sudo.
If SCREENDIR is set and we sudo the directory will probably be
unusable. Unset it if SUDO_USER is defined.
Iain Patterson [Tue, 1 Sep 2009 15:08:57 +0000 (16:08 +0100)]
Don't resize urxvt to zero-size.
Iain Patterson [Tue, 1 Sep 2009 10:56:55 +0000 (11:56 +0100)]
Detect old bash which can't do completion.
Iain Patterson [Fri, 28 Aug 2009 13:07:51 +0000 (14:07 +0100)]
Find urxvt extensions from sshterm.
Change to $HOME before launching sshterm.
XXX: This might break stuff as we previously changed to root to
avoid holding unnecessary NFS handles.
Iain Patterson [Wed, 26 Aug 2009 10:03:27 +0000 (11:03 +0100)]
BufExplorer options.
Default options and highlighting for the BufExplorer plugin.
Iain Patterson [Wed, 26 Aug 2009 10:02:26 +0000 (11:02 +0100)]
Added -t flag to sshcolourterm.
Use -t to set the initial title of the terminal window.
Iain Patterson [Fri, 21 Aug 2009 14:14:24 +0000 (15:14 +0100)]
Check for broken KRB5CCNAME.
Iain Patterson [Thu, 27 Aug 2009 12:02:40 +0000 (13:02 +0100)]
Perl extension to massage selections from Vim.
Try to strip off marks and numbers from the start of a selection made
within urxvt.
It's a bit hacky and assumes that Vim will resize the terminal when
displaying marks and numbers.
Iain Patterson [Thu, 27 Aug 2009 10:51:01 +0000 (11:51 +0100)]
Proper urxvt resizing.
Use Perl extension to dynamically change fontsets.
Note that because we can't put variables into the URxvt.perl-lib
resource we assume that urxvt is run from the home directory and can
thus find .urxvt in there.
Iain Patterson [Thu, 27 Aug 2009 09:38:45 +0000 (10:38 +0100)]
Use :silent instead of :try..:catch..:endtry.
Some early Vim 6 builds don't have :try..:endtry and since we weren't
doing anything useful with the :catch it's easier to use :silent.
Iain Patterson [Fri, 21 Aug 2009 14:09:30 +0000 (15:09 +0100)]
Window resizing fixes.
Fixed not shrinking the window when list was toggled off.
Use some trickery to avoid using winnr() on Vim 6.
Iain Patterson [Fri, 14 Aug 2009 13:26:37 +0000 (14:26 +0100)]
More display stuff.
Unicode alternative for caret sign.
Made Highlight_StatusLine() compatible with Vim 5.
There's still no point calling it with anything less than Vim 7.
Use User1 highlighting to emphasise filename, line and column.
Iain Patterson [Tue, 4 Aug 2009 13:41:53 +0000 (14:41 +0100)]
Netgroups.
Added netgroups.c since the netgroups binary is needed by sshcolourterm.
Be quiet checking netgroups in sshcolourterm. This allows, for example,
hacking sshcolourterm for an SGE terminal viz:
env SSHTERM_SSH=qrsh sshterm
Iain Patterson [Thu, 9 Jul 2009 10:31:38 +0000 (11:31 +0100)]
Various vim fixes.
Change some mappings which conflict with plugins.
Unicode in Show_List().
When a new buffer was created BufEnter called Highlight_Signs() which
called Uncluttered_Buffer(). Most of the tests in that function don't
apply until the buffer is completely set up so move the initial call to
Highlight_Signs() to BufReadPost.
Show version in verbose statusline.
Added Extra_Columns() function to determine if column resizing is necessary.
Use it after setting listchars.
Fold up functions.
Use Prep_Sign() to shorten Prep_Signs().
Use Prep_Var() to shorten Iain_Vars().
Iain Patterson [Wed, 29 Jul 2009 13:54:25 +0000 (14:54 +0100)]
Compview plugin.
Iain Patterson [Fri, 7 Aug 2009 18:22:17 +0000 (19:22 +0100)]
Grow a column when setting full list mode.
Allow room for when listchars includes eol.
Iain Patterson [Fri, 7 Aug 2009 18:08:21 +0000 (19:08 +0100)]
Unicode stuff.
Force UTF-8 on Windows.
Move Unicode availability test to Has_Unicode() function.
Show Unicode signs where possible.
Iain Patterson [Wed, 5 Aug 2009 10:52:53 +0000 (11:52 +0100)]
Fix Vim runtime path when becoming another user.
Iain Patterson [Tue, 4 Aug 2009 10:41:03 +0000 (11:41 +0100)]
Vim 5 compatibility.
Vim 5 doesn't have printf() or v:servername.
Iain Patterson [Wed, 29 Jul 2009 13:11:32 +0000 (14:11 +0100)]
Swap jump keys.
Iain Patterson [Thu, 9 Jul 2009 10:42:35 +0000 (11:42 +0100)]
VCSCommand plugins.
Iain Patterson [Thu, 16 Jul 2009 09:55:55 +0000 (10:55 +0100)]
Script to become another user.
Set per-user initialisation in ~/.become/<user>.
Iain Patterson [Tue, 4 Aug 2009 12:39:47 +0000 (13:39 +0100)]
CJK font support.
Iain Patterson [Tue, 4 Aug 2009 14:54:40 +0000 (15:54 +0100)]
colordiff.
Iain Patterson [Thu, 23 Jul 2009 16:54:45 +0000 (17:54 +0100)]
Consistent screen caption on different terminals.
The inactive caption line didn't look the same in xterm and PuTTY as it
did in rxvt-unicode. Instead of using bold and reverse for the black on
white text we now explicitly set white on high-intensity black. The
result unchanged in rxvt-unicode and now looks the same in other
terminals.
PuTTY needs an explicit C8 termcapinfo to use bold for high-intensity.
Iain Patterson [Fri, 24 Jul 2009 16:54:07 +0000 (17:54 +0100)]
BufExplorer plugin.
Iain Patterson [Wed, 22 Jul 2009 09:31:12 +0000 (10:31 +0100)]
Vim options.
Added smarttab option.
Use hex mode for ^A/^X. Numbers with leading zeros are interpreted as
octals by default. Usually this is the wrong thing. Setting hex mode
works most of the time.
Don't jump to the start of the line when using H, L etc.
Use UTF-8 listchars. [git://github.com/graywh/dotfiles.git]
Iain Patterson [Wed, 22 Jul 2009 09:31:02 +0000 (10:31 +0100)]
Fixed diff colours.
Diffs could clash with the underlying syntax.
Iain Patterson [Thu, 9 Jul 2009 09:19:34 +0000 (10:19 +0100)]
More signs.
Highlight the (, ), { and } marks.
Highlight the ^ mark in red.
Iain Patterson [Thu, 9 Jul 2009 14:25:11 +0000 (15:25 +0100)]
Set diff mode columns sensibly.
Iain Patterson [Tue, 14 Jul 2009 09:28:59 +0000 (10:28 +0100)]
Added ts script.
Script to show files modified today. (t)oday l(s): ts.
Iain Patterson [Thu, 9 Jul 2009 15:14:04 +0000 (16:14 +0100)]
Windows compatibility.
Handle the case where HOME contains spaces, eg on NT 5.
Force the Vim runtime path to contain ~/.vim.
Iain Patterson [Fri, 26 Jun 2009 16:58:37 +0000 (17:58 +0100)]
Handle uncluttered buffers.
Don't set signs and numbers if Uncluttered_Buffer() returns true.
A buffer is uncluttered if the uncluttered_buffer variable is true.
A buffer is uncluttered if buftype is non-null.
A buffer is uncluttered if its filetype is svn, perforce or gitcommit.
Iain Patterson [Wed, 8 Jul 2009 14:57:55 +0000 (15:57 +0100)]
Vim fixes.
Don't set mouse options if we can't get the X11 clipboard.
Don't set the toolbar in gvim.
Ensure we call Startup_Resize() AFTER signs and numbers have been set.
Scope fix in TabModified().
Iain Patterson [Wed, 8 Jul 2009 14:52:52 +0000 (15:52 +0100)]
Colour tweaks.
Added colours for NERD_tree.
256-colour LineNr and friends were too dark.
StatusLine and StatusLineNC weren't consistent.
Moved MatchParen highlighting into the colourscheme.
Iain Patterson [Wed, 8 Jul 2009 14:42:35 +0000 (15:42 +0100)]
Use -bg for background colour.
Launch terminal with the correct background colour using the -bg option.
Force a black internal border for urxvt so that different coloured
terminals don't look weird with Vim marks and numbers.