pltraining-userprefs


Ⅰ. 插件描述

Set user preferences for shell and editor.

Ⅱ. 基本信息

创建日期:  2014-01-31
使用用户:  1
Github星:  3
插件作者:  Puppet

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'puppetlabs/pltraining-userprefs'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'puppetlabs/pltraining-userprefs'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'puppetlabs/pltraining-userprefs'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/puppetlabs/pltraining-userprefs

Ⅳ. 文档说明

# userprefs

A simple module that allows users to choose their default editor and, on Linux, default shell.

About

This will ensure that the proper packages are installed, the configuration files that enable syntax highlighting are written, helpful shell aliases are enabled, and the default editor and shell are set.

Class: userprefs

editor

An optional String indicating the default editor to be set in the user's environment. The choices are platform specific.

Default: undef

Linux valid choices are: 'vim', 'mg', 'nano', or 'emacs'

Windows valid choices are: 'gvim', 'atom', 'sublimetext', or 'npp'

shell (Linux only)

An optional String indicating the shell for the user. Attempting to set this parameter for a Windows machine will cause a catalog compilation failure.

Default: undef

Linux valid choices are: 'bash' or 'zsh'

gitprompt (Linux only)

Boolean specifying whether or not Linux shells should use a default command prompt that includes information about the current git status. Attempting to set this on Windows will be ignored.

Default: true

Example usage:

Customizing the environment:


    class { 'userprefs':
      shell  => 'zsh',  # Linux only - root user's login shell
      editor => 'vim',  # Linux and Windows - default file editor
    }

Classifying a Linux (only) node with classroom defaults:


    include userprefs::defaults  # Linux only

Classifying a Linux (only) node with specific vim options:


    class { 'userprefs::vim':  # Linux only
      monochrome  => true,   # Disable syntax highlighting
      line_number => false,  # Disable display of line numbers
    }

Contact

  • ben.ford@puppet.com
  • js@puppet.com
  • education@puppet.com

添加新评论