Linux on Desktops

User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

apps:scite [2016-02-16 14:32] (current)
Line 1: Line 1:
 +====== SciTE ======
 +{{ wiki:​SciTE.png?​300|The SciTE main window with the configuration applied}}
 +[[http://​​SciTE.html|SciTE]] is a really great and versatile source editor. Fast, knows lots of languages (syntax highlighting),​ fully customizable,​ platform independent and so on. As with everything, it is a matter of taste what you use. SciTE just became my favourite when it comes to editing in a graphical environment. On the console or in a terminal the one and only editor of course is [[http://​​wiki/​Vi|vi]] or [[http://​​|vim]].
 +You can use Scite for scripting, programming,​ webdesign, Lua-scripts (for itself or e.g. [[imapfilter]]),​ [[LaTeX]] files...
 +===== Configuration =====
 +However, the default settings are not as nice as they could be. Use the settings below to paste them in the ''​''​ (in the menu go to "​Options -> Open User Options File"​). Then your working experience with SciTE should be way better!
 +Of course you can modify these settings according to your own needs and preferences;​ with a few adjustments these settings also work with the Windows version of SciTE.
 +<file lua>​
 +$(file.patterns.latex)=pdflatex $(FileNameExt)
 +command.go.$(file.patterns.latex)=acroread $(FileName).pdf
 +command.go.$(file.patterns.web)=firefox "​file://​$(FilePath)"​
 +command.print.*=a2ps "​$(FileNameExt)"​
 +===== Sorting =====
 +SciTE doesn'​t allow for sorting by default. By adding a simple [[http://​​|Lua]] script and assigning a keyboard shortcut to it SciTE can learn it though.
 +Just add these lines to your user configuration:​
 +<code lua>
 +*=Sort Selection
 +And save the following script as ''​~/​.scitesort.lua''​.
 +Actually, this is not from me but taken from the [[http://​​wiki/​SciteSortSelection|Lua Users Wiki]], I am not a programmer and definitely don't speak Lua ;-)
 +Thanks a million for this script, Lua Users!
 +<file lua scitesort.lua>​
 +function lines(str)
 +  local t = {}
 +  local i, lstr = 1, #str
 +  while i <= lstr do
 +    local x, y = string.find(str,​ "​\r?​\n",​ i)
 +    if x then t[#t + 1] = string.sub(str,​ i, x - 1)
 +    else break
 +    end
 +    i = y + 1
 +  end
 +  if i <= lstr then t[#t + 1] = string.sub(str,​ i) end
 +  return t
 +function sort_text()
 +  local sel = editor:​GetSelText()
 +  if #sel == 0 then return end
 +  local eol = string.match(sel,​ "​\n$"​)
 +  local buf = lines(sel)
 +  table.sort(buf)
 +  local out = table.concat(buf,​ "​\n"​)
 +  if eol then out = out.."​\n"​ end
 +  editor:​ReplaceSel(out)
 +Done! From now on you will find the sorting function (for all selected lines) in the "​Tools"​ menu or as keyboard shortcut ''<​Shift>​ + <​Control>​ + <​S>''​.
apps/scite.txt ยท Last modified: 2016-02-16 14:32 (external edit)