Giter Site home page Giter Site logo

pseudo-projectile-plugin's Introduction

ARCHIVED

I archived this project as jumping is a solved issue. I extracted the git check into the project git-check. That part was better suited as a zsh hook. I will look into the other plans like running a dev server on cd in the future in another project.

Pseudo Projectile Plugin for zsh

Quickly jump between paths you regularly use
Video showing general usage

Git Functionality:
Check in the background whether origin has changes that you should probably pull in. Depends on notify-send to report back on the git fetch status.
Video showing notification when origin has changes not present in local

This is still very experimental and a lot of stuff will move around in the next month

This very simple plugin opens project paths with nvim using fzf.

The command open_project opens a projects path in nvim with calling find piped into fzf in a project directory.

The project directory contains symlinks to projects, that can be added to it through the add_project command, adding the pwd.

After installing you can of course create aliases for the functions, as typing out open_project is a bother.

Why?

I like projectile in emacs and couldn't find something like it for the terminal.

I don't like typing out paths, even with recursive FZF search.

In the end this is practically just FZF customization though :S

Why not?: If you're looking for project management in nvim i would recommend checking out telescope-project first

Getting Started

Installing

manual

  1. Clone this repository somewhere on your machine. This guide will assume ~/.zsh/pseudo-projectile.

    git clone https://github.com/git-girl/pseudo-projectile-plugin ~/.zsh/pseudo-projectile

  2. Add the following to your .zshrc:

    source ~/.zsh/pseudo-projectile/pseudo-projectile.plugin.zsh

  3. Start a new terminal session.

oh-my-zsh

  1. Clone this repository into $ZSH_CUSTOM/plugins (by default ~/.oh-my-zsh/custom/plugins)

    git clone https://github.com/git-girl/pseudo-projectile-plugin ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/pseudo-projectile

  2. Add the plugin to the list of plugins for Oh My Zsh to load (inside ~/.zshrc):

    plugins=( 
        # other plugins...
        pseudo-projectile
    )
    
  3. Start a new terminal session.

Setting Up

Creating and Setting project path

  1. Create a directory for the symlinks to your projects to go to, f.e.:
mkdir ~/projects 
  1. In your .zshrc add your path as PATHTOPROJECTS
PATHTOPROJECTS="$HOME/projects"

Ideas for Aliasing

The commands have names that are supposed to be very descriptive. To have a nicer workflow, I have them aliased.

f.e. in your ~/.zshrc:

alias po="project_open"
alias pe="project_open -e nvim"
alias pa="project_add" 

Note: I will refactor the open edit stuff to be the same command using flags.

Customization

  • -s Sets the size of FZF window by percentage

  • -e Sets the editor

  • you can customize the colors for fzf via the FZF globals, i removed the specific color support

Usage

  • you can pass an argument to the project_open command which will pre input that string into fzf and execute the cd and possible editor command if there is only one match.

State

This Plugin is currently set up very much for my own workflow. Maybe I will spend some more time on it and generalize it.

pseudo-projectile-plugin's People

Contributors

git-girl avatar

Stargazers

 avatar  avatar

Watchers

 avatar

pseudo-projectile-plugin's Issues

RECAP: Archtitecture Decision and Issues

What i want

So with the plan to have some git integration and also something like enter and exit hooks that can trigger commands to be run

po work_thing 
> runs git fetch checking for new stuff asking if i want to merge in if stuff
> runs documentation server, starts dev server etc. 

close session / cd out of dir / po out of dir 
> runs the commands to gracefully shut down the servers etc. 

constantly being prompted for my ssh key would be annoying af but ok i guess i have the keepass ssh agent setup so that can be ok for the benefit of no silly merges i have to do :s .

i kinda also want window layout stuff. (but thats another thing)

What i did

I was a complete genius once again and thought i'd do a rust rewrite. Turns out that s a very mediocre idea as cd'ing around in the shell doenst work through a binary. Congrats. you played yourself.

The reason i did this originally is me not wanting to write so much shell scripting and rather wanting to learn rust. While this has some advantages i really don't think its all too worth it for this project. The dependencies and build hustles this would bring with itself is not worth it imo.

What I can do

  • Mix Rust and Shell Scripting

    • i don't know i don't want to take care of how i pipe in and out to then have seperate things handle and execute that
    • also all the things i just described above
    • i don't want to let go of the work i put in but its not that much and its really not a good idea to go this route
  • Write it as a shell script

    • Yes i will suffer but oh well deal with it
    • Its acutally not so bad

Keep going with this as a pure shell script project

  • The file to run commands can just be very simple like:

    project_alias:
       Command 
       Command2 
       - - - 
    project_alias2: 
  • The git stuff yes sounds a bit painfull, but i can interact with it through the files in .git dir and do some stuff i recon

A Note

At this point this is getting a bit out of hand but its a nice hobby project i enjoy (fully if it were not for the shell scripting).

I want a lot of things for my workflow and there should be a good alternative out there, like tmux + some other stuff should work well no? i feel like im doing stuff wrong because everyone else seems so content with their set up

add gum support

Should be optional

Feature needs

  • install message "hey cute things are nice, maybe install gum and have a better time"

Fix Setting Up

  • Pretty sure you have to manually create projects folder atm
  • Getting started instructions should include help on this
  • There should be a general improvement of this though
  • There needs to be some reference that zsh must be installed (and find)

add argument on opening

It should be possible to do something like po some_pro.. and if some_pro only returns one entry it does the action on that.

else it opens fzf with the input already typed

Try out tmux sessions

There still needs to be this git support stuff, but with tmux sessions i leave alive i still get the same benefits of having things running no?

Also it would be cool if you can send commands to a tmux session like cd and then the parent shell cds, i like the client server architecture for shells

Add Tests

Maybe just use rspec and make expectations about processes running. Or check for a shell script testing framework

-> Shell Spec

Moving to zsh hooks

It would make sense to to the git check stuff once you also cd into a directory.
For this a hook would need to check if the dir is in the project list.
then run all the project related stuff

Add git support

Idea

There should be some integrated and probably forcefull git support ( obviously a flag to turn it off completely ).
It's not supposed to be too intrusive though. Thus do something unintrusive like a fetch

Feature needs

  • check if git repo
  • check for flag --nogit
  • run git fetch
  • if new stuff ask for merge strat or don't pull

add customization options

  • different editor command
  • different path for projects directory
  • add options for fzf in as args so then you can customize fzf stuff
  • add some option to have fullscreen fzf

add integration for nvim

i would like this to work nicely in nvim, but i think that requires writing some lua stuff for that and i don't know if it's good to have it in this repository. ๐Ÿคทโ€โ™€๏ธ

Add a run command thing for project

When opening a project ppp should have the option to run scrips.

So for ex. main work project id want to rrun the yard and rubycritic server, and gitlab-runner.

For this there should be some CLI Interface with glow or a YAML File Option to set up these things

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.