Giter Site home page Giter Site logo

sysctl.el's Introduction

sysctl.el

MELPA

View and edit sysctl in a hierarchical structure in Emacs. Works on Linux, FreeBSD, OpenBSD, and macOS. Will work over TRAMP via SSH as well, including multiple hops.

sysctl example

Commands

sysctl Generate the sysctl buffer

Keybindings

  • C-c C-c Set the value of current position in the sysctl tree
  • C-c C-k Refresh the value of current position in the sysctl tree

sysctl.el's People

Contributors

dantecatalfamo avatar riscy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sysctl.el's Issues

feature request: item and value on the same line using org-columns

I don't use this package very much but I suggest showing the item and value on the same line. org makes this possible using the built-in org-columns.

I have made a modification that achieves this. The following code:

  • inserts metadata for org-columns rendering
  • tells org-mode to show all headers and subheaders ("content")
  • increases the depth by one
  • encodes the sysctl item value as a org-property ":VALUE:", for org-columns input.
  • moves the cursor back to the top of the buffer
(defun sysctl-construct-tree (lines-list)
  "Turn LINES-LIST into an org hierarchy."
  ;; org-columns formatting
  (insert "* sysctl\n")
  (insert ":PROPERTIES:\n"
          ":COLUMNS: %40ITEM(Item) %80VALUE(Value)" "\n"
          ":END:\n"
          "#+STARTUP: content\n")
  (let (path)
    (dolist (line lines-list)
      (let ((line-path (car line))
            (line-value (cdr line))
            (depth 1))
        (while line-path
          (unless (string= (nth (- depth 1) path)
                           (car line-path))
            (insert (concat (make-string (+ 1 depth) ?*) " " (car line-path) "\n"))
            (sysctl--readonly-previous-line))
          (setq line-path (cdr line-path)
                depth (1+ depth)))
        (setq path (car line))
        (insert (concat ":PROPERTIES:\n" ;; shown as org-property for org-column
                        ":VALUE: " line-value "\n"
                        ":END:\n")))))
 (goto-line 0))

How to use it:

  1. Redefine sysctl-construct-tree as shown above.
  2. M-x sysctl
  3. C-u C-c C-x C-c (org-columns) to turn on org-columns mode and show the item and value org-column overlay.
  4. Press q anywhere on the overlays to remove org-columns overlays.

Pros:

  • Able to see the item name and value on one line
  • Able to leverage org-columns editing mode

Cons:

  • Does not work for multi-line entries.
  • Not yet working for org-column editing mode

Tested on:

  • Emacs 26.1
  • org-plus-contrib 20191230 package
  • Debian 10 Linux x64

References:
https://orgmode.org/manual/Column-view.html
https://orgmode.org/worg/org-tutorials/org-column-view-tutorial.html

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.