Skip to content

Commit

Permalink
Expand tabs according to config.
Browse files Browse the repository at this point in the history
  • Loading branch information
ethercrow committed Sep 18, 2014
1 parent b0d611c commit e356fab
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions yi/src/library/Yi/Keymap/Vim/InsertMap.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ import Yi.Keymap.Vim.EventUtils
import Yi.Keymap.Vim.Motion
import Yi.Keymap.Vim.Utils
import Yi.Keymap.Vim.StateUtils
import Yi.TextCompletion (completeWordB, CompletionScope(..))
import Yi.Misc
import Yi.Monad
import Yi.TextCompletion (completeWordB, CompletionScope(..))

defInsertMap :: [(String, Char)] -> [VimBinding]
defInsertMap digraphs =
Expand Down Expand Up @@ -154,7 +155,11 @@ printableAction evs = do
indentAsPreviousB
firstNonSpaceB
-- For testing purposes assume noexpandtab, tw=4
"<Tab>" -> insertN $ replicate 4 ' '
"<Tab>" -> do
IndentSettings et _ts sw <- indentSettingsB
if et
then insertN (replicate sw ' ')
else insertB '\t'
"<C-t>" -> shiftIndentOfRegionB 1 =<< regionOfB Line
"<C-d>" -> shiftIndentOfRegionB (-1) =<< regionOfB Line
"<C-e>" -> insertCharWithBelowB
Expand Down

0 comments on commit e356fab

Please sign in to comment.