Code Monkey home page Code Monkey logo

nuke.xplr's Introduction

Nuke: xplr file viewer and opener

Plugin for xplr: view and open files in apps by file type or mime

inspired by nnn file manager nuke plugin.

Installation

Install manually

  • Add the following line in ~/.config/xplr/init.lua

    local home = os.getenv("HOME")
    package.path = home
      .. "/.config/xplr/plugins/?/src/init.lua;"
      .. home
      .. "/.config/xplr/plugins/?.lua;"
      .. package.path
  • Clone the plugin

    mkdir -p ~/.config/xplr/plugins
    
    git clone https://github.com/Junker/nuke.xplr ~/.config/xplr/plugins/nuke

Install with xpm

require("xpm").setup({
  plugins = {
    'dtomvan/xpm.xplr',
    'Junker/nuke.xplr'
  }
})

Usage

require("nuke").setup()

-- Or

require("nuke").setup{
  pager = "more", -- default: less -R
  open = {
    run_executables = true, -- default: false
    custom = {
      {extension = "jpg", command = "sxiv {}"},
      {mime = "video/mp4", command = "vlc {}"},
      {mime_regex = "^video/.*", command = "smplayer {}"}
      {mime_regex = ".*", command = "xdg-open {}"}
    }
  },
  view = {
    show_line_numbers = true, -- default: false
  },
  smart_view = {
    custom = {
      {extension = "so", command = "ldd -r {} | less"},
    }
}

Key bindings

  local key = xplr.config.modes.builtin.default.key_bindings.on_key
  
  key.v = {
    help = "nuke",
    messages = {"PopMode", {SwitchModeCustom = "nuke"}}
  }
  key["f3"] = xplr.config.modes.custom.nuke.key_bindings.on_key.v
  key["enter"] = xplr.config.modes.custom.nuke.key_bindings.on_key.o

Recomended tools

File type Open Smart View Info view
* exiftool/file
Image viu/timg/chafa/cacaview viu/chafa/catimg/img2txt mediainfo
Video mpv/mplayer mediainfo/mplayer
Audio mpv/mplayer mediainfo/mplayer
PDF termpdf pdftotext exiftool
DJVU termpdf djvused exiftool
PostScript ps2ascii exiftool
Markdown glow/lowdown/mdless
HTML w3m/elinks/lynx
MS doc antiword/catdoc/wvWare
MS docx pandoc/libreoffice
MS xls xlhtml/xls2csv
MS xlsx libreoffice
Epub pandoc einfo

recomended terminal emulator with support of Terminal graphics protocol

View: bat/pygmentize/less
Hex view: hx/hexyl/huxd/hxl/hexdump

nuke.xplr's People

Contributors

junker avatar sayanarijit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.