Giter VIP home page Giter VIP logo

Comments (8)

N-R-K avatar N-R-K commented on May 26, 2024

It should be possible to do this quite easily with a plugin. There's already a couple cd related plugin you can take a look at for reference.

from nnn.

fryit5150 avatar fryit5150 commented on May 26, 2024

It's quite basic functionality, so it would be great not needing to install and setup a plugin for it on all my computers/new installs in VMs.

from nnn.

0xACE avatar 0xACE commented on May 26, 2024

It's quite basic functionality, so it would be great not needing to install and setup a plugin for it on all my computers/new installs in VMs.

It serves no purpose, you can literally hit these keys:

!mkdir -p foo/bar/baz<ENTER><CTRL-D>

for a better and more robust functionality...

update: i didnt read the topic and assumed the request was to create sub folders... my bad...

from nnn.

fryit5150 avatar fryit5150 commented on May 26, 2024

It's quite basic functionality, so it would be great not needing to install and setup a plugin for it on all my computers/new installs in VMs.

It serves no purpose, you can literally hit these keys:

!mkdir -p foo/bar/baz<ENTER><CTRL-D>

for a better and more robust functionality...

You are right. Running mkdir to browse a directory makes no sense at all.

from nnn.

N-R-K avatar N-R-K commented on May 26, 2024

Here's a plugin to do what you want:

#!/bin/sh

printf "enter path to cd: "
read -r to
[ -n "$to" ] && printf "0c%s" "${to}" > "$NNN_PIPE"

it would be great not needing to install and setup a plugin for it on all my computers/new installs in VMs

Whether to include this feature in nnn natively or not is @jarun's call. I don't really have any preference here one way or other.

from nnn.

0xACE avatar 0xACE commented on May 26, 2024

Sorry i didn't fully read the topic.

This is the way it was implemented on my branch: when in filter mode: / will cd into a directory if the highlighted line is a directory otherwise it will clear the filter + show all files and highlight the matched item, essentially allowing you to paste a path to go to the desired location.

I just gave it a try, it still works after 3 years, but I guess it doesnt work while nnn is running within tmux...

from nnn.

jarun avatar jarun commented on May 26, 2024

We can't add a new keybind for changing directories.
Plugins are one of the best features of nnn and very simple to migrate and use.

However, in this case, did you try to add the following in your ~/.bashrc:

NNN_PLUG='c:!read -r to && [ -n "$to" ] && printf "0c%s" "${to}" > "$NNN_PIPE"*'

and press Alt-C and paste the destination path?

from nnn.

jarun avatar jarun commented on May 26, 2024

Fixed at 9259170.

from nnn.

Related Issues (20)

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.