Editing profiles in arch linux - archlinux

I am very new to Arch Linux and have chrooted into the system. I screwed up the wireless profile, but have fixed them in netctl. How do I write to the file and exit out of the text editor that is prompted for you to edit the file?

To write to the file:
sudo nano /path/to/file
And to exit from the nano text editor press Control X.
Then Y to confirm save and exit, and enter to commit the save.

It depends on what type of editor has been opened. Which you can set in the .bashrc file.
If it is nano press ctrl+o to save the changes and ctrl+x to quit
If it is vi or vim, Goto command mode by pressing escape. Then type :wq to write and press enter.
If you are not able to make out between the two, just check if it has shortcut key info at the bottom of the page, if yes. It is nano or else it is vi.
PS: Since you are new the arch linux I assumed that you have not installed any other CLI based editors.

Related

How to set React_Editor to PhpStorm so that when you click on the error it jumps to the code?

I'm using PhpStorm in Mac to code and i want to debug my errors. I have a message in my terminal to set the editor for React Native tools.
PRO TIP
When you see Red Box with stack trace, you can click any
stack frame to jump to the source file. The packager will launch your
editor of choice. It will first look at REACT_EDITOR environment
variable, then at EDITOR.
To set it up, you can add something like
export REACT_EDITOR=atom to your ~/.bashrc or ~/.zshrc depending on
which shell you use.
I've added these lines to ~/.bashrc but nothing happened when i click on the error :
export PATH=$PATH:/usr/local/bin/pstorm
export REACT_EDITOR=pstorm
How can i set correctly REACT_EDITOR to PhpStorm so that when i click on the error it jumps to my code?
For mac os you need to add to ~/.bashrc or .zprofile:
Add export REACT_EDITOR="webstorm" or pstorm
Don't forget to close all of your terminal windows and restart the react-native packager before you try it.
Create a shortcut to open WebStorm:
Open WebStorm
Press ⇧ twice to open the search window
Type “Create Command Line Launcher…” and press Enter
Click OK
That's it.
/usr/local/bin should be in the PATH environment variable by default. You should be able to run webstorm from anywhere in the shell. Run webstorm /usr/local/bin/webstorm to test the command.
You can find a code which opens editors here or in your project node_modules/#react-native-community/cli-tools/build/launchEditor.js
I solved this problem by creating symlink.
sudo ln -s /Applications/WebStorm.app/Contents/MacOS/webstorm /usr/local/bin/webstorm

How to edit command lines in Intellij Terminal

I have set -o vi in my .bashrc and it does get invoked. But Escape does not return to command-mode in the Intellij terminal. I had already followed a Jetbrains post for changing Switch Focus to Editor away from Escape:
But that was not enough: Hitting escape on the command line shown just puts in additional control characters:
So how can vi edit mode for the ocmmand line be made functional? If not vi mode then what reasonable alternatives exist?
I am on 2020.2 Ultimate on macOS . I do not have set TERM=linux

Arch Linux shutdown

Whenever I shutdown my Arch Linux system and then restart it I find that the work I did in terminal or I left any window open before shutting down are back again on the screen again , I can find my last used commands by pressing up arrow key on the keyboard . How to just get everything new whenever I boot up my PC .
P.S - I'm new to Arch
Append a line containing unset HISTFILE to ~/.bashrc.
Type unset HISTFILE; rm HISTFILE.
Reopen the terminal.
Bash wiki for further reference: http://wiki.bash-hackers.org/syntax/shellvars#histfile
To revert old behaviour: remove the line that was appended.

How to add keyboard shortcuts to nemo?

I want to add gloobus to nemo in linux mint. But native support is not available therefore I want to add a keyboard shortcut to nemo to open gloobus with selected element.
I already found this where is described how to change shortcuts and I found this where is described how to add an action to the context-menu.
Does anybody know how to add KEYBOARD shortcuts to do the same?
for Nemo 2.2.4 under Linux Mint 17 I do this:
Go to: /home/yourusername/.gnome2/accels --- NOTE: .gnome2 is a hidden folder!
Open the "nemo" file with your text editor
Add your shortcut: for example, when having 2 panes to move a folder or file from one pane to the other using "CTRL+j":
(gtk_accel_path "/DirViewActions/Move to next pane" "j")
Note: remove the ";" at the beginning of the line
Restart the GTK system: sudo killall -u yourusername
Open Nemo, to test my example: press "F3" choose different folders on each pane, select one folder or file from one pane and press "Ctrl+j", that folder or file should move from one pane to the other one.
There are a lot of different commands to customize in that file, be careful not to use a current shortcut!
Hope this helps!

How do I install uncrustify?

How do I install uncrustify? I followed the instruction to install uncrustify but when I run it, it does not work. Can anyone give me some help installing this tool? I want to run it on objective-c code in xcode 4. Thanks in adavance
On OS X Mavericks 10.9.1 :
1- to install brew, open a terminal windows and type :
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
It will ask you to download some other files, answer OK for all (for more information see : http://brew.sh/index_fr.html).
2 - to install uncrusify, open a terminal windows an type :
brew install uncrustify
3 - to make your code beautiful, download BBUncrustifyPlugin-Xcode available at https://github.com/benoitsan/BBUncrustifyPlugin-Xcode
You will just have to :
compile the project
copy the file uncrusify.cfg in your home directory
restart Xcode.
NB : With BBUncrustifyPlugin, you don't need to use Automator.
4 - After restarting Xcode, use the menu Edit > Uncrustify Selected Files to uncrustify the selected items in the project navigator.
Your code is now beautiful! That's magic!
post-scriptum : You can easily change your uncrusify configuration file by using :
https://github.com/ryanmaxwell/UncrustifyX
http://universalindent.sourceforge.net (better in my case)
I hope that this will help!
I setup Uncrustify with Xcode 4 like so: http://blog.carbonfive.com/2011/03/10/code-formatting-in-xcode-4/
Can you explain what you tried to do, what you expected to happen, and how it didn't work?
Download zip
On Windows, download the latest version of Uncrustify here: https://sourceforge.net/projects/uncrustify/files/latest/download
Extract zip
The program is a standalone exe, so just extract the downloaded uncrustify-...-win32.zip file anywhere. For this example, I'll use C:\Uncrustify. So, the uncrustify.exe would be in that directory.
Add directory to PATH System Environment Variable
In Windows 7+: Type Winkey + env - Select "Edit the system environment variables"
On the Advanced tab, click the Environment Variables button at the bottom.
In the System variables section at the bottom, click the Path variable, then click the Edit... button.
Click the New button, and type C:\Uncrustify, or the directory that you extracted uncrustify.exe to.
Important: Click OK to close the dialog boxes or your change will not save.
Verify
In a CMD window, typing where uncrustify should return the path to the uncrustify.exe.
In my case it shows C:\Uncrustify\uncrustify.exe
Close Atom and reopen it. Now you should be able to atom-beautify and it will use Uncrustify to format your selection