aserebryakov / filestyle Goto Github PK
View Code? Open in Web Editor NEWfilestyle is a Vim plugin that highlights unwanted whitespace and characters.
Home Page: http://www.vim.org/scripts/script.php?script_id=5065
License: Apache License 2.0
filestyle is a Vim plugin that highlights unwanted whitespace and characters.
Home Page: http://www.vim.org/scripts/script.php?script_id=5065
License: Apache License 2.0
Different highlighing should be used for spaces and tabs.
User may not want to check all files.
Configuration of the excluded files list should be added.
I've tried pretty much everything, but I cannot get FileStyleDeactivate
to work when a QuickFix window is populated. The result is compiler errors being highlighted because their lines are too long. This isn't a massive issue, but it's certainly a nuisance. Would it be possible to have an option for FileStyle to not act on QuickFix or nonmodifiable buffers in general?
When using the splitbelow
option, I get strange Vim internal errors (E315), for each line, when opening a help topic.
How to reproduce (minimal vimrc - I use vim-plug
as plugin manager):
set nocompatible
filetype off
call plug#begin('~/.vim/plugged')
Plug 'aserebryakov/filestyle'
call plug#end()
filetype plugin indent on
syntax on
set splitbelow
The errors look like:
:h syntax.txt
E315: ml_get: invalid lnum: 5319
E315: ml_get: invalid lnum: 5318
...
E315: ml_get: invalid lnum: 1
I suspect the wincmd w
commands are to blame, but I don't know how to change them.
Thanks for the plugin!
Possibility to turn off the plugin should be added.
User should be able to disable plugin globally for all buffers with a command.
simple config:
set textwidth = 2
set lcs=eol:¶,trail:·,tab:·
inserting text 'dd' and ¶ will be highlighted.
If highlights are not updated after changing textwidth, filestyle will incorrectly highlight long lines.
textwidth
change after Vim was started requires manual calling of :FileStyleCheck
.
It should be added to plug-in documentation.
In case of the following line with expandtab
option, spaces will not be highiglted:
\t text
In case of newly created file, plugin is not activated.
Trailing spaces are shown
Trailing spaces are not shown
Hi!
I am new to vim and I am using it in linux terminal.
This colorscheme issue gave me some problems...
First it would be good to change
hi Normal ctermbg=15
in documentaion to
highlight Normal ctermbg=15
so it would be possible just to google it. Googling for "hi" is pointless...
Second issue, I am using some black background color scheme, that goes in debian by default.
When I did "hi Normal ctermbg=15" background changed to white, it was awful.
I tried "hi Normal ctermbg=0" it made background black, but changed colors of the text.
Trying things blindly I came to "hi Normal ctermbg=16" that gives black background and keeps text colors as they were. But I do not understand why.
It would be nice to have more explanation in the doc concerning this Normal colorscheme issue. Or may be not explanations but some ready recipes for new users like "use "hi Normal ctermbg=16" if your color scheme is black", if it is too complex to explain. There should not be many usual cases, so most of them can be covered.
Scenario:
:split
Expected: No highlight in the second window
Actual: There is a highlight in the second window
Plugin code sould correspond to recommendations:
http://google-styleguide.googlecode.com/svn/trunk/vimscriptguide.xml
If new window was opened for the same file (with <C-w>
keys for example) there style errors are not highlighted.
Each time when user puts a space after word and before starting a new word, trailing space is highlighted.
Trailing space is not highlighted in current line while in INSERT mode, but highlighted immediately after exiting from INSERT mode
:split
command:FileStyleDeactivate
commandNo highlighted text in both windows.
Text is not highlighted in one window and stays highlighted in the other.
Highlighting of the control characters in text should be added.
When file is opened and style is checked, user should be asked if he wants to cleanup the file.
I'm using vundle and after installing any other plugin i got a messages:
Error detected while processing /home/vxw/repos/filestyle/plugin/filestyle.vim:
line 54:
E122: Function FileStyleActivate already exists, add ! to replace it
line 65:
E122: Function FileStyleDeactivate already exists, add ! to replace it
line 73:
E122: Function FileStyleClearFile already exists, add ! to replace it
line 82:
E122: Function FileStyleCheckFiletype already exists, add ! to replace it
line 88:
E122: Function FileStyleHighlightPattern already exists, add ! to replace it
line 101:
E122: Function FileStyleExpandtabCheck already exists, add ! to replace it
line 109:
E122: Function FileStyleTrailingSpaces already exists, add ! to replace it
line 119:
E122: Function FileStyleLongLines already exists, add ! to replace it
line 127:
E122: Function FileStyleControlCharacters already exists, add ! to replace it
line 139:
E122: Function FileStyleCheck already exists, add ! to replace it
Hi!
In some projects codestyle allows to use several spaces after tabs for indention.
So it would be good if there would be possibility to configure filestyle to accept it.
As far as I can see it there can be two modes in it.
The last one I've solved with
let g:filestyle_ignore_patterns = ['^\t* \{1,3}\S']
but it take me a while, i am not good with vim regexp. Better to have it in the code of plugin or at least in documentation...
As far as I can see this mode should be configured in the same way, and only spaces after \t* should be highlighted in some warning highlight background (i.e. gray: all is ok, but please pay attention)
This mode will suit me better then the first one, but I am not able to implement using tools that are described in plugin docs.
expandtab
option setnoexpandtab
option is setCurrent solution l of the issue 'Spaces and tabs are highlighed for help files #6' looks like a workaround of the issue. Probably, there is another one better solution.
:FileStyleDeactivate
:help
<C-w>w
No higlighting
Highiggting is enabled
Should be able to duplicate this by opening the tcp_socket.go file in github.com/docker/docker/
Here is the full error message:
[unite.vim] function FileStyleActivate..FileStyleCheck..FileStyleClearBufferMatches, line 3
[unite.vim] Vim(call):E803: ID not found: 10
[unite.vim] Error occurred while executing "open" action!
textwidth
option handling should be added in order to highlight too long lines.
Allow to configure ignored patterns, that will not be highlighted.
I am using filstyle without expandtab
I found out that if I mix spaces and tabs in indention then this mix will be highlighted only till the first space in that mixture. The rest of the empty space would be black.
I do not see it is as a good behavior, as if i do \s\t\t\t\t\t only one character will be highlighted so it would be a bit difficult to notice the problem.
The second issue, if somebody will write \s\t\s\t\s\t\s\t\s\t I would not be able to see the whole problem form the start, I will see next problematic space only after deleting the previous one.
So my suggestion is the following: If there is a problem is indention the whole indention is highlighted as yellow. And all problematic characters are highlighted in red. It should work in this way both with expandtab and without. Expandtab just changes what characters are considered wrong.
After I download filestyle to my vim folder, when I open a file in Vim, this error is raised:
FileStyle: ctermbg parameter should be defined explicitly. Ignored patterns are disabled
Error detected while processing VimEnter Autocommands for "*"..function FileStyleActivate[3]..FileStyleCheck[13]..FileStyleClearBufferMatches:
line 3:
E803: ID not found: 7
Press ENTER or type command to continue
Error detected while processing VimEnter Autocommands for "*"..function FileStyleActivate[3]..FileStyleCheck[13]..FileStyleClearBufferMatches:
line 3:
E803: ID not found: 8
Press ENTER or type command to continue
Error detected while processing VimEnter Autocommands for "*"..function FileStyleActivate[3]..FileStyleCheck[13]..FileStyleClearBufferMatches:
line 3:
E803: ID not found: 9
Press ENTER or type command to continue
After switching the colorscheme, highlighting no longer works. Disabling/enabling, deactivating/activating and checking manually do not restore highlighting.
Spaces and tabs are higlighted in help files, but should be ignored.
Starting Vim in a narrow terminal with fewer than 40 columns produces these messages at startup and while editing:
FileStyle: ctermbg parameter should be defined explicitly
Press ENTER or type command to continue
Error detected while processing functio
n FileStyleActivate..FileStyleCheck..Fi
leStyleClearIgnoredPatters..FileStyleHi
ghlightPattern:
line 7:
E28: No such highlight group name: File
StyleIgnoredPattern
Error detected while processing functio
n FileStyleActivate..FileStyleCheck..Fi
leStyleClearBufferMatches:
line 3:
E802: Invalid ID: -1 (must be greater t
han or equal to 1)
Press ENTER or type command to continue
Error detected while processing functio
n FileStyleActivate..FileStyleCheck..Fi
leStyleClearIgnoredPatters..FileStyleHi
ghlightPattern:
line 7:
E28: No such highlight group name: File
StyleIgnoredPattern
Press ENTER or type command to continue
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.