{"id":13596096,"url":"https://github.com/kaushalmodi/eless","last_synced_at":"2025-04-09T19:04:27.182Z","repository":{"id":20276236,"uuid":"89354644","full_name":"kaushalmodi/eless","owner":"kaushalmodi","description":"A Better 'less' - A bash script that loads emacs with minimal view-mode config - Created with Org mode","archived":false,"fork":false,"pushed_at":"2022-02-16T04:06:08.000Z","size":3930,"stargazers_count":135,"open_issues_count":6,"forks_count":10,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-04T15:44:30.529Z","etag":null,"topics":["bash-script","emacs","emacs-lisp","less","literate-programming","org-babel","org-mode","org-tangle"],"latest_commit_sha":null,"homepage":"https://eless.scripter.co","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kaushalmodi.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":"CONTRIBUTING.org","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-25T11:50:18.000Z","updated_at":"2025-04-02T01:08:41.000Z","dependencies_parsed_at":"2022-07-25T07:17:06.301Z","dependency_job_id":null,"html_url":"https://github.com/kaushalmodi/eless","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaushalmodi%2Feless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaushalmodi%2Feless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaushalmodi%2Feless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaushalmodi%2Feless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaushalmodi","download_url":"https://codeload.github.com/kaushalmodi/eless/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248095017,"owners_count":21046770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash-script","emacs","emacs-lisp","less","literate-programming","org-babel","org-mode","org-tangle"],"created_at":"2024-08-01T16:02:07.954Z","updated_at":"2025-04-09T19:04:27.152Z","avatar_url":"https://github.com/kaushalmodi.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"#+title: Eless - A Better Less\n#+author: Kaushal Modi\n[[https://github.com/kaushalmodi/eless/actions][https://github.com/kaushalmodi/eless/actions/workflows/test.yml/badge.svg]]\n\n[[https://eless.scripter.co][*Documentation*]]\n\n-----\n\n[[https://github.com/kaushalmodi/eless][*eless*]] is a combination of Bash script and a minimal emacs\n=view-mode= config.\n\nThis script is designed to:\n\n- Be portable -- Just one bash script to download to run\n- Be independent of a user's emacs config\n  - /You can still [[https://eless.scripter.co/#user-config-override][customize]] the =eless= config if you like./\n- Not require an emacs server to be already running\n\nIt was created out of a need to have something /like/ =less= (in the\nsense of /launch quickly, do, and quit/), but /better/ in these ways:\n\n- Syntax highlighting\n- Org-mode file rendering\n- A better navigable man page viewer\n- A better Info viewer\n- Dired, especially =wdired= (batch edit symbolic links, for\n  example?)\n- Colored diffs, =git diff=, =git log=, =ls=, etc. (auto ANSI\n  detection)\n- Filter log files to only show (or not show) lines matching a regexp\n- Auto-revert log files when I want (like =tail -f=)\n- Quickly change frame and font sizes\n- .. and more; basically everything that emacs has to offer!\n\nI call it =eless= and here's a little taste of what it looks like:\n\n[[https://raw.githubusercontent.com/kaushalmodi/eless/master/docs/images/eless-examples.png][https://raw.githubusercontent.com/kaushalmodi/eless/master/docs/images/eless-examples.png]]\n\n/Shown above, starting from top left image and proceeding clock-wise../\n- =eless eless.org=\n- =rg --color=ansi 'man pages' | eless= (rg[[https://github.com/BurntSushi/ripgrep][?]])\n- =man grep= (I have set my =PAGER= env var to =eless=.)\n- =info eless= (I have aliased =info= to ='\\info \\!* | eless'= in my\n  tcsh shell.)\n- =eless .= (Shows the current directory contents in =dired=.)\n- =diff= of =eless.org= with an older saved version and piping the\n  result to =eless=\n\n*Meta Features*\n\n- [X] This script passes [[https://www.shellcheck.net][ShellCheck]], and\n- [X] Unofficial Bash /strict mode/[fn:1] is enabled.\n- [X] Always-in-sync documentation as the =eless= script and\n  documentation are generated using Org Babel from [[https://github.com/kaushalmodi/eless/blob/master/eless.org][one file]] (even this\n  README).\n- [X] The [[https://eless.scripter.co][documentation site]] is generated on-the-fly on Netlify using\n  that same /one file/.\n- [X] This bash script has tests too!\n\n[fn:1] ~http://redsymbol.net/articles/unofficial-bash-strict-mode/~\n* Requirements\n|-----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Software  | Details                                                                                                                                                                                                                                                               |\n|-----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| =emacs=   | If only *running* the =eless= script, the mininum required emacs version is 22.1 (manually tested). If *developing* (running =make all html test=), the minimum required version is *25.3*.                                                                           |\n| =bash=    | This is a =bash= script. So even if you don't use =bash= shell, you need to have the =bash= binary discoverable through your environment variable =PATH=. /Tested to work in =tcsh= shell on RHEL 6.6./                                                               |\n| =perl=    | Perl is used to replace =grep -Po= and case-insensitive =sed= based replacements (using =/I=) as those features are available only in GNU versions of =grep= and =sed= (which are not present by default on /macOS/ systems). /Tested with Perl v5.16.3 on RHEL 6.6./ |\n| =texinfo= | Required to generate the eless Info manual (when doing =make install=)                                                                                                                                                                                                |\n|-----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n\n- NOTE 1 :: If the environment variable =EMACS= is set, =eless= uses\n     that as the emacs binary, else it defaults to using =emacs= as emacs\n     binary.\n- NOTE 2 :: ~eless~ is known to not work with /info (texinfo) 6.1/ (see\n     =eless= issue #[[https://github.com/kaushalmodi/eless/issues/35][35]]). If you want to use ~eless~ to view Info manuals,\n     ensure that it is at least version *6.5*.\n* Installation\n** Manual installation\n*** Clone this rep\nFor the following instructions, let's assume that you clone this repo\nto =~/downloads/eless=.\n#+begin_src shell\ngit clone https://github.com/kaushalmodi/eless ~/downloads/eless\n#+end_src\n*** Run ~make~\n#+begin_src shell\ncd ~/downloads/eless\nmake install PREFIX=~/.local\n#+end_src\n*** Installation Directory Structure\nThe above ~make install~ will install the ~eless~ script and\ndocumentation in a directory structure like this:\n#+begin_example\n\u003cPREFIX\u003e\n    ├── bin/\n    │    └── eless\n    └── share/\n         └── eless/\n              ├── eless.org\n              └── info/\n                   ├── eless.info\n                   └── dir\n#+end_example\n- NOTE :: Make sure that you add ~\u003cPREFIX\u003e/bin/~ directory to your\n     ~PATH~ environment variable and ~\u003cPREFIX\u003e/share/eless/info/~ to\n     ~INFOPATH~.\n*** Uninstallation\nAssuming that you used ~PREFIX=~/.local~ in the [[#installation-make][Run =make=]] step above,\nuninstall it using the same ~PREFIX~:\n#+begin_src shell\ncd ~/downloads/eless\nmake uninstall PREFIX=~/.local\n#+end_src\n** Homebrew users\n[[https://brew.sh/][Homebrew]] users can install ~eless~ using:\n#+begin_example\nbrew install eless\n#+end_example\n* Try it out\nHere are some usage examples:\n#+begin_src shell\neless foo.txt                         # Open foo.txt in eless in terminal (-nw) mode by default.\neless foo.txt --gui                   # Open foo.txt in eless in GUI mode.\necho 'foo' | eless                    #\necho 'foo' | eless -                  # Same as above. The hyphen after eless does not matter; is anyways discarded.\ngrep 'bar' foo.txt | eless            #\ndiff foo bar | eless                  # Colored diff!\ndiff -u foo bar | eless               # Colored diff for unified diff format\neless .                               # Open dired in the current directory (enhanced 'ls')\nls --color=always | eless             # Auto-detect ANSI color codes and convert those to colors\nPAGER=eless git diff                  # Show git diff with ANSI coded colors\neless -h | eless                      # See eless help ;-)\ninfo emacs | eless                    # Read emacs Info manual in eless\neless foo.tar.xz                      # Read the contents of archives; emacs does the unarchiving automatically\nPAGER=eless python3; help('def')      # Read (I)Python keyword help pages (example: help for 'def' keyword)\nPAGER=eless python3; help('shlex')    # Read (I)Python module help pages (example: help for 'shlex' module)\nPAGER=eless python3; help('TYPES')    # Read (I)Python topic help pages (example: help for 'TYPES' topic)\nPAGER=eless man grep                  # Launches man pages in eless (terminal mode), if the env var PAGER is set to eless (does not work on macOS).\nPAGER=less man -P eless grep          # Launches man pages in eless (terminal mode), if the env var PAGER is *not* set to eless (works on macOS).\nPAGER=\"eless --gui\" man grep          # Launches man pages in eless (GUI mode), if the env var PAGER is set to \"eless --gui\" (does not work on macOS).\nPAGER=less man -P \"eless --gui\" grep  # Launches man pages in eless (GUI mode), if the env var PAGER is *not* set to eless (works on macOS).\n#+end_src\n- NOTE :: Above examples are tested to work in a *=bash=\n     shell*. Specifically, examples like ~PAGER=eless man grep~ might\n     need to be adapted for the shell you are using, [[#example-eless-config-in-bash][and also the OS]].\n* Contributors\n- Thanks to [[https://github.com/sshaw][Skye Shaw]] for helping improving =eless=\n  so that it can run on /macOS/ and emacs 22.1, and suggesting Bash\n  =trap=.\n- Thanks to [[https://github.com/iqbalansari][Iqbal Ansari]] for adding support to\n  read piped data in =emacs -Q -nw=.\n- Thanks to [[https://github.com/alphapapa][Adam Porter]] for adding a =bash=\n  /collapsing function/ for debug statements, and testing out and\n  providing suggestions on improving the =eless= build flow.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaushalmodi%2Feless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaushalmodi%2Feless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaushalmodi%2Feless/lists"}