aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/boxes.c
diff options
context:
space:
mode:
Diffstat (limited to 'boxes.c')
-rw-r--r--boxes.c55
1 files changed, 31 insertions, 24 deletions
diff --git a/boxes.c b/boxes.c
index 0923cab..c2bc226 100644
--- a/boxes.c
+++ b/boxes.c
@@ -1737,9 +1737,10 @@ struct keyCommand simpleCommandKeys[] =
1737 {"F10", "quit"}, 1737 {"F10", "quit"},
1738 {"Home", "startOfLine"}, 1738 {"Home", "startOfLine"},
1739 {"Left", "leftChar"}, 1739 {"Left", "leftChar"},
1740 {"Enter", "executeLine"},
1740 {"Return", "executeLine"}, 1741 {"Return", "executeLine"},
1741 {"Right", "rightChar"}, 1742 {"Right", "rightChar"},
1742 {"^[", "switchMode"}, 1743 {"Esc", "switchMode"},
1743 {"Up", "upLine"}, 1744 {"Up", "upLine"},
1744 {NULL, NULL} 1745 {NULL, NULL}
1745}; 1746};
@@ -1782,6 +1783,7 @@ struct function simpleEmacsCommands[] =
1782// The key to command mappings. 1783// The key to command mappings.
1783struct keyCommand simpleEmacsKeys[] = 1784struct keyCommand simpleEmacsKeys[] =
1784{ 1785{
1786 {"BS", "delete-backward-char"},
1785 {"Del", "delete-backward-char"}, 1787 {"Del", "delete-backward-char"},
1786 {"^D", "delete-char"}, 1788 {"^D", "delete-char"},
1787 {"Down", "next-line"}, 1789 {"Down", "next-line"},
@@ -1797,15 +1799,15 @@ struct keyCommand simpleEmacsKeys[] =
1797 {"PgDn", "scroll-up"}, 1799 {"PgDn", "scroll-up"},
1798 {"^V", "scroll-up"}, 1800 {"^V", "scroll-up"},
1799 {"PgUp", "scroll-down"}, 1801 {"PgUp", "scroll-down"},
1800 {"^[v", "scroll-down"}, // M-v 1802 {"Escv", "scroll-down"}, // M-v
1803 {"Enter", "newline"},
1801 {"Return", "newline"}, 1804 {"Return", "newline"},
1802 {"Right", "forward-char"}, 1805 {"Right", "forward-char"},
1803 {"^F", "forward-char"}, 1806 {"^F", "forward-char"},
1804 {"^[x", "execute-extended-command"}, // M-x 1807 {"Escx", "execute-extended-command"}, // M-x
1805 {"^X2", "split-window-vertically"}, 1808 {"^X2", "split-window-vertically"},
1806 {"^X3", "split-window-horizontally"}, // TODO - Just making this up for now. 1809 {"^X3", "split-window-horizontally"}, // TODO - Just making this up for now.
1807 {"^XP", "other-window"}, 1810 {"^XP", "other-window"},
1808 {"^XP", "other-window"},
1809 {"^X0", "delete-window"}, 1811 {"^X0", "delete-window"},
1810 {"Up", "previous-line"}, 1812 {"Up", "previous-line"},
1811 {"^P", "previous-line"}, 1813 {"^P", "previous-line"},
@@ -1816,7 +1818,6 @@ struct keyCommand simpleEmacsCommandKeys[] =
1816{ 1818{
1817 {"Del", "delete-backwards-char"}, 1819 {"Del", "delete-backwards-char"},
1818 {"^D", "delete-char"}, 1820 {"^D", "delete-char"},
1819 {"^D", "delete-char"},
1820 {"Down", "next-line"}, 1821 {"Down", "next-line"},
1821 {"^N", "next-line"}, 1822 {"^N", "next-line"},
1822 {"End", "end-of-line"}, 1823 {"End", "end-of-line"},
@@ -1827,8 +1828,9 @@ struct keyCommand simpleEmacsCommandKeys[] =
1827 {"^B", "backward-char"}, 1828 {"^B", "backward-char"},
1828 {"Up", "previous-line"}, 1829 {"Up", "previous-line"},
1829 {"^P", "previous-line"}, 1830 {"^P", "previous-line"},
1831 {"Enter", "accept-line"},
1830 {"Return", "accept-line"}, 1832 {"Return", "accept-line"},
1831 {"^[x", "execute-extended-command"}, 1833 {"Escx", "execute-extended-command"},
1832 {NULL, NULL} 1834 {NULL, NULL}
1833}; 1835};
1834 1836
@@ -1901,11 +1903,12 @@ struct keyCommand simpleJoeKeys[] =
1901 {"^B", "ltarw"}, 1903 {"^B", "ltarw"},
1902 {"^V", "pgdn"}, // Actually half a page. 1904 {"^V", "pgdn"}, // Actually half a page.
1903 {"^U", "pgup"}, // Actually half a page. 1905 {"^U", "pgup"}, // Actually half a page.
1906 {"Enter", "open"},
1904 {"Return", "open"}, 1907 {"Return", "open"},
1905 {"Right", "rtarw"}, 1908 {"Right", "rtarw"},
1906 {"^F", "rtarw"}, 1909 {"^F", "rtarw"},
1907 {"^[x", "execmd"}, 1910 {"Escx", "execmd"},
1908 {"^[^X", "execmd"}, 1911 {"Esc^X", "execmd"},
1909 {"^Ko", "splitw"}, 1912 {"^Ko", "splitw"},
1910 {"^K^O", "splitw"}, 1913 {"^K^O", "splitw"},
1911 {"^Kn", "nextw"}, 1914 {"^Kn", "nextw"},
@@ -1929,10 +1932,11 @@ struct keyCommand simpleJoeCommandKeys[] =
1929 {"^B", "ltarw"}, 1932 {"^B", "ltarw"},
1930 {"Right", "rtarw"}, 1933 {"Right", "rtarw"},
1931 {"^F", "rtarw"}, 1934 {"^F", "rtarw"},
1932 {"^[x", "execmd"}, 1935 {"Escx", "execmd"},
1933 {"^[^X", "execmd"}, 1936 {"Esc^X", "execmd"},
1934 {"Up", "uparw"}, 1937 {"Up", "uparw"},
1935 {"^P", "uparw"}, 1938 {"^P", "uparw"},
1939 {"Enter", "executeLine"},
1936 {"Return", "executeLine"}, 1940 {"Return", "executeLine"},
1937 {NULL, NULL} 1941 {NULL, NULL}
1938}; 1942};
@@ -1959,19 +1963,17 @@ struct context simpleJoe =
1959// No cursor movement, just scrolling. 1963// No cursor movement, just scrolling.
1960// TODO - Put content into read only mode. 1964// TODO - Put content into read only mode.
1961// TODO - actually implement read only mode where up and down one line do actual scrolling instead of cursor movement. 1965// TODO - actually implement read only mode where up and down one line do actual scrolling instead of cursor movement.
1962// TODO - maybe I can support the ZZ command in one of two ways -
1963// Just have a Z command do the quit.
1964// Have the first Z go into a special mode, where anything other than a Z restores the original mode.
1965 1966
1966struct keyCommand simpleLessKeys[] = 1967struct keyCommand simpleLessKeys[] =
1967{ 1968{
1968 {"Down", "downLine"}, 1969 {"Down", "downLine"},
1969 {"j", "downLine"}, 1970 {"j", "downLine"},
1971 {"Enter", "downLine"},
1970 {"Return", "downLine"}, 1972 {"Return", "downLine"},
1971 {"End", "endOfLine"}, 1973 {"End", "endOfLine"},
1972 {"q", "quit"}, 1974 {"q", "quit"},
1973 {":q", "quit"}, // TODO - A vi ism, should do ex command stuff instead. 1975 {":q", "quit"}, // TODO - A vi ism, should do ex command stuff instead.
1974 {"ZZ", "quit"}, // The infrastructure here does not support this style of command. 1976 {"ZZ", "quit"},
1975 {"PgDn", "downPage"}, 1977 {"PgDn", "downPage"},
1976 {"f", "downPage"}, 1978 {"f", "downPage"},
1977 {" ", "downPage"}, 1979 {" ", "downPage"},
@@ -2005,10 +2007,11 @@ struct context simpleLess =
2005struct keyCommand simpleMoreKeys[] = 2007struct keyCommand simpleMoreKeys[] =
2006{ 2008{
2007 {"j", "downLine"}, 2009 {"j", "downLine"},
2010 {"Enter", "downLine"},
2008 {"Return", "downLine"}, 2011 {"Return", "downLine"},
2009 {"q", "quit"}, 2012 {"q", "quit"},
2010 {":q", "quit"}, // See comments for "less". 2013 {":q", "quit"}, // See comments for "less".
2011 {"ZZ", "quit"}, // See comments for "less". 2014 {"ZZ", "quit"},
2012 {"f", "downPage"}, 2015 {"f", "downPage"},
2013 {" ", "downPage"}, 2016 {" ", "downPage"},
2014 {"^F", "downPage"}, 2017 {"^F", "downPage"},
@@ -2044,21 +2047,22 @@ struct keyCommand simpleMceditKeys[] =
2044 {"Down", "downLine"}, 2047 {"Down", "downLine"},
2045 {"End", "endOfLine"}, 2048 {"End", "endOfLine"},
2046 {"F10", "quit"}, 2049 {"F10", "quit"},
2047 {"^[0", "quit"}, 2050 {"Esc0", "quit"},
2048 {"F2", "save"}, 2051 {"F2", "save"},
2049 {"^[2", "save"}, 2052 {"Esc2", "save"},
2050 {"Home", "startOfLine"}, 2053 {"Home", "startOfLine"},
2051 {"Left", "leftChar"}, 2054 {"Left", "leftChar"},
2052 {"PgDn", "downPage"}, 2055 {"PgDn", "downPage"},
2053 {"PgUp", "upPage"}, 2056 {"PgUp", "upPage"},
2057 {"Enter", "splitLine"},
2054 {"Return", "splitLine"}, 2058 {"Return", "splitLine"},
2055 {"Right", "rightChar"}, 2059 {"Right", "rightChar"},
2056{"Shift F2", "switchMode"}, // MC doesn't have a command mode. 2060{"Shift F2", "switchMode"}, // MC doesn't have a command mode.
2057 {"^[:", "switchMode"}, // Sorta vi like, and coz tmux is screwing with the shift function keys somehow. 2061 {"Esc:", "switchMode"}, // Sorta vi like, and coz tmux is screwing with the shift function keys somehow.
2058 {"^[|", "splitV"}, // MC doesn't have a split window concept, so make these up to match tmux more or less. 2062 {"Esc|", "splitV"}, // MC doesn't have a split window concept, so make these up to match tmux more or less.
2059 {"^[-", "splitH"}, 2063 {"Esc-", "splitH"},
2060 {"^[o", "switchBoxes"}, 2064 {"Esco", "switchBoxes"},
2061 {"^[x", "deleteBox"}, 2065 {"Escx", "deleteBox"},
2062 {"Up", "upLine"}, 2066 {"Up", "upLine"},
2063 {NULL, NULL} 2067 {NULL, NULL}
2064}; 2068};
@@ -2128,6 +2132,7 @@ struct keyCommand simpleNanoKeys[] =
2128 {"PgDn", "downPage"}, 2132 {"PgDn", "downPage"},
2129 {"^Y", "upPage"}, // ? 2133 {"^Y", "upPage"}, // ?
2130 {"PgUp", "upPage"}, 2134 {"PgUp", "upPage"},
2135 {"Enter", "enter"}, // TODO - Not sure if this is correct.
2131 {"Return", "enter"}, // TODO - Not sure if this is correct. 2136 {"Return", "enter"}, // TODO - Not sure if this is correct.
2132 {"^F", "right"}, 2137 {"^F", "right"},
2133 {"Right", "right"}, 2138 {"Right", "right"},
@@ -2264,6 +2269,7 @@ struct keyCommand simpleViNormalKeys[] =
2264 {"^F", "downPage"}, 2269 {"^F", "downPage"},
2265 {"PgUp", "upPage"}, 2270 {"PgUp", "upPage"},
2266 {"^B", "upPage"}, 2271 {"^B", "upPage"},
2272 {"Enter", "startOfNextLine"},
2267 {"Return", "startOfNextLine"}, 2273 {"Return", "startOfNextLine"},
2268 {"Right", "rightChar"}, 2274 {"Right", "rightChar"},
2269 {"l", "rightChar"}, 2275 {"l", "rightChar"},
@@ -2289,7 +2295,7 @@ struct keyCommand simpleViInsertKeys[] =
2289 {"BS", "backSpaceChar"}, 2295 {"BS", "backSpaceChar"},
2290 {"Del", "deleteChar"}, 2296 {"Del", "deleteChar"},
2291 {"Return", "splitLine"}, 2297 {"Return", "splitLine"},
2292 {"^[", "visual"}, 2298 {"Esc", "visual"},
2293 {"^C", "visual"}, 2299 {"^C", "visual"},
2294 {NULL, NULL} 2300 {NULL, NULL}
2295}; 2301};
@@ -2302,9 +2308,10 @@ struct keyCommand simpleExKeys[] =
2302 {"End", "endOfLine"}, 2308 {"End", "endOfLine"},
2303 {"Home", "startOfLine"}, 2309 {"Home", "startOfLine"},
2304 {"Left", "leftChar"}, 2310 {"Left", "leftChar"},
2311 {"Enter", "executeLine"},
2305 {"Return", "executeLine"}, 2312 {"Return", "executeLine"},
2306 {"Right", "rightChar"}, 2313 {"Right", "rightChar"},
2307 {"^[", "visual"}, 2314 {"Esc", "visual"},
2308 {"Up", "upLine"}, 2315 {"Up", "upLine"},
2309 {NULL, NULL} 2316 {NULL, NULL}
2310}; 2317};