Giter Club home page Giter Club logo

hot.nvim's Introduction

Hot

Hot

๐Ÿ”ฅ A hot reloader that works with any programming language.


๐Ÿ’• Community

๐Ÿป Join the community: Discord


๐ŸŽž๏ธ DEMO

hifi tui


โœจ Features

  • Zero Dependencies

  • Highly Customizable

  • Multiple Languages & Unittest Reloader on the fly

  • Start | Stop | Silent | Real Time Debug | Buffer Open / Close Reload on Save

  • Userscript for the Browser.

  • Custom Healthchecker

  • Lualine (Status Bar) Plugin


๐Ÿ“ฆ Installation

Note

Install the plugin with your preferred package manager.

๐Ÿ’ค lazy.nvim

hot.nvim
    -- Enable Current directory 
    vim.opt.autochdir == true,

    {
        'sachinsenal0x64/hot.nvim',
        config = function()
          local opts = require('hot.params').opts
  
          -- Update the Lualine Status
          Reloader = opts.tweaks.default
          Reloader = '๐Ÿ’ค'
  
          Pattern = opts.tweaks.patterns
          Pattern = { 'main.py', 'main.go' }
  
          opts.tweaks.start = '๐Ÿš€'
          opts.tweaks.stop = '๐Ÿ’ค'
          opts.tweaks.test = '๐Ÿงช'
          opts.tweaks.test_done = '๐Ÿงช.โœ…'
          opts.tweaks.test_fail = '๐Ÿงช.โŒ'
  
          -- If the 'main.*' file doesn't exist, it will fall back to 'index.*'
          opts.tweaks.custom_file = 'index'
  
          -- Add Languages
          opts.set.languages.python = {
            cmd = 'python3',
            desc = 'Run Python file asynchronously',
            kill_desc = 'Kill the running Python file',
            emoji = '๐Ÿ',
            test = 'python -m unittest -v',
            ext = { '.py' },
          }
  
          opts.set.languages.go = {
            cmd = 'go run',
            desc = 'Run Go file asynchronously',
            kill_desc = 'Kill the running Go file',
            emoji = '๐Ÿน',
            test = 'go test',
            ext = { '.go' },
          }
  
          -- Thot Health Check
          vim.api.nvim_set_keymap('n', 'ho', '<Cmd>lua require("thot").check()<CR>', { noremap = true, silent = true })
  
          -- Keybinds
  
          -- Start
          vim.api.nvim_set_keymap('n', '<F3>', '<Cmd>lua require("hot").restart()<CR>', { noremap = true, silent = true })
          -- Silent
          vim.api.nvim_set_keymap('n', '<F4>', '<Cmd>lua require("hot").silent()<CR>', { noremap = true, silent = true })
          -- Stop
          vim.api.nvim_set_keymap('n', '<F5>', '<Cmd>lua require("hot").stop()<CR>', { noremap = true, silent = true })
          -- Test
          vim.api.nvim_set_keymap('n', '<F6>', '<Cmd>lua require("hot").test_restart()<CR>', { noremap = true, silent = true })
          -- Close Buffer
          vim.api.nvim_set_keymap('n', '<F8>', '<Cmd>lua require("hot").close_output_buffer()<CR>', { noremap = true, silent = true })
          -- Open Buffer
          vim.api.nvim_set_keymap('n', '<F7>', '<Cmd>lua require("hot").open_output_buffer()<CR>', { noremap = true, silent = true })
  
          -- Auto Reload on Save
  
          local save_group = vim.api.nvim_create_augroup('save_mapping', { clear = true })
          vim.api.nvim_create_autocmd('BufWritePost', {
            desc = 'Reloader',
            group = save_group,
            pattern = Pattern,
            callback = function()
              require('hot').silent()
            end,
          })
        end,
      },

โšก lualine.nvim

status bar
 
local hot = {
          'Reloader',
        },

sections = {

    lualine_b = {
            hot,
   }
},   

๐Ÿต violentmonkey

userscript for browser live reloading
// ==UserScript==
// @name         Hot
// @namespace    https://github.com/sachinsenal0x64/hot.nvim
// @version      1.0
// @description  ๐Ÿ”ฅ A hot reloader for the Browser.
// @author       sachinsenal0x64
// @match        *://*.localhost:8086/*
// @match        *://*.atom.com/*
// @license      MIT
// @grant        none
// ==/UserScript==

(function() {
  'use strict';

  // Create a meta tag for auto-refresh
  var metaTag = document.createElement('meta');
  metaTag.setAttribute('http-equiv', 'refresh');
  metaTag.setAttribute('content', '5'); // Refresh every 5 seconds

  // Find the <head> element and append the meta tag to it
  var head = document.querySelector('head');
  head.appendChild(metaTag);
})();

๐Ÿ† Now you're ready to go! Hooray!


๐Ÿซ‚ Contributing

  • Feel free to send PR's regarding spelling mistakes, incorrect grammar etc.

hot.nvim's People

Contributors

sachinsenal0x64 avatar

Stargazers

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

Watchers

 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.