How to change to the next above directory - directory

I really would like to know how to change directory to the next file, using 2 dots (/..).
I can go back to previous directory but how to do something like that to go to the next directory WITHOUT THE NAME OF THE FILE PLEASE!
I know it is possbile with the name of the folder but my answer is different, please let me know.

What O.S are you using? In linux ubuntu/Debian distributions (and probably in windows, not sure), you can enter the first child directory by simply typingcd */, this will change your current directory to the first child directory available in alphabetical order, example:
-/home
-alan
-desktop
-music
-alex
-documents
-pictures
-lisa
Assuming your in /home, if you write cd */ in the terminal you will be in /home/alan, because -alan is the first folder/directory available.

Related

Why plugin z of zsh is not active inside the .zshrc?

I installed oh my zsh and zsh auto suggestion. Then I read here (https://www.sitepoint.com/zsh-tips-tricks/) about z zsh, an interesting plugin. And I really wanted to install it. So I put the plugin inside my .zshrc file. But the plugin feature is not active, it's not yellow like source command or alias (and those are properly working). I tried to change place of the plugin line (after / before source), but it didn't work. I did'nt understand the first line. My .zshrc, if someone could help...:
export PATH=$HOME/bin:/usr/local/bin:$PATH
export ZSH="/home/yanalolux/.oh-my-zsh"
ZSH_THEME="ys"
. /home/yanalolux/z.sh
source $ZSH/oh-my-zsh.sh
plugins=(z zsh-autosuggestions)
plugins=(zsh-autosuggestions)
In your .zshrc you have the following two lines:
plugins=(z zsh-autosuggestions)
plugins=(zsh-autosuggestions)
The second line remove the z plugin. You should have only one line with:
plugins=(z zsh-autosuggestions)
According to the ZSH-z plugin Github homepage:
ZSH-z is a command line tool that allows you to jump quickly to directories that you have visited frequently in the past, or recently -- but most often a combination of the two (a concept known as "frecency"). It works by keeping track of when you go to directories and how much time you spend in them. It is then in the position to guess where you want to go when you type a partial string, e.g. z src might take you to ~/src/zsh.

Customizing Powerleve10k prompt

I just added the Powerlevel10k theme to my zsh and i'm trying to configure certain parts.
It currently looks like this:
The ~/.p10k.zsh has a lot of configurations done and I've been trying to change certain things but i'm not there yet.
I don't want to print the whole path on the left prompt, just the directory. Also, not sure what those numbers indicate in the git section. And the right prompt is displaying my ruby version, although I haven't used Ruby in ages and want to change it to a different setting.
I've tried adding a PS1=... to .zshrc but it seems to be overriden by the P10K config file.
Any suggestions?
Display only the last directory segment
Open ~/.p10k.zsh.
Search for POWERLEVEL9K_SHORTEN_STRATEGY.
Change the value of this parameter to truncate_to_last.
Alternatively, change the value of POWERLEVEL9K_DIR_MAX_LENGTH to 1. This will maximally shorten current directory while keeping the transformation reversible. You can restore the original directory by copy-pasting the shortened directory to the command line and pressing TAB.
Ruby version
Powerlevel10k has several prompt segments that can display Ruby version. By default only those are enabled that display Ruby version when it has been manually overridden by some tool (e.g., rbenv or asdf).
To remove Ruby version from prompt:
Open ~/.p10k.zsh.
Search for POWERLEVEL9K_RIGHT_PROMPT_SEGMENTS.
Remove or comment out the following elements: rbenv, rvm and asdf.
Alternatively (and perhaps preferably), find out which tool is overriding Ruby version for you and remove the override if you no longer need it.
shorten dir segment to show only deepest directory
To show only last n significant path segments, you can set following in your config .zshrc, e.g n=1 means show only last folder in present working directory:
POWERLEVEL9K_SHORTEN_DIR_LENGTH=1
See https://stackoverflow.com/a/49027654
explain Git symbols
The question/exclamation mark in Git segment (vcs segment, next to path) means the number of files untracked (?) and unstaged (!). For detailed description see What do different symbols in Git status mean?
change version segment
You can change the version segment (on the right of prompt) to reflect another tool. For example to replace shown ruby version by python version replace the element within right promt elements in your config .zshrc:
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(rbenv)
by
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(pyenv)

Failed to create wallet for ton with Fift?

Right now I'm trying to create wallet for TON.
I downloaded and built Fift interpreter an was trying to create new wallet with: ./crypto/fift new-walelt.fif
[ 1][t 0][1559491459.312618017][fift-main.cpp:147] Error interpreting standard preamble file `Fift.fif`: cannot locate file `Fift.fif`
Check that correct include path is set by -I or by FIFTPATH environment variable, or disable standard preamble by -n.
Although my path variable is set. Could anyone please help me with this?
First, locate {{lite-client-source-direcotry}}/crypto/fift
This is not the build directory, that's the directory where are the source files (lite-client that you downloaded). So verify you have that it contains Fift.fif file.
If you installed it in the user working directory, it should be:
~/lite-client/crypto/fift/
Now, you should either set FIFTPATH variable to point to this directory or run fift with -I option:
export FIFTPATH=~/lite-client/crypto/fift/
./crypto/fift new-walelt.fif
Or
./crypto/fift -I~/lite-client/crypto/fift/ new-walelt.fif
Have you tried ./crypto/fift -I<source-directory>/crypto/fift new-wallet.fif instead of setting environment variable? Are Fift.fif and Asm.fif library files inside FIFTPATH?
Make sure you have followed all the instruction written here:
https://test.ton.org/HOWTO.txt
It should work if you do all the above instruction correctly. If not, it might be a bug. Remember that TON is in a very early beta strage. You can submit the issue here:
https://github.com/copperbits/TON/issues
You also can use this:
cd ~/liteclient-build
crypto/fift -I/root/lite-client/crypto/fift/lib -s /root/lite-client/crypto/smartcont/new-wallet.fif -1 wallet_name
Try this (worked for me)
export FIFTPATH=~/lite-client/crypto/fift/lib
./crypto/fift new-wallet.fif

unix PATH environment variable edit

My PATH environment variable right now is:
./subTmp:/usr/local/bin
How do I remove the ./subTmp part from it?
Thanks.
The details vary a bit by installation and by local custom, but generally you have a file named either .profile, .login, or .bashrc in your home directory that contains a line something like
PATH = ./subTmp:/usr/local/bin
Just edit it to be whatever you need.
this should do
export PATH=/usr/local/bin

Specify a Directory for Save in Mathematica

Considering :
ALLdwafDif[#] & /# symmetries
Save["ALLL.m", ALLL]
Is there a way to save the results in a particular directory ? It automatically save the results in my user directory now.
The current working directory is given by Directory[]. You can set it by SetDirectory[]. Alternatively, you can append the directory name to ALLL.m and it works.
eg
f = 5;
Save["~/Desktop/temp.m", f]
does what you'd expect (~ is a shortcut for home directory on most Unices, and mma respects it, so this gets saved on my desktop)
If you want to change the default working directory permanently you can add something like SetDirectory["new_dir"]; to one of the files $BaseDirectory/Kernel/init.m or $UserBaseDirectory/Kernel/init.m (which one depends on whether you want to change the default directory for all users or for the current user only). Next time you restart Mathematica, Directory[] will then automatically be set to new_dir.
Save[SystemDialogInput["FileSave", "All.m"], ALLL]
brings up a standard system save-file dialog box and saves your file after you've chosen a location (and a new file name if you have chosen one).
I find it useful to save data in the same location as the notebook:
f = 5;
Save[FileNameJoin[{NotebookDirectory[], "f.dat"}], f]
Or to save in your (default) Dropbox directory:
Save[FileNameJoin[{$HomeDirectory, "Dropbox", "f.dat"}], f]
I rarely use the directory stack that's controlled by SetDirectory[] and friends.

Resources