@@ -1270,9 +1270,32 @@ pub fn goto_mode(cx: &mut Context) {
12701270 'g' => move_file_start(cx),
12711271 'e' => move_file_end(cx),
12721272 'd' => goto_definition(cx),
1273− 't' => goto_type_definition(cx),
1273+ 'y' => goto_type_definition(cx),
12741274 'r' => goto_reference(cx),
12751275 'i' => goto_implementation(cx),
1276+
1277+ 't' | 'm' | 'b' => {
1278+ let (view, doc) = cx.current();
1279+
1280+ let pos = doc.selection(view.id).cursor();
1281+ let line = doc.text().char_to_line(pos);
1282+
1283+ let scrolloff = PADDING.min(view.area.height as usize / 2); // TODO: user pref
1284+
1285+ let last_line = view.last_line(doc);
1286+
1287+ let line = match ch {
1288+ 't' => (view.first_line + scrolloff),
1289+ 'm' => (view.first_line + (view.area.height as usize / 2)),
1290+ 'b' => last_line.saturating_sub(scrolloff),
1291+ _ => unreachable!(),
1292+ }
1293+ .min(last_line.saturating_sub(scrolloff));
1294+
1295+ let pos = doc.text().line_to_char(line);
1296+
1297+ doc.set_selection(view.id, Selection::point(pos));
1298+ }
12761299 _ => (),
12771300 }
12781301 }