Hello,

I am new to scite, and lua, but am intrigued by the editor, and have been using it exclusively for a few weeks. I don't quite have some details on getting things to work. I have a couple problems right now, concerning keybindings. Coming from emacs, there are 2 keybindings that are embedded in my fingers: Ctrl+A for beginning of line, and Ctrl+K for cut to end of line. Also, I like Shift-Enter to select the current line. I tried the following in my .SciTEUser.properties:


function SelectCurrentLine(bWithEOL)
   local lineStartPos, lineEndPos = GetLineData(-1)
   if bWithEOL then
     local eol = editor.CharAt[lineEndPos]
     if eol == 10 or eol == 13 then
       lineEndPos = lineEndPos + 1
       eol = editor.CharAt[lineEndPos]
       if eol == 10 then
         lineEndPos = lineEndPos + 1
       end
     end
   end
   editor:SetSel(lineStartPos, lineEndPos)
end

-- Given a line number (-1 for the line where the caret is),
-- return the position of the start of the line, of its end, and
-- the number of the line
function GetLineData(lineNb)
   if lineNb < 0 then
     lineNb = editor:LineFromPosition(editor.CurrentPos)
   end
   local lineStartPos = editor:PositionFromLine(lineNb)
   local lineEndPos = editor.LineEndPosition[lineNb]
   return lineStartPos, lineEndPos, lineNb
end



function CutToEOL()
   local lineStartPos, lineEndPos = GetLineData(-1)
    local lineCurrentPos=editor.CurrentPos
    editor:SetSel(lineCurrentPos,lineEndPos)
    editor:Cut()
end



command.name.12.*=Cut To EOL
command.12.*=CutToEOL
command.subsystem.12.*=3
command.shortcut.12.*=Ctrl+K
command.mode.12.*=savebefore:no

command.name.13.*=Select Line
command.13.*=SelectCurrentLine
command.subsystem.13.*=3
command.shortcut.13.*=Shift+Enter
command.mode.13.*=savebefore:no




they show up in the Tools menu, but don't work. I also tried to bind Alt+A to select all, in order to replace it with beginning of line for Ctrl+A, like this:

user.shortcuts=\
Ctrl+Q|IDM_QUIT|\
Alt+1|IDM_TOGGLEOUTPUT|\
Alt+Left|IDM_PREVFILE|\
Alt+Right|IDM_NEXTFILE|\
Ctrl+3|IDM_BLOCK_COMMENT|\
Alt+A|IDM_SELECTALL|

The other key bindings here work, but not Alt+A.


Finally, I prefer to have the sessions and recent file lists to be in the local directory, so that I can just go to that directory, start up Scite, and have it pick up where I left off for that particular project. I changed the source SciTEBuffers.cxx like:

FilePath SciTEBase::RecentFilePath(const char *name) {
        SString nameWithVisibility(configFileVisibilityString);
        nameWithVisibility.append(name);
//      return FilePath(GetSciteUserHome(), nameWithVisibility.c_str());
    // bb - changed so that it uses the local directory
        return FilePath("./", nameWithVisibility.c_str());
}


I think this would make a good option in the editor. Is this something that I should suggest in some formal way?


thanks for any help (and your patience)!


                        bb


--
-----------------

             [EMAIL PROTECTED]
             http://web.bryant.edu/~bblais
_______________________________________________
Scite-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scite-interest

Reply via email to