Giter Club home page Giter Club logo

vim-selinux-suite's Introduction

This is a mirror of http://www.vim.org/scripts/script.php?script_id=5037

Vim SELinux suite is a collection of vim scripts to help you write SELinux policy modules.
It is composed of:
 - highlight syntax files for the SELinux filetypes;
 - a snippets file to use with the 'SnipMate' plugin (vimscript#2540). 
 - an utility (a filetype plugin) called 'setool'.

The setool utility lists all the SELinux interfaces/definitions/templates found on the system (On redhat/fedora, it is in the directory /usr/share/selinux/devel/include, provided by the package selinux-policy-devel), ordered by type, in a sidebar window.
The listings are built at runtime when they are first required (by unfolding or using one of the provided functions), and show each interface name, parameters and summary.
This help the user to choose which interface to use. The user can jump to the interface definition by double-clicking if he wants to inspect it.

This plugin also sets the variables makeprg and errorformat, so you can use the command ':make' to build a module. If an error is detected, the cursor position will be set to the corresponding line.

The plugin exposes three functions:
 - SEToolToggle() to show/hide the setool window;
 - SEToolSearch() to search the definition of the word under the cursor. If the word is found, the corresponding file is opened and setool is set to its position.
 - SEToolFind('word') to search for the given word instead of the word under the cursor.

The plugin defines some convenient keymaps for the buffers, to avoid calling the functions manually. They are written in the help menu of the setool window (press <F1> in setool).

Notes:
 - the setool window uses UTF8 characters as fold icons;
 - use the usual <Ctrl>C to stop an operation, for instance if a cache takes to much time to build;
 - do not try to unfold 'corenetwork.if': it contains too many interfaces and the cache takes to much time to build. Just double-click to open the file, and use the command 'setl fdm=expr' to fold.
 - the setool window always starts with everything folded, even when toggled off/on. It is the expected behavior.


vim-selinux-suite's People

Contributors

yedvilun avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.