Coder Social home page Coder Social logo

smabbasht / swift-n Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 27 KB

A tool to open file or directory in your editor by finding fuzzily the file and zoxiding into the directory provided

License: GNU General Public License v3.0

Shell 100.00%
fzf linux nvim workflow zoxide

swift-n's Introduction

The Swift n

The Swift n is a nice little tool to open files or directory in your favourite editor in a blazingly fast way โšก
It basically allows you to find fuzzily the file and zoxide into the relevant directory if provided giving you workflow the ultimate smoothness ๐ŸŒŠ

Usage

There are multiple ways to open your file or folder to ensure that you get your setup in minimum steps:

n
opens fzf interface and opens selected file from fzf in your editor.

n [search-pattern]
opens fzf with search-pattern as query and opens selected file from fzf in your editor.

n [folder-name] [search-pattern]
zoxides into folder-name, opens fzf interface in that directory and opens the selection from fzf in your editor.

n [folder-name] .
zoxides into folder-name and opens that directory in your editor.

Pre-requisites:

There are two tools that need to be installed in order for Swift n to work; fzf and zoxide. Both the tools can be found in most linux distributions' official package repositories. For popular distributions; the installation commands are as follow:

Github Repositories: | fzf | zoxide |

  • For Arch Linux & Arch-Based Distros:
sudo pacman -S fzf zoxide
  • For Debian and Debian-Based Distros:
sudo apt install fzf zoxide
  • For Fedora
sudo dnf install fzf zoxide

Install

There are a few easy steps to install the tool which are as follows:

  1. Clone the repository in your preferred directory:
git clone https://github.com/smabbasht/swift-n
  1. Rename variable editor in the script n. The editor is by default set to nvim, you can rename it as per you need for e.g: vim, code, clion etc.
  2. Add script n to your path: You will have to add the script n to your path in order to directly use it from anywhere:
    • If you use Fish, add this in your ~/.config/fish/config.fish:
    fish_add_path /path/to/swift-n
    • If you use Bash, add this in your ~/.bashrc
    export PATH="/path/to/swift-n:$PATH"
    • If you use Zsh, add this in your ~/.zshrc
    export PATH=$PATH:/path/to/swift-n

Plan

The plan is to extend this helper tool to make it a tmux-session helper too. This option will be invoked using flags. I want suggestions on as to do it or not since those who don't use TMUX might find this an overkill.

Support

You can support this project by giving this repo a ๐ŸŒŸ and by sharing it with peers ๐Ÿ‘ฌ
PRs are highly encouraged ๐Ÿ™Œ

swift-n's People

Contributors

smabbasht avatar

Stargazers

 avatar  avatar

Watchers

 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.