Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't emacs have a fringe mode in terminal?

I am a hardcore vim user. With the introduction of evil mode and spacemacs, I am transitioning over to emacs from vim. I often edit my code in a dev server (for reasons that I cannot explain), and I have to run my editor in terminal mode. One thing, I am missing in Emacs (that is there in vim) is a gutter to display useful information like compile/lint errors, while coding. Emacs does have a fringe mode for GUI for this but not for terminals. Is there a particular reason for avoiding fringe mode in terminal in emacs?

My requirement is to view all the errors in one column (I am using flycheck), so that it is easy to glance through the code to find the lines that has errors. flycheck has three ways to highlight error (line/column/symbol). I would like the symbol in the line to be highlighted, but at the same time, I would like to see a column either on the left or right side of the code, that marks lines that has errors/warnings with some symbol. Flycheck does this when fringe mode is enabled, but there is no fringe mode for terminals. Is there a way to get this in terminals?

like image 695
Senthil Babu Avatar asked Mar 08 '16 10:03

Senthil Babu


1 Answers

I think that you should use the function M-x flycheck-list-errorsthen you can see all the flycheck errors in a separate buffer:

I'm reading a ruby file that I use rubocop for lint error. If I use rubocop directly on terminal I get this:

$ cat dirty.rb
class Dirty
  # This method smells of :reek:NestedIterators but ignores them
  def awful(x, y, offset = 0, log = false)
    puts @screen.title
    @screen = widgets.map {|w| w.each {|key| key += 3}}
    puts @screen.contents
  end
end

if I get the errors with rubocop:

$ rubocop dirty.rb
Inspecting 1 file
W

Offenses:

dirty.rb:1:1: C: Style/Documentation: Missing top-level class documentation comment.
class Dirty
^^^^^
dirty.rb:1:1: C: Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.
class Dirty
^
...
...
...
1 file inspected, 13 offenses detected

Which is the same as in emacs:

Emacs Lint

Then I can check all the offenses with M-x flycheck-list-errors in a separate buffer:

show all errors in a file inside a buffer

This is a feature or function of flycheck, so you can use this to any code, that flycheck is getting the errors for you

like image 99
anquegi Avatar answered Oct 06 '22 21:10

anquegi