Change editor
I want to cheange the text editor.
A option to change the editor, on one hand it could be a conf in .config/gitui/config.toml or add a (hidden) settings tab to modify what it is neccesary for the user.
What is your opinion about this? Do i miss something?
you can set these env: GIT_EDITOR, VISUAL, EDITOR
let me know if that works for you
Great! Set export EDITOR=nvim works for me.
(change nano with any other editor you have installed)
If you want to change the default editor for all applications started from the shell (not just gitui) change the EDITOR environment variable
# set EDITOR environment variable for the current shell session and all his children
export EDITOR="nano"
# set EDITOR environment variable for all new shell sessions (this command also automatically detects the shell type currently in use and appends to its respective rc file)
echo EDITOR="nano" >> \~/.$(ps --quick-pid $$ -o comm=)rc
If you instead want to change the default editor only for git and gitui change the GIT_EDITOR environment variable
# set GIT_EDITOR environment variable for the current shell session and all his children
export GIT_EDITOR="nano"
# set GIT_EDITOR environment variable for all new shell sessions (this command also automatically detects the shell type currently in use and appends to its respective rc file)
echo GIT_EDITOR="nano" >> \~/.$(ps --quick-pid $$ -o comm=)rc
A note on echo EDITOR="nano" >> ~/.$(ps --quick-pid $$ -o comm=)rc (the same exact thing applies to the GIT_EDITOR variant)
-
echo "test" >> test.txtmakes it so the string “test” gets appended to the “test.txt” file -
echo $$prints out the current shell PID (it’s contained in the$$variable) -
ps --quick-pid $$lists the name of the process with the specified PID (the current shell process in this example) -
ps -o comm=lists the current processes by only outputting their process names and no additional information -
ps --quick-pid $$ -o comm=lists the current shell process name -
~/.$(ps --quick-pid $$ -o comm=)rcgets evaluated to “~/.” + current shell process name + “rc” For example if the current shell process name is “bash” the evaluated string is “~/.bashrc”, if instead it’s “zsh” it gets evaluated to “~/.zshrc” -
echo EDITOR="nano" >> ~/.$(ps --quick-pid $$ -o comm=)rcwrites the string ‘EDITOR=”nano”’ to the “rc” file that corrisponds to the current in use shell name
failed to launch editor: ┃ │ │ ┃"vi": No such file or directory (os error 2)
mine .bashrc is
~/.bashrc
export EDITOR=nano
Add rbenv
export PATH="$HOME/.rbenv/bin:$PATH" eval "$(rbenv init -)"
Add depot_toolsforchromiumdev
export PATH="$PATH:/path/to/depot_tools"
Add NVM
[ -z "$NVM_DIR" ] && export NVM_DIR="$HOME/.nvm" source /usr/share/nvm/nvm.sh source /usr/share/nvm/bash_completion source /usr/share/nvm/install-nvm-exec
If not running interactively, don't do anything
[[ $- != i ]] && return
alias ls='ls --color=auto'
PS1='[\u@\h \W]$ '
source /usr/share/nvm/init-nvm.sh export LD_LIBRARY_PATH=/usr/local/lib
Created by pipx on 2023-05-04 14:36:15
export PATH="$PATH:/home/ui/.local/bin"
export PATH=$PATH:~/.roswell/bin
so, what I can do for change default editor to NANO? on another tools and another cli projects all works well and nano is default editor. also that error (os error 2) mean maybe No such file or directory;
also ur tool is great, and work fast and perfect
failed to launch editor: ┃ │ │ ┃"vi": No such file or directory (os error 2)
mine .bashrc is
~/.bashrc
export EDITOR=nano
Add rbenv
export PATH="$HOME/.rbenv/bin:$PATH" eval "$(rbenv init -)"
Add depot_toolsforchromiumdev
export PATH="$PATH:/path/to/depot_tools"
Add NVM
[ -z "$NVM_DIR" ] && export NVM_DIR="$HOME/.nvm" source /usr/share/nvm/nvm.sh source /usr/share/nvm/bash_completion source /usr/share/nvm/install-nvm-exec
If not running interactively, don't do anything
[[ $- != i ]] && return
alias ls='ls --color=auto'
PS1='[\u@\h \W]$ '
source /usr/share/nvm/init-nvm.sh export LD_LIBRARY_PATH=/usr/local/lib
Created by
pipxon 2023-05-04 14:36:15export PATH="$PATH:/home/ui/.local/bin"
export PATH=$PATH:~/.roswell/bin
Put you code like this next time
``` CODE ```
so that it renders properly in the comment (see: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code-and-syntax-highlighting)
On top of my mind if you get that error it could be a few things:
- did you edit ~/.bashrc (the one in your home) or another .bashrc somewhere else?
check by running
cat ~/.bashrcif it's the same file you posted before - are you using
bashor another shell? check by runningps --quick-pid $$ -o comm=if you are runningbashor another shell (in case you are running another shell use my updated answer on top to add the line to the correct configuration file - check if the
EDITORvariable is actually set before runninggituicheck by runningenv | grep EDITOR
Glad Thanks! now all is work, awesome, great!
This issue has been automatically marked as stale because it has not had any activity half a year. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
seems fixed