Hey guys I need to see my ruby version and gemset name in emacs mode-line. Do you know how to do it?
How to show RVM info into emacs mode-line?
80 Views Asked by squiter At
2
There are 2 best solutions below
0
squiter
On
I tried but I can't custom strings to mode-line so I customize all of it.
;; modeline
(defun branch-name ()
(when vc-mode
(concat "\ue0a0 " (substring vc-mode 5))
))
(defun current-ruby ()
(when vc-mode
(replace-regexp-in-string "\n$" "" (shell-command-to-string "~/.rvm/bin/rvm-prompt"))
))
(setq-default mode-line-format
(list
"[" mode-line-modified "]"
" "
"%b"
" | "
'mode-name
" | "
'(:eval (projectile-project-name))
" "
'(:eval (branch-name))
" | "
'(:eval (current-ruby))
" | "
"%p (%l,%c)"
))
Related Questions in RUBY
- how to integrate cashfree payment gateway in ruby on rails project
- RSpec Capybara throwing Selenium error when trying to click a button with browser confirm
- Duplicate GET requests - Rails & Heroku
- convert csv file with json data inside to a column, rows table in 2nd csv file
- Installing dependencies from a gemspec file
- Verifying Google Identity OAuth2 token with Ruby
- Java code of AES/GCM/NoPadding encryption algorithm with authentication tag
- How to fix error in model with gem lockbox
- Cannot install Ruby Gem on Window
- use logstash filter ,aes gcm encrypted in ruby,but cannot decrypted in java
- In Rails 7, what is the right ActiveRecord callback to use if I need to prevent (or rollback) persistance on error?
- How can I go through an array and still remove elements from it
- Nokogiri only returning 5 results
- How do I get the fullscreen mode in firefox?
- undefined group option when using branch reset group regex in Ruby
Related Questions in EMACS
- How can I make 'emacsclient' open in native fullscreen every time I launch it from the terminal in macOS?
- emacsclient does not connect inside ubuntu container
- Emacs use .emacs by default instead .emacs.d/init.el
- Setting up Macaulay 2 on emacs
- org-mime add caption to exported images
- Use the same export attribute for all src-blocks
- Tags Development Tools
- Emacs 29.2 unable to find theme file
- How to automatically allow the execution of code action from HLS in emacs?
- Org-babel remote inline images with TRAMP not exporting in org export
- find and replace regex like that can deal with nested brackets
- Inheriting from variadic types messes up template member function indentation in Emacs
- Invoking org-store-link interactively, errors on calling org-man-store-link
- Disable session save in doom emacs
- How do you connect to a remote emacs server using Microsoft dev tunnels
Related Questions in RVM
- Relation RubyGems, Ruby Version, Bundler Version, RVM and Capistrano Conflict
- rvm install 2.7.2 Error running '__rvm_make -j16',
- where __rvm_sed command defined
- Unable to Install GPG keys
- Macbook M2Pro - Error running '__rvm_make -j12'
- failed to install ruby Error running '__rvm_make -j4',
- How can I make rvm work from Docker without explicitly running /bin/bash?
- Ruby Version Manager
- Warning ruby message when starting a new console in Linux
- Error Installing Ruby 3.2.2 with RVM on macOS: 'username_completion_function' undeclared
- Why am I getting this error (Error running '__rvm_make -j12') when installing RVM?
- I'm getting an Error running rvm make while installing Ruby
- Is it possible to install ruby-2.6.5 in ubuntu 22.04 via rvm
- Facing error while installing ruby 2.6.5 in ubuntu 22.04
- Trouble installing ruby via rvm
Related Questions in MODELINE
- How to colorize some text in the mode-line differently
- Emacs insert true tabs by default
- Is it possible to have a complicated Emacs command as modeline?
- how to load a .vim file on a mode line
- How can I hide all major / minor modes from the mode line without a package?
- How do I turn on vim syntax highlighting via modeline?
- Vim: disable autocmd BufRead (modeline)
- How to Call a Function in Emacs Mode Line Format
- Emacs Mode Line Click Change Buffer
- Vim or Emacs-like modeline magic support for VSCode
- Activate VIM folding markers via modeline
- Mode line will not redraw properly
- Vim bash syntax highlighting with modeline
- emacs: Which plugin is this?
- Emacs: add list of all opened files to mode-line?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Take a look at rvm.el. I provides many features that make the use of RVM from Emacs more enjoyable.