Git Product home page Git Product logo

telescope-ports.nvim's Introduction

๐Ÿ”ญ telescope-ports.nvim

Shows ports that are open on your system and gives you the ability to kill their process.(linux only)

Demo

output.mp4

Installation

Vim-Plug

Plug "rcarriga/nvim-notify"
Plug "nvim-telescope/telescope.nvim"
Plug "LinArcX/telescope-ports.nvim"

Packer

use { 'rcarriga/nvim-notify', branch = "master" }
use { "nvim-telescope/telescope.nvim" }
use { "LinArcX/telescope-ports.nvim" }

Setup and Configuration

require('telescope').load_extension('ports')

Usage

:Telescope ports

Default mappings (insert mode):

Key Description
c-k kill current process

Default mappings (normal mode):

Key Description
c-k kill current process

Usage

:Telescope command_palette.

SUDO_ASKPASS

telescope-ports.nvim uses sudo internally, so we need to setup an askpass helper for it.

I use gnome-ssh-askpass but you can use other alternatives like: lxqt-openssh-askpass

Just add this line into your .bashrc or .zshrc:

export SUDO_ASKPASS=/usr/bin/gnome-ssh-askpass

Open ports for testing

You can use this python script to open a specific port:

import socket;

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM);

s.bind(('0.0.0.0', 1013));
s.listen(1);

conn, addr = s.accept();

print('Connected with ' + addr[0] + ':' + str(addr[1]))

Contribution

If you have any idea to improve this project, please create a pull-request for it. To make changes consistent, i have some rules:

  1. Before submit your work, please format it with StyLua.

    1. Just go to root of the project and call: stylua .
  2. There should be a one-to-one relation between features and pull requests. Please create separate pull-requests for each feature.

  3. Please use snake_case for function names ans local variables

  4. If your PR have more than one commit, please squash them into one.

  5. Use meaningful name for variables and functions. Don't use abbreviations as far as you can.

Roadmap ๐Ÿš™

  • This plugin should work on windows.
  • Not all systme use sudo. There are other alternatives. There should be a mechanism to distinguish between these alternatives and behave uniformly with all of them.

telescope-ports.nvim's People

Contributors

linarcx avatar

Stargazers

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

Watchers

 avatar  avatar

telescope-ports.nvim's Issues

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.