13

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?

Ehvince
  • 17,274
  • 7
  • 58
  • 79
Senthil Babu
  • 1,243
  • 2
  • 11
  • 20
  • Hey, mandatory question: are you aware of [Tramp](https://www.emacswiki.org/emacs/TrampMode#toc2) which allows to open a file through ssh in GUI emacs ? Just `C-x C-f /ssh:user@server:/path/to/file` (I know it may not be appropriate to your workflow, but sometimes it is convenient). – Ehvince Mar 09 '16 at 01:16
  • @Ethvince,yes I am aware of tramp. But when using tramp, it becomes difficult to integrate with linters and builders that only runs remotely. Also other functions like grepping, through files gets slow too. – Senthil Babu Mar 17 '16 at 03:06
  • I recommend you `M-x report-emacs-bug` and ask for that feaure (Emacs actually does have a right fringe in the tty output, but there is currently no way to control what gets displayed there, it's hardcoded to show `$` for truncation and `\ ` for wrapping). – Stefan Oct 20 '16 at 14:42
  • I posit that Emacs should use sixels to display fringes in terminals that support it. – Lars Brinkhoff Oct 21 '16 at 08:04

1 Answers1

1

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

anquegi
  • 11,125
  • 4
  • 51
  • 67