Nothing exists (existed?) that does it. However I wrote a quick piece of Lua to do it. I can’t say the columns are that pretty but this is as close as you will probably get to indicating columns based on width.
Download the
LuaScript plugin
Extract the zip and copy the DLL to your plugins directory
Select Plugins > LuaScript > Edit Startup Script
Paste the chunk of code (See end of this post)
Edit the first few lines of of the code to do what you want (you’ll probably just need to set the file extensions you want)
Save and restart Notepad++
Open one of your files
Again, it isn’t the prettiest but there’s really nothing else I know of that will do what you want. Adjusting colors may help. For example…
The code…
-- Configure things here...
local registeredExtensions = {".csv", ".xyz"}
local columWidth = 8
local col1Color = 0xd0d0d0
local col2Color = 0xaaaaaa
local field_indic = {12, 13} -- not sure what one is best to use but this works
local function setupEditor(e)
e.IndicStyle[field_indic[1]] = INDIC_STRAIGHTBOX
e.IndicStyle[field_indic[2]] = INDIC_STRAIGHTBOX
e.IndicUnder[field_indic[1]] = true
e.IndicUnder[field_indic[2]] = true
e.IndicAlpha[field_indic[1]] = 255
e.IndicAlpha[field_indic[2]] = 255
e.IndicFore[field_indic[1]] = col1Color -- Color of first column
e.IndicFore[field_indic[2]] = col2Color -- Color of second column
end
setupEditor(editor1)
setupEditor(editor2)
function highlightColumns()
local function getLineRangeOnScreen()
local firstLine = editor.FirstVisibleLine
local lastLine = firstLine + editor.LinesOnScreen
return firstLine, lastLine
end
local function getRangeOnScreen()
local firstLine, lastLine = getLineRangeOnScreen()
local startPos = editor:PositionFromLine(firstLine)
local endPos = editor.LineEndPosition[lastLine]
return startPos, endPos
end
local function clearIndicatorOnScreen()
local s, e = getRangeOnScreen()
editor:IndicatorClearRange(s, e - s)
end
-- Clear everything
editor.IndicatorCurrent = field_indic[1]
clearIndicatorOnScreen()
editor.IndicatorCurrent = field_indic[2]
clearIndicatorOnScreen()
local s, e = getLineRangeOnScreen()
for i=s,e do
local index = 0
local lineStart = editor:PositionFromLine(i)
local lineEnd = editor.LineEndPosition[i]
for p=0,editor:LineLength(i),columWidth do
editor.IndicatorCurrent = field_indic[(index % 2) + 1]
local col1 = editor:FindColumn(i, p)
local col2 = editor:FindColumn(i, p + columWidth)
editor:IndicatorFillRange(col1, col2 - col1)
index = index + 1
end
end
end
npp.AddEventHandler("OnSwitchFile", function(filename, bufferid)
-- Always remove it
npp.RemoveEventHandler("OnUpdateUI", highlightColumns)
-- Check to see if the extension exists
for _,v in pairs(registeredExtensions) do
if v == npp:GetExtPart() then
npp.AddEventHandler("OnUpdateUI", highlightColumns)
return
end
end
end)