Per the autoindent patch: In vim autoindent is an option so I'm reluctant to enforce the behavior with the standard Yi vim keymap. The vim keymap is set up to be extended such that this can be made an option already. See extendedVimKeymap in Yi/Users/Corey.hs for an example of how the vim keymap can be extended to add the autoindent behavior.
An alternate would be to encapsulate the aspects of Yi.User.Corey.extendedVimKeymap related to autoindent (Plus the cases it's missing) into a function in Keymap.Vim that a user can apply to vim keymap if they desired. This would keep it optional but not hide the functionality in some random User keymap. Cheers, Corey O'Connor On Tue, Dec 2, 2008 at 7:31 PM, Krzysztof Goj <[EMAIL PROTECTED]> wrote: > I've done some work on Yi this night. It's divided in 3 'darc sends': > - minor_tweaks -- lacking key bindings; One nice patch per feature; > just commit it > - eol_normal_mode -- Fixes normal mode to work more like Vim's. > The only obvious problem with this one big patch is that it fixes > several things at once. > - enter_autoindent - This one is rather hackish; It makes new lines > (via enter in insert and 'o'/'O' in normal mode) > indented like previous ones. It probably needs more work before > committing, but i post it here, > because I've found it very helpful at dogfooding (using Yi do > actually develop it). > > It's almost dawn, so it's quite probable that I made lots of stupid > mistakes; My Yi works better than ever, though. > > Good night, everyone > -- > Krzysiek > > > > > Wed Dec 3 00:52:18 CET 2008 Krzysztof Goj <[EMAIL PROTECTED]> > * Indenting as previous line on insert mode Enter and normal mode 'o'; 'O' > indends as next line > This is not perfect, but better than nothing; We obviously lack :set ai > > New patches: > > [Indenting as previous line on insert mode Enter and normal mode 'o'; 'O' > indends as next line > Krzysztof Goj <[EMAIL PROTECTED]>**20081202235218 > This is not perfect, but better than nothing; We obviously lack :set ai > ] hunk ./Yi/Buffer/Indent.hs 383 > indentToB level = do > indentSettings <- indentSettingsB > modifyRegionClever (rePadString indentSettings level) =<< regionOfB Line > - > --- | Indent as much as the previous line > -indentAsPreviousB :: BufferM () > -indentAsPreviousB = > - do previousLine <- getNextNonBlankLineB Backward > + > +-- | Indent as much as the previous/next line > +indentAsNeighbourLine :: Direction -> BufferM () > +indentAsNeighbourLine dir = > + do previousLine <- getNextNonBlankLineB dir > previousIndent <- indentOfB previousLine > indentToB previousIndent > > hunk ./Yi/Buffer/Indent.hs 391 > +-- | Indent as much as the previous line > +indentAsPreviousB :: BufferM () > +indentAsPreviousB = indentAsNeighbourLine Backward > > hunk ./Yi/Buffer/Indent.hs 395 > +-- | Indent as much as the next line > +indentAsNextB :: BufferM () > +indentAsNextB = indentAsNeighbourLine Forward > > -- | Set the padding of the string to newCount, filling in tabs if > -- expandTabs is set in the buffers IndentSettings > hunk ./Yi/Keymap/Vim.hs 671 > char 'I' ?>> beginIns self firstNonSpaceB, > char 'a' ?>> beginIns self $ moveXorEol 1, > char 'A' ?>> beginIns self moveToEol, > - char 'o' ?>> beginIns self $ moveToEol >> insertB '\n', > - char 'O' ?>> beginIns self $ moveToSol >> insertB '\n' > >> lineUp, > + char 'o' ?>> beginIns self $ moveToEol >> insertB '\n' > >> indentAsPreviousB, > + char 'O' ?>> beginIns self $ moveToSol >> insertB '\n' > >> lineUp >> indentAsNextB, > char 'c' ?>> changeCmds, > char 'C' ?>> beginIns self $ cut Exclusive viMoveToEol, > -- alias of "c$" > char 'S' ?>> beginIns self $ withBuffer0 moveToSol >> > cut Exclusive viMoveToEol, -- non-linewise alias of "cc" > hunk ./Yi/Keymap/Vim.hs 709 > spec KEnd ?>>! moveToEol, > spec KHome ?>>! moveToSol, > spec KDel ?>>! (adjBlock (-1) >> deleteB > Character Forward), > - spec KEnter ?>>! insertB '\n', > + spec KEnter ?>>! insertB '\n' >> > indentAsPreviousB, > spec KTab ?>>! insertTabB, > (ctrl $ char 't') ?>>! shiftIndentOfLine 1, > (ctrl $ char 'd') ?>>! shiftIndentOfLine (-1), > > Context: > > [Ctrl-t and Ctrl-d in insert mode (indentation) > Krzysztof Goj <[EMAIL PROTECTED]>**20081202223751] > [Fixed isMakefile: takeBaseName should be takeFileName. Otherwise makefile's > named like foo.mk would not be recognized. > [EMAIL PROTECTED] > [Issue 202: indentation and Vim commands > Krzysztof Goj <[EMAIL PROTECTED]>**20081202183446 > Added indentation-awareness to cutRegion, pasteBefore and pasteAfter. > ] > [Better percent move. > Krzysztof Goj <[EMAIL PROTECTED]>**20081202162105] > [replace all: more helpful message > [EMAIL PROTECTED] > [fix build > [EMAIL PROTECTED] > [Better word and WORD motions for Vim keymap. > Krzysztof Goj <[EMAIL PROTECTED]>**20081202132813] > [doc > [EMAIL PROTECTED] > [Yi/Users/Gwern.hs: +shorter binding for gotoLn > [EMAIL PROTECTED] > Ignore-this: 5defc56344c3e1c61bd602d192e06af3 > I find the default Emacs binding of M-g g tedious; why not just M-g? > ] > [doc > [EMAIL PROTECTED] > [make Accessor instance of Category > [EMAIL PROTECTED] > [use Control.Category > [EMAIL PROTECTED] > [Yi.Keymap.Emacs: +standard emacs M-; binding > [EMAIL PROTECTED] > Ignore-this: 5abf2d7154acfdcce44286f34ec238b9 > ] > [update to base>=4; replace all Control.Exception with Control.OldException > [EMAIL PROTECTED] > Ignore-this: 205b7c23a4ffcc16b8612d0b4edc9352 > ] > [better support for vivid colors > [EMAIL PROTECTED] > [Main.hs: minor indent > [EMAIL PROTECTED] > Ignore-this: b53fd55beb556c92b6bba9ee4a49cd61 > ] > [added C-w and C-u to ex mode > Aleksandar Dimitrov <[EMAIL PROTECTED]>**20081201103414] > ['ZZ' closes window, not editor, 'ZQ' == ':q!' > Aleksandar Dimitrov <[EMAIL PROTECTED]>**20081201103311] > [bump version number > [EMAIL PROTECTED] > [TAG 0.5.2 > [EMAIL PROTECTED] > Patch bundle hash: > 25c2a30184cf6b5431148f297a772f73668f467d > > Wed Dec 3 04:10:45 CET 2008 Krzysztof Goj <[EMAIL PROTECTED]> > * Behaviour at end of line (BIG PATCH) > - Doesn't allow to go to EOL in normal mode > - Does allow it in other (visual, insert, replace) modes > - Corrected D, and '$' command > - cursor moves left after leaving insert and replace mode > > > New patches: > > [Behaviour at end of line (BIG PATCH) > Krzysztof Goj <[EMAIL PROTECTED]>**20081203031045 > - Doesn't allow to go to EOL in normal mode > - Does allow it in other (visual, insert, replace) modes > - Corrected D, and '$' command > - cursor moves left after leaving insert and replace mode > > ] hunk ./Yi/Buffer/HighLevel.hs 43 > botB :: BufferM () > botB = moveTo =<< sizeB > > +-- | Move left if on eol, but not on blank line > +leftOnEol :: BufferM () > +leftOnEol = do > + eol <- atEol > + sol <- atSol > + when (eol && not sol) leftB > + > -- | Move @x@ chars back, or to the sol, whichever is less > moveXorSol :: Int -> BufferM () > moveXorSol x = replicateM_ x $ do c <- atSol; when (not c) leftB > hunk ./Yi/Keymap/Vim.hs 110 > > -- | Replace mode is like insert, except it performs writes, not inserts > rep_mode :: VimMode > - rep_mode = write (setStatus ("-- REPLACE --", defaultStyle)) >> many > rep_char >> leave > + rep_mode = write (setStatus ("-- REPLACE --", defaultStyle)) >> many > rep_char >> leave >> (write leftB) > > -- | Reset the selection style to a character-wise mode 'SelectionStyle > Character'. > resetSelectStyle :: BufferM () > hunk ./Yi/Keymap/Vim.hs 117 > resetSelectStyle = setDynamicB $ SelectionStyle Character > > -- | Visual mode, similar to command mode > + vis_move :: VimMode > + vis_move = gen_cmd_move >>= write . viMove . snd > + > vis_mode :: SelectionStyle -> VimMode > hunk ./Yi/Keymap/Vim.hs 121 > - vis_mode selectionStyle = do > + vis_mode selStyle = do > write (setVisibleSelection True >> pointB >>= setSelectionMarkPointB) > hunk ./Yi/Keymap/Vim.hs 123 > - core_vis_mode selectionStyle > + core_vis_mode selStyle > write (clrStatus >> withBuffer0 (setVisibleSelection False) >> > withBuffer0 resetSelectStyle) > hunk ./Yi/Keymap/Vim.hs 125 > - > + > core_vis_mode :: SelectionStyle -> VimMode > hunk ./Yi/Keymap/Vim.hs 127 > - core_vis_mode selectionStyle = do > - write $ do withBuffer0 $ setDynamicB $ selectionStyle > - setStatus $ (msg selectionStyle, defaultStyle) > - many (cmd_move <|> > + core_vis_mode selStyle = do > + write $ do withBuffer0 $ setDynamicB $ selStyle > + setStatus $ (msg selStyle, defaultStyle) > + many (vis_move <|> > select_any_unit (withBuffer0 . (\r -> resetSelectStyle >> > extendSelectRegionB r >> leftB))) > hunk ./Yi/Keymap/Vim.hs 132 > - (vis_single selectionStyle <|| vis_multi) > + (vis_single selStyle <|| vis_multi) > where msg (SelectionStyle Line) = "-- VISUAL LINE --" > msg (SelectionStyle _) = "-- VISUAL --" > > hunk ./Yi/Keymap/Vim.hs 151 > cs <- many $ charOf id '0' '9' > return $ Just $ read (c:cs) > > + viMoveToNthEol :: Int -> BufferM () > + viMoveToNthEol n = (replicateM_ n $ moveB Line Forward) > + > viMoveToEol :: ViMove > viMoveToEol = MaybeMove Line Forward > > hunk ./Yi/Keymap/Vim.hs 173 > -- > > cmd_move :: VimMode > - cmd_move = gen_cmd_move >>= write . viMove . snd > + cmd_move = gen_cmd_move >>= write . viMoveNM . snd > > -- the returned RegionStyle is used when the movement is combined with a > 'cut' or 'yank'. > gen_cmd_move :: KeymapM (RegionStyle, ViMove) > hunk ./Yi/Keymap/Vim.hs 198 > -- | movement commands (with exclusive cut/yank semantics) > moveCmdFM_exclusive :: [(Event, (Int -> ViMove))] > moveCmdFM_exclusive = > - -- left/right > + -- left/right > [(char 'h', left) > ,(ctrl $ char 'h', left) > ,(spec KBS, left) > hunk ./Yi/Keymap/Vim.hs 206 > ,(spec KRight, right) > ,(char 'l', right) > ,(char ' ', right) > + -- eol / sol / special column > ,(spec KHome, sol) > ,(char '^', const $ ArbMove firstNonSpaceB) > ,(char '|', \i -> SeqMove viMoveToSol (Replicate (CharMove > Forward) (i-1))) > hunk ./Yi/Keymap/Vim.hs 210 > - > + ,(char '$', eol) > + ,(spec KEnd, eol) > -- words > ,(char 'w', Replicate $ GenMove unitViWord > (Backward,InsideBound) Forward) > ,(char 'W', Replicate $ GenMove unitViWORD > (Backward,InsideBound) Forward) > hunk ./Yi/Keymap/Vim.hs 227 > left = Replicate $ CharMove Backward > right = Replicate $ CharMove Forward > sol = Replicate $ viMoveToSol > + eol = ArbMove . viMoveToNthEol > > -- | movement *multi-chars* commands (with exclusive cut/yank semantics) > moveCmdS_exclusive :: [(String, (Int -> ViMove))] > hunk ./Yi/Keymap/Vim.hs 235 > [("[(", Replicate $ ArbMove (goUnmatchedB Backward '(' ')')) > ,("[{", Replicate $ ArbMove (goUnmatchedB Backward '{' '}')) > ,("])", Replicate $ ArbMove (goUnmatchedB Forward '(' ')')) > - ,("]}", Replicate $ ArbMove (goUnmatchedB Forward '{' '}')) > - ] > + ,("]}", Replicate $ ArbMove (goUnmatchedB Forward '{' '}'))] > > -- | movement commands (with inclusive cut/yank semantics) > moveCmdFM_inclusive :: [(Event, (Int -> ViMove))] > hunk ./Yi/Keymap/Vim.hs 240 > moveCmdFM_inclusive = > - -- left/right > - [(char '$', eol) > - ,(spec KEnd, eol) > - -- words > - ,(char 'e', Replicate $ GenMove unitViWord (Forward, > InsideBound) Forward) > + [(char 'e', Replicate $ GenMove unitViWord (Forward, > InsideBound) Forward) > ,(char 'E', Replicate $ GenMove unitViWORD (Forward, > InsideBound) Forward)] > hunk ./Yi/Keymap/Vim.hs 242 > - where > - eol = Replicate $ viMoveToEol > > -- | movement *multi-chars* commands (with inclusive cut/yank semantics) > moveCmdS_inclusive :: [(String, (Int -> ViMove))] > hunk ./Yi/Keymap/Vim.hs 256 > <*> (savingPointB (viMove move >> pointB)) > <*> pure regionStyle > > + -- viMove Normal Mode > + viMoveNM :: ViMove -> BufferM () > + viMoveNM move = viMove move >> leftOnEol > + > viMove :: ViMove -> BufferM () > viMove NoMove = return () > viMove (GenMove unit boundary dir) = genMoveB unit boundary dir > hunk ./Yi/Keymap/Vim.hs 390 > ,(ctrl $ char 'r', withBuffer . flip replicateM_ redoB) > ,(ctrl $ char 'z', const suspendEditor) > ,(ctrl $ char ']', const gotoTagCurrentWord) > - ,(char 'D', withEditor . cut Exclusive . (Replicate $ Move > Line Forward)) > + ,(char 'D', withEditor . cut Exclusive . ArbMove . > viMoveToNthEol) > ,(char 'J', const (withBuffer (moveToEol >> deleteN 1))) -- > the "\n" > ,(char 'Y', \n -> withEditor $ do > let move = Replicate (Move Line Forward) n > hunk ./Yi/Keymap/Vim.hs 567 > when (rowsCut > 2) $ printMsg $ show rowsCut ++ " fewer lines" > > cut :: RegionStyle -> ViMove -> EditorM () > - cut regionStyle move = > - cutRegion regionStyle =<< (withBuffer0 $ regionOfViMove move > regionStyle) > + cut regionStyle move = do > + region <- withBuffer0 $ regionOfViMove move regionStyle > + cutRegion regionStyle region > + withBuffer0 leftOnEol > > cutSelection :: EditorM () > cutSelection = uncurry cutRegion =<< withBuffer0 regionOfSelection > hunk ./Yi/Keymap/Vim.hs 579 > pasteOverSelection = do > txt <- getRegE > withBuffer0 $ do > - selectionStyle <- getDynamicB > + selStyle <- getDynamicB > start <- getSelectionMarkPointB > stop <- pointB > hunk ./Yi/Keymap/Vim.hs 582 > - region <- mkRegionOfStyleB start stop $ selection2regionStyle $ > selectionStyle > + region <- mkRegionOfStyleB start stop $ selection2regionStyle $ > selStyle > moveTo $ regionStart region > deleteRegionB region > insertN txt > hunk ./Yi/Keymap/Vim.hs 627 > -- KeymapM. In this way vis_single is analogous to cmd2other > -- > vis_single :: SelectionStyle -> VimMode > - vis_single selectionStyle = > + vis_single selStyle = > choice [spec KEsc ?>> return (), > hunk ./Yi/Keymap/Vim.hs 629 > - char 'V' ?>> change_vis_mode selectionStyle > (SelectionStyle Line), > - char 'v' ?>> change_vis_mode selectionStyle > (SelectionStyle Character), > + char 'V' ?>> change_vis_mode selStyle (SelectionStyle > Line), > + char 'v' ?>> change_vis_mode selStyle (SelectionStyle > Character), > char ':' ?>>! ex_mode ":'<,'>", > char 'y' ?>>! yankSelection, > char 'x' ?>>! cutSelection, > hunk ./Yi/Keymap/Vim.hs 682 > char 'o' ?>> beginIns self $ moveToEol >> insertB '\n', > char 'O' ?>> beginIns self $ moveToSol >> insertB '\n' > >> lineUp, > char 'c' ?>> changeCmds, > - char 'C' ?>> beginIns self $ cut Exclusive viMoveToEol, > -- alias of "c$" > + char 'C' ?>> beginIns self $ cut Exclusive viMoveToEol, > -- alias of "c$" FIXME > char 'S' ?>> beginIns self $ withBuffer0 moveToSol >> > cut Exclusive viMoveToEol, -- non-linewise alias of "cc" > char 's' ?>> beginIns self $ cut Exclusive (CharMove > Forward), -- non-linewise alias of "cl" > char '/' ?>>! ex_mode "/", > hunk ./Yi/Keymap/Vim.hs 702 > change :: ViMove -> RegionStyle -> ViMove -> I Event Action () > change preMove regionStyle move = do > write $ do > - withBuffer0 $ viMove preMove > + withBuffer0 $ viMoveNM preMove > cut regionStyle move > when (regionStyle == LineWise) $ withBuffer0 (insertB '\n' >> leftB) > ins_mode self > hunk ./Yi/Keymap/Vim.hs 1057 > > -- | Insert mode is either insertion actions, or the meta (\ESC) action > ins_mode :: ModeMap -> VimMode > -ins_mode self = write (setStatus ("-- INSERT --", defaultStyle)) >> many > (v_ins_char self <|> kwd_mode) >> leave > +ins_mode self = write (setStatus ("-- INSERT --", defaultStyle)) >> many > (v_ins_char self <|> kwd_mode) >> leave >> (write leftB) > > beginIns :: (Show x, YiAction a x) => ModeMap -> a -> I Event Action () > beginIns self a = write a >> ins_mode self > > Context: > > [Ctrl-t and Ctrl-d in insert mode (indentation) > Krzysztof Goj <[EMAIL PROTECTED]>**20081202223751] > [Fixed isMakefile: takeBaseName should be takeFileName. Otherwise makefile's > named like foo.mk would not be recognized. > [EMAIL PROTECTED] > [Issue 202: indentation and Vim commands > Krzysztof Goj <[EMAIL PROTECTED]>**20081202183446 > Added indentation-awareness to cutRegion, pasteBefore and pasteAfter. > ] > [Better percent move. > Krzysztof Goj <[EMAIL PROTECTED]>**20081202162105] > [replace all: more helpful message > [EMAIL PROTECTED] > [fix build > [EMAIL PROTECTED] > [Better word and WORD motions for Vim keymap. > Krzysztof Goj <[EMAIL PROTECTED]>**20081202132813] > [doc > [EMAIL PROTECTED] > [Yi/Users/Gwern.hs: +shorter binding for gotoLn > [EMAIL PROTECTED] > Ignore-this: 5defc56344c3e1c61bd602d192e06af3 > I find the default Emacs binding of M-g g tedious; why not just M-g? > ] > [doc > [EMAIL PROTECTED] > [make Accessor instance of Category > [EMAIL PROTECTED] > [use Control.Category > [EMAIL PROTECTED] > [Yi.Keymap.Emacs: +standard emacs M-; binding > [EMAIL PROTECTED] > Ignore-this: 5abf2d7154acfdcce44286f34ec238b9 > ] > [update to base>=4; replace all Control.Exception with Control.OldException > [EMAIL PROTECTED] > Ignore-this: 205b7c23a4ffcc16b8612d0b4edc9352 > ] > [better support for vivid colors > [EMAIL PROTECTED] > [Main.hs: minor indent > [EMAIL PROTECTED] > Ignore-this: b53fd55beb556c92b6bba9ee4a49cd61 > ] > [added C-w and C-u to ex mode > Aleksandar Dimitrov <[EMAIL PROTECTED]>**20081201103414] > ['ZZ' closes window, not editor, 'ZQ' == ':q!' > Aleksandar Dimitrov <[EMAIL PROTECTED]>**20081201103311] > [bump version number > [EMAIL PROTECTED] > [TAG 0.5.2 > [EMAIL PROTECTED] > Patch bundle hash: > eac1120ece71b4c1510695f4b02ff138336140c1 > > Wed Dec 3 00:15:44 CET 2008 Krzysztof Goj <[EMAIL PROTECTED]> > * Vim: ctrl+u, ctrl+d scrolling > > Wed Dec 3 00:35:09 CET 2008 Krzysztof Goj <[EMAIL PROTECTED]> > * Vim visual mode: 's' is synonym to 'c' > > Wed Dec 3 00:58:07 CET 2008 Krzysztof Goj <[EMAIL PROTECTED]> > * Ctrl+p, Ctrl+n in Ex mode > > Wed Dec 3 01:00:17 CET 2008 Krzysztof Goj <[EMAIL PROTECTED]> > * Ctrl+h in Ex mode > > Wed Dec 3 02:26:14 CET 2008 Krzysztof Goj <[EMAIL PROTECTED]> > * Ctrl+h in insert and replace mode; Ctrl+w in replace mode > > New patches: > > [Vim: ctrl+u, ctrl+d scrolling > Krzysztof Goj <[EMAIL PROTECTED]>**20081202231544] hunk > ./Yi/Buffer/HighLevel.hs 300 > scrollByB f n = do h <- askWindow height > scrollB $ n * (f h) > > +-- | Same as ScrollByB, but also moves the cursor > +vimScrollByB :: (Int -> Int) -> Int -> BufferM () > +vimScrollByB f n = do h <- askWindow height > + scrollB $ n * (f h) > + lineMoveRel $ n * (f h) > + return () > + > -- | Scroll by n lines. > scrollB :: Int -> BufferM () > scrollB n = do setA pointDriveA False > hunk ./Yi/Keymap/Vim.hs 377 > singleCmdFM = > [(ctrl $ char 'b', withBuffer . upScreensB) -- vim > does (firstNonSpaceB;moveXorSol) > ,(ctrl $ char 'f', withBuffer . downScreensB) > - ,(ctrl $ char 'u', withBuffer . scrollByB (negate . (`div` 2))) > - ,(ctrl $ char 'd', withBuffer . scrollByB (`div` 2)) > + ,(ctrl $ char 'u', withBuffer . vimScrollByB (negate . (`div` > 2))) > + ,(ctrl $ char 'd', withBuffer . vimScrollByB (`div` 2)) > ,(ctrl $ char 'g', const viFileInfo) > ,(ctrl $ char 'l', const refreshEditor) > ,(ctrl $ char 'r', withBuffer . flip replicateM_ redoB) > [Vim visual mode: 's' is synonym to 'c' > Krzysztof Goj <[EMAIL PROTECTED]>**20081202233509] hunk ./Yi/Keymap/Vim.hs 628 > char 'x' ?>>! cutSelection, > char 'd' ?>>! cutSelection, > char 'p' ?>>! pasteOverSelection, > + char 's' ?>> beginIns self (cutSelection >> withBuffer0 > (setVisibleSelection False)), > char 'c' ?>> beginIns self (cutSelection >> withBuffer0 > (setVisibleSelection False))] > > > [Ctrl+p, Ctrl+n in Ex mode > Krzysztof Goj <[EMAIL PROTECTED]>**20081202235807] hunk ./Yi/Keymap/Vim.hs 761 > spec KEsc ?>>! closeBufferAndWindowE, > spec KBS ?>>! deleteB Character Backward, > spec KDel ?>>! deleteB Character Forward, > + (ctrl $ char 'p') ?>>! historyUp, > spec KUp ?>>! historyUp, > hunk ./Yi/Keymap/Vim.hs 763 > + (ctrl $ char 'n') ?>>! historyDown, > spec KDown ?>>! historyDown, > spec KLeft ?>>! moveXorSol 1, > spec KRight ?>>! moveXorEol 1, > [Ctrl+h in Ex mode > Krzysztof Goj <[EMAIL PROTECTED]>**20081203000017] hunk ./Yi/Keymap/Vim.hs 759 > choice [spec KEnter ?>>! ex_buffer_finish, > spec KTab ?>>! completeMinibuffer, > spec KEsc ?>>! closeBufferAndWindowE, > + (ctrl $ char 'h') ?>>! deleteB Character Backward, > spec KBS ?>>! deleteB Character Backward, > spec KDel ?>>! deleteB Character Forward, > (ctrl $ char 'p') ?>>! historyUp, > [Ctrl+h in insert and replace mode; Ctrl+w in replace mode > Krzysztof Goj <[EMAIL PROTECTED]>**20081203012614] hunk ./Yi/Keymap/Vim.hs 713 > spec KEnter ?>>! insertB '\n', > spec KTab ?>>! insertTabB, > (ctrl $ char 't') ?>>! shiftIndentOfLine 1, > - (ctrl $ char 'd') ?>>! shiftIndentOfLine (-1), > - (ctrl $ char 'w') ?>>! cut Exclusive (GenMove > unitViWord (Backward,InsideBound) Backward)] > + (ctrl $ char 'd') ?>>! shiftIndentOfLine (-1) > + ] > > -- > -- Some ideas for a better insert mode are contained in: > hunk ./Yi/Keymap/Vim.hs 725 > -- which suggest that movement commands be added to insert mode, along > -- with delete. > -- > - def_ins_char = (spec KBS ?>>! adjBlock (-1) >> deleteB Character > Backward) > + def_ins_char = > + choice [spec KBS ?>>! adjBlock (-1) >> deleteB > Character Backward, > + (ctrl $ char 'h') ?>>! adjBlock (-1) >> deleteB > Character Backward, > + (ctrl $ char 'w') ?>>! cut Exclusive (GenMove > unitViWord (Backward,InsideBound) Backward) > + ] > <|> ins_rep_char > <|| (textChar >>= write . (adjBlock 1 >>) . insertB) > > hunk ./Yi/Keymap/Vim.hs 743 > -- characters in a line stays the same until you get to the end of the > line. > -- If a <NL> is typed, a line break is inserted and no character is > deleted. > rep_char :: VimMode > - rep_char = (spec KBS ?>>! leftB) -- should undo unless pointer has been > moved > + rep_char = choice [spec KBS ?>>! leftB, > + (ctrl $ char 'h') ?>>! leftB, > + (ctrl $ char 'w') ?>>! genMoveB unitViWord > (Backward,InsideBound) Backward > + ] -- should undo unless pointer has been moved > <|> ins_rep_char > <|| do c <- textChar; write (do e <- atEol; if e then insertB > c else writeB c) > > > Context: > > [Ctrl-t and Ctrl-d in insert mode (indentation) > Krzysztof Goj <[EMAIL PROTECTED]>**20081202223751] > [Fixed isMakefile: takeBaseName should be takeFileName. Otherwise makefile's > named like foo.mk would not be recognized. > [EMAIL PROTECTED] > [Issue 202: indentation and Vim commands > Krzysztof Goj <[EMAIL PROTECTED]>**20081202183446 > Added indentation-awareness to cutRegion, pasteBefore and pasteAfter. > ] > [Better percent move. > Krzysztof Goj <[EMAIL PROTECTED]>**20081202162105] > [replace all: more helpful message > [EMAIL PROTECTED] > [fix build > [EMAIL PROTECTED] > [Better word and WORD motions for Vim keymap. > Krzysztof Goj <[EMAIL PROTECTED]>**20081202132813] > [doc > [EMAIL PROTECTED] > [Yi/Users/Gwern.hs: +shorter binding for gotoLn > [EMAIL PROTECTED] > Ignore-this: 5defc56344c3e1c61bd602d192e06af3 > I find the default Emacs binding of M-g g tedious; why not just M-g? > ] > [doc > [EMAIL PROTECTED] > [make Accessor instance of Category > [EMAIL PROTECTED] > [use Control.Category > [EMAIL PROTECTED] > [Yi.Keymap.Emacs: +standard emacs M-; binding > [EMAIL PROTECTED] > Ignore-this: 5abf2d7154acfdcce44286f34ec238b9 > ] > [update to base>=4; replace all Control.Exception with Control.OldException > [EMAIL PROTECTED] > Ignore-this: 205b7c23a4ffcc16b8612d0b4edc9352 > ] > [better support for vivid colors > [EMAIL PROTECTED] > [Main.hs: minor indent > [EMAIL PROTECTED] > Ignore-this: b53fd55beb556c92b6bba9ee4a49cd61 > ] > [added C-w and C-u to ex mode > Aleksandar Dimitrov <[EMAIL PROTECTED]>**20081201103414] > ['ZZ' closes window, not editor, 'ZQ' == ':q!' > Aleksandar Dimitrov <[EMAIL PROTECTED]>**20081201103311] > [bump version number > [EMAIL PROTECTED] > [TAG 0.5.2 > [EMAIL PROTECTED] > Patch bundle hash: > ccfac6643ca6b8ad66c1a3d84bcb773b2699bd83 > > --~--~---------~--~----~------------~-------~--~----~ Yi development mailing list yi-devel@googlegroups.com http://groups.google.com/group/yi-devel -~----------~----~----~----~------~----~------~--~---