view doc/lawrencium.txt @ 46:6a4f5200d8da

`:Hg!` command changes: - Ability to edit in a normal buffer instead of the preview window. - Set syntax coloring according to the Mercurial command. - Updated the documentation. Miscellaneous cleanup. New pretty banner in the documentation. New "global settings" section in the documentation. Added `graphlog` syntax file.
author Ludovic Chabant <ludovic@chabant.com>
date Wed, 07 Nov 2012 07:14:15 -0800
parents fc20a265551d
children 85e39bdd7089
line wrap: on
line source

*lawrencium.txt*  Mercurial wrapper for VIM


            LLLLLLLLLLL                                                      ~
            L:::::::::L                                                      ~
            L:::::::::L                                                      ~
            LL:::::::LL                                                      ~
              L:::::L              rrrrr   rrrrrrrrr                         ~
              L:::::L              r::::rrr:::::::::r                        ~
              L:::::L              r:::::::::::::::::r                       ~
              L:::::L              rr::::::rrrrr::::::r                      ~
              L:::::L               r:::::r     r:::::r                      ~
              L:::::L               r:::::r     rrrrrrr                      ~
              L:::::L               r:::::r                                  ~
              L:::::L         LLLLLLr:::::r                                  ~
            LL:::::::LLLLLLLLL:::::Lr:::::r                                  ~
            L::::::::::::::::::::::Lr:::::r                                  ~
            L::::::::::::::::::::::Lr:::::r                                  ~
            LLLLLLLLLLLLLLLLLLLLLLLLrrrrrrr                                  ~

                LAWRENCIUM REFERENCE MANUAL
                    by Ludovic Chabant


                                                *lawrencium*

1.  Introduction            |lawrencium-intro|
2.  Commands                |lawrencium-commands|
3.  Status Window           |lawrencium-status-window|
4.  Global Settings         |lawrencium-global-settings|


=============================================================================
1.  Introduction                                *lawrencium-intro*

When a file from a Mercurial repository is open in a buffer, that buffer gets
new commands defined.

This plugin is only available if 'compatible' is not set.

Grab the latest version or report a bug on BitBucket:

http://bitbucket.org/ludovicchabant/vim-lawrencium



=============================================================================
2.  Commands                                    *lawrencium-commands*

All commands defined by |lawrencium| are local to each buffer.

                                                *:Hg*
:Hg {args}              Run an arbitrary Mercurial command. Similar to :!hg
                        [args] but the '--repository' is automatically
                        specified with the root of the repository the current
                        file belongs to, and it will auto-complete any
                        standard command or option.
                        
                        Also, unless the |lawrencium_auto_cd| global is set to
                        `0`, it will temporarily set the current directory to be
                        the root of the repository so that auto-completed
                        filenames work out of the box.

                                                *:Hg!*
:Hg! {args}             Like |:Hg|, but the output of the command is placed in
                        a temp file and edited in the |preview-window|, unless
                        the |lawrencium_hg_bang_edit_command| global setting
                        specifies that another type of window or buffer should
                        be used.

                        Once the output is open in a buffer, Lawrencium will
                        try to set the file type according to the Mercurial
                        command that was run. See |lawrencium_hg_commands_file_types|.

                                                *:Hgcd*
:Hgcd[!] {path}         |:cd| relative to the root of the repository.

                                                *:Hglcd*
:Hglcd[!] {path}        |:lcd| relative to the root of the repository.

                                                *:Hgedit*
:Hgedit {file}          |:edit| {file} relative to the root of the repository.

                                                *:Hgedit!*
:Hgedit! {file}         |:edit!| {file} relative to the root of the repository.

                                                *:Hgstatus*
:Hgstatus               Shows the output of 'hg status' in the
                        |preview-window|. Some extra-commands, along with some
                        default mappins, are available in this window. See
                        |lawrencium-status-window|.

                                                *:Hgdiff*
:Hgdiff                 Diffs the current file against its parent revision.

                                                *:Hgdiff_f*
:Hgdiff {revspec}       Diffs the current file against the specified revision.

                                                *:Hgvdiff*
:Hgvdiff                Same as |:Hgdiff| but uses a vertical split.

                                                *:Hgvdiff_f*
:Hgvdiff {revspec}      Same as |:Hgdiff_f| but uses a vertical split.

                                                *:Hgcommit*
:Hgcommit               Opens a new window to edit a commit message into a
                        temporary file and, upon quitting the buffer, if that
                        file has been written to, commit the current changes
                        to the repository.

                                                *:Hgvcommit*
:Hgvcommit              Same as |:Hgcommit| but uses a vertical split to edit
                        the commit message.

:Hgrevert {files}                               *:Hgrevert*
                        Reverts the given files (in repo-relative paths). If no
                        file are given, reverts the current file.

:Hgrevert! {files}                              *:Hgrevert!*
                        Same as |:Hgrevert| but with the --no-backup option
                        given to prevent a .orig backup file from being
                        created.


=============================================================================
3.  Status Window                               *lawrencium-status-window*

The `hg status` window opened by Lawrencium has a few special commands 
defined in it. Also, unless the global |lawrencium_define_mappings| is set to
`0`, some commands are mapped to keyboard shortcuts, as detailed in the
following descriptions.


                                                *:Hgstatusedit*
:Hgstatusedit           Open the file mentioned on the current line.
                        Mapped to <cr>.

                                                *:Hgstatusaddremove*
:Hgstatusaddremove      Run `hg addremove` on the file mentioned on the
                        current line, or on the lines currently selected in
                        visual selection mode (see |visual-start|).
                        Mapped to <C-A>.

                                                *:Hgstatusdiff*
:Hgstatusdiff           Open a diff window on the file mentioned on the
                        current line, between the working directory version
                        and the parent revision version. Similar to running
                        |:Hgdiff| on that file.
                        Mapped to <C-D>.

                                                *:Hgstatusvdiff*
:Hgstatusvdiff          Similar to |:Hgstatusdiff|, but use a vertical split.
                        Similar to running |:Hgvdiff| on that file.
                        Mapped to <C-V>.

                                                *:Hgstatuscommit*
:Hgstatuscommit         Runs |:Hgcommit| on the files currently mentioned in
                        the buffer, or in the current selection. The first 
                        option means you can delete lines from the buffer
                        until the remaining filenames are those you want to
                        commit.
                        Mapped to <C-S>.

                                                *:Hgstatusvcommit*
:Hgstatusvcommit        Similar to |:Hgstatuscommit|, but use a vertical
                        split, as with |:Hgvcommit|.
                        Not mapped byd default.

                                                *:Hgstatusrefresh*
:Hgstatusrefresh        Refreshes the status window by running `hg status`
                        again.
                        Mapped to <C-R>.

                                                *:Hgstatusqnew*
:Hgstatusqnew {patch} {message}.
                        If you have the 'mq' extension enabled, creates a new
                        patch with the file currently mentioned in the buffer,
                        or in the current selection. You must give a patch name,
                        and may optionally write a commit message for the patch
                        (without surrounding quotes).

                                                *:Hgstatusqrefresh*
:Hgstatusqrefresh       If you have the 'mq' extension enabled, refreshes the
                        current patch with the files currently mentioned in the
                        buffer, or in the current selection.

                                                *lawrencium-status-mappings*
A few other mappings are available in the status window:

   <C-N>                Jump to the next filename.
   <C-P>                Jump to the previous filename.
   q                    Quit the status window.



=============================================================================
4.  Global Settings                             *lawrencium-global-settings*

The following global settings can be defined in your |vimrc| to change the
default behaviour of Lawrencium.

                                                *lawrencium_hg_executable*
g:lawrencium_hg_executable
                        Defines the executable to run when running Mercurial
                        commands.
                        Defaults to simply `hg`.

                                                *lawrencium_auto_cd*
g:lawrencium_auto_cd    Specifies whether the current working directory should 
                        be set to the repository's root while running |:Hg|
                        commands so that auto-completion works magically with
                        repository relative paths.
                        Defaults to `1`.

                                                *lawrencium_define_mappings*
g:lawrencium_define_mappings
                        Specifies whether Lawrencium should define default
                        keyboard shortcuts.
                        Defaults to `1`.

                                                *lawrencium_hg_bang_edit_command*
g:lawrencium_hg_bang_edit_command
                        Defines the Vim command to run when using the |:Hg!|
                        command (with the bang) in order to show the output.
                        
                        Defaults to |pedit|, which opens the output of the
                        command in the |preview-window|. A good alternative
                        is to use |edit|, to open the output in a normal
                        buffer.

                                                *lawrencium_hg_commands_file_types*
g:lawrencium_hg_commands_file_types
                        Defines the |file-types| that Lawrencium should use
                        when editing the output of |:Hg!| based on the
                        Mercurial command that was used.
                        
                        By default, unless overridden, the following commands
                        map to the following file types:

                        diff                diff
                        graphlog            graphlog


 vim:tw=78:et:ft=help:norl: