summaryrefslogtreecommitdiffstats
path: root/default-plugins/status-bar
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2022-10-05 07:44:00 +0200
committerGitHub <noreply@github.com>2022-10-05 07:44:00 +0200
commit79bf6ab868cbdab1f9a3827c9b70198f54548b44 (patch)
tree2d6fc4c1d8a79ebd727a1a5f8b6406617dd0de55 /default-plugins/status-bar
parent917e9b2ff0f583183c0155060d243afd295770b9 (diff)
feat(config): switch to kdl (#1759)
* chore(config): default kdl keybindings config * tests * work * refactor(config): move stuff around * work * tab merge layout * work * work * layouts working * work * layout tests * work * work * feat(parsing): kdl layouts without config * refactor(kdl): move stuff around * work * tests(layout): add cases and fix bugs * work * fix(kdl): various bugs * chore(layouts): move all layouts to kdl * feat(kdl): shared keybidns * fix(layout): do not count fixed panes toward percentile * fix(keybinds): missing keybinds and actions * fix(config): adjust default tips * refactor(config): move stuff around * fix(tests): make e2e tests pass * fix(kdl): add verbose parsing errors * fix(kdl): focused tab * fix(layout): corret default_tab_template behavior * style(code): fix compile warnings * feat(cli): send actions through the cli * fix(cli): exit only when action is done * fix(cli): open embedded pane from floating pane * fix(cli): send actions to other sessions * feat(cli): command alias * feat(converter): convert old config * feat(converter): convert old layout and theme files * feat(kdl): pretty errors * feat(client): convert old YAML files on startup * fix: various bugs and styling issues * fix: e2e tests * fix(screen): propagate errors after merge * style(clippy): lower clippy level * fix(tests): own session_name variable * style(fmt): rustfmt * fix(cli): various action fixes * style(fmt): rustfmt * fix(themes): loading of theme files * style(fmt): rustfmt * fix(tests): theme fixtures * fix(layouts): better errors on unknown nodes * fix(kdl): clarify valid node terminator error * fix(e2e): adjust close tab test * fix(e2e): adjust close tab test again * style(code): cleanup some comments
Diffstat (limited to 'default-plugins/status-bar')
-rw-r--r--default-plugins/status-bar/src/second_line.rs10
-rw-r--r--default-plugins/status-bar/src/tip/data/quicknav.rs7
2 files changed, 11 insertions, 6 deletions
diff --git a/default-plugins/status-bar/src/second_line.rs b/default-plugins/status-bar/src/second_line.rs
index 26afcd94f..8f0ff42a3 100644
--- a/default-plugins/status-bar/src/second_line.rs
+++ b/default-plugins/status-bar/src/second_line.rs
@@ -161,7 +161,7 @@ fn get_keys_and_hints(mi: &ModeInfo) -> Vec<(String, String, Vec<Key>)> {
(s("Embed pane"), s("Embed"), action_key(&km, &[A::TogglePaneEmbedOrFloating, TO_NORMAL])),
(s("Next"), s("Next"), action_key(&km, &[A::SwitchFocus])),
(s("Select pane"), s("Select"), to_normal_key),
- ]} else if mi.mode == IM::Tab {
+ ]} else if mi.mode == IM::Tab {
// With the default bindings, "Move focus" for tabs is tricky: It binds all the arrow keys
// to moving tabs focus (left/up go left, right/down go right). Since we sort the keys
// above and then dedpulicate based on the actions, we will end up with LeftArrow for
@@ -180,9 +180,9 @@ fn get_keys_and_hints(mi: &ModeInfo) -> Vec<(String, String, Vec<Key>)> {
vec![
(s("Move focus"), s("Move"), focus_keys),
- (s("New"), s("New"), action_key(&km, &[A::NewTab(None), TO_NORMAL])),
+ (s("New"), s("New"), action_key(&km, &[A::NewTab(None, None), TO_NORMAL])),
(s("Close"), s("Close"), action_key(&km, &[A::CloseTab, TO_NORMAL])),
- (s("Rename"), s("Rename"),
+ (s("Rename"), s("Rename"),
action_key(&km, &[A::SwitchToMode(IM::RenameTab), A::TabNameInput(vec![0])])),
(s("Sync"), s("Sync"), action_key(&km, &[A::ToggleActiveSyncTab, TO_NORMAL])),
(s("Toggle"), s("Toggle"), action_key(&km, &[A::ToggleTab])),
@@ -192,7 +192,7 @@ fn get_keys_and_hints(mi: &ModeInfo) -> Vec<(String, String, Vec<Key>)> {
&[A::Resize(RDir::Left)], &[A::Resize(RDir::Down)],
&[A::Resize(RDir::Up)], &[A::Resize(RDir::Right)]])),
(s("Increase/Decrease size"), s("Increase/Decrease"),
- action_key_group(&km, &[&[A::Resize(RDir::Increase)], &[A::Resize(RDir::Decrease)]])),
+ action_key_group(&km, &[&[A::Resize(RDir::Increase)], &[A::Resize(RDir::Decrease)]])),
(s("Select pane"), s("Select"), to_normal_key),
]} else if mi.mode == IM::Move { vec![
(s("Move"), s("Move"), action_key_group(&km, &[
@@ -242,7 +242,7 @@ fn get_keys_and_hints(mi: &ModeInfo) -> Vec<(String, String, Vec<Key>)> {
(s("Split down"), s("Down"), action_key(&km, &[A::NewPane(Some(Dir::Down)), TO_NORMAL])),
(s("Split right"), s("Right"), action_key(&km, &[A::NewPane(Some(Dir::Right)), TO_NORMAL])),
(s("Fullscreen"), s("Fullscreen"), action_key(&km, &[A::ToggleFocusFullscreen, TO_NORMAL])),
- (s("New tab"), s("New"), action_key(&km, &[A::NewTab(None), TO_NORMAL])),
+ (s("New tab"), s("New"), action_key(&km, &[A::NewTab(None, None), TO_NORMAL])),
(s("Rename tab"), s("Rename"),
action_key(&km, &[A::SwitchToMode(IM::RenameTab), A::TabNameInput(vec![0])])),
(s("Previous Tab"), s("Previous"), action_key(&km, &[A::GoToPreviousTab, TO_NORMAL])),
diff --git a/default-plugins/status-bar/src/tip/data/quicknav.rs b/default-plugins/status-bar/src/tip/data/quicknav.rs
index 59b604a70..57d60a2d9 100644
--- a/default-plugins/status-bar/src/tip/data/quicknav.rs
+++ b/default-plugins/status-bar/src/tip/data/quicknav.rs
@@ -72,13 +72,18 @@ fn add_keybinds(help: &ModeInfo) -> Keygroups {
style_key_with_modifier(&new_pane_keys, &help.style.colors)
};
- let resize_keys = action_key_group(
+ let mut resize_keys = action_key_group(
&normal_keymap,
&[
&[Action::Resize(ResizeDirection::Increase)],
&[Action::Resize(ResizeDirection::Decrease)],
],
);
+ if resize_keys.contains(&Key::Alt(CharOrArrow::Char('=')))
+ && resize_keys.contains(&Key::Alt(CharOrArrow::Char('+')))
+ {
+ resize_keys.retain(|k| k != &Key::Alt(CharOrArrow::Char('=')));
+ }
let resize = if resize_keys.is_empty() {
vec![Style::new().bold().paint("UNBOUND")]
} else {
id='n779' href='#n779'>779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368
*mbyte.txt*     For Vim version 7.0aa.  Last change: 2004 Jun 07


		  VIM REFERENCE MANUAL	  by Bram Moolenaar et al.


Multi-byte support				*multibyte* *multi-byte*
						*Chinese* *Japanese* *Korean*
This is about editing text in languages which have many characters that can
not be represented using one byte (one octet).  Examples are Chinese, Japanese
and Korean.  Unicode is also covered here.

For an introduction to the most common features, see |usr_45.txt| in the user
manual.
For changing the language of messages and menus see |mlang.txt|.

{not available when compiled without the +multi_byte feature}


1.  Getting started			|mbyte-first|
2.  Locale				|mbyte-locale|
3.  Encoding				|mbyte-encoding|
4.  Using a terminal			|mbyte-terminal|
5.  Fonts on X11			|mbyte-fonts-X11|
6.  Fonts on MS-Windows			|mbyte-fonts-MSwin|
7.  Input on X11			|mbyte-XIM|
8.  Input on MS-Windows			|mbyte-IME|
9.  Input with a keymap			|mbyte-keymap|
10. Using UTF-8				|mbyte-utf8|
11. Overview of options			|mbyte-options|

NOTE: This file contains UTF-8 characters.  These may show up as strange
characters or boxes when using another encoding.

==============================================================================
1. Getting started					*mbyte-first*

This is a summary of the multibyte features in Vim.  If you are lucky it works
as described and you can start using Vim without much trouble.  If something
doesn't work you will have to read the rest.  Don't be surprised if it takes
quite a bit of work and experimenting to make Vim use all the multi-byte
features.  Unfortunately, every system has its own way to deal with multibyte
languages and it is quite complicated.


COMPILING

If you already have a compiled Vim program, check if the |+multi_byte| feature
is included.  The |:version| command can be used for this.

If +multi_byte is not included, you should compile Vim with "big" features.
You can further tune what features are included.  See the INSTALL files in the
source directory.


LOCALE

First of all, you must make sure your current locale is set correctly.  If
your system has been installed to use the language, it probably works right
away.  If not, you can often make it work by setting the $LANG environment
variable in your shell: >

	setenv LANG ja_JP.EUC

Unfortunately, the name of the locale depends on your system.  Japanese might
also be called "ja_JP.EUCjp" or just "ja".  To see what is currently used: >

	:language

To change the locale inside Vim use: >

	:language ja_JP.EUC

Vim will give an error message if this doesn't work.  This is a good way to
experiment and find the locale name you want to use.  But it's always better
to set the locale in the shell, so that it is used right from the start.

See |mbyte-locale| for details.


ENCODING

If your locale works properly, Vim will try to set the 'encoding' option
accordingly.  If this doesn't work you can overrule its value: >

	:set encoding=utf-8

See |encoding-values| for a list of acceptable values.

The result is that all the text that is used inside Vim will be in this
encoding.  Not only the text in the buffers, but also in registers, variables,
etc.  This also means that changing the value of 'encoding' makes the existing
text invalid!  The text doesn't change, but it will be displayed wrong.

You can edit files in another encoding than what 'encoding' is set to.  Vim
will convert the file when you read it and convert it back when you write it.
See 'fileencoding', 'fileencodings' and |++enc|.


DISPLAY AND FONTS

If you are working in a terminal (emulator) you must make sure it accepts the
same encoding as which Vim is working with.  If this is not the case, you can
use the 'termencoding' option to make Vim convert text automatically.

For the GUI you must select fonts that work with the current 'encoding'.  This
is the difficult part.  It depends on the system you are using, the locale and
a few other things.  See the chapters on fonts: |mbyte-fonts-X11| for
X-Windows and |mbyte-fonts-MSwin| for MS-Windows.

For GTK+ 2, you can skip most of this section.  The option 'guifontset' does
no longer exist.  You only need to set 'guifont' and everything should "just
work".  If your system comes with Xft2 and fontconfig and the current font
does not contain a certain glyph, a different font will be used automatically
if available.  The 'guifontwide' option is still supported but usually you do
not need to set it.  It is only necessary if the automatic font selection does
not suit your needs.

For X11 you can set the 'guifontset' option to a list of fonts that together
cover the characters that are used.  Example for Korean: >

	:set guifontset=k12,r12

Alternatively, you can set 'guifont' and 'guifontwide'.  'guifont' is used for
the single-width characters, 'guifontwide' for the double-width characters.
Thus the 'guifontwide' font must be exactly twice as wide as 'guifont'.
Example for UTF-8: >

	:set guifont=-misc-fixed-medium-r-normal-*-18-120-100-100-c-90-iso10646-1
	:set guifontwide=-misc-fixed-medium-r-normal-*-18-120-100-100-c-180-iso10646-1

You can also set 'guifont' alone, Vim will try to find a matching
'guifontwide' for you.


INPUT

There are several ways to enter multi-byte characters:
- For X11 XIM can be used.  See |XIM|.
- For MS-Windows IME can be used.  See |IME|.
- For all systems keymaps can be used.  See |mbyte-keymap|.

The options 'iminsert', 'imsearch' and 'imcmdline' can be used to chose
the different input medhods or disable them temporarily.

==============================================================================
2.  Locale						*mbyte-locale*

The easiest setup is when your whole system uses the locale you want to work
in.  But it's also possible to set the locale for one shell you are working
in, or just use a certain locale inside Vim.


WHAT IS A LOCALE?					*locale*

There are many of languages in the world.  And there are different cultures
and environments at least as much as the number of languages.	A linguistic
environment corresponding to an area is called "locale".  This includes
information about the used language, the charset, collating order for sorting,
date format, currency format and so on.  For Vim only the language and charset
really matter.

You can only use a locale if your system has support for it.  Some systems
have only a few locales, especially in the USA.  The language which you want
to use may not be on your system.  In that case you might be able to install
it as an extra package.  Check your system documentation for how to do that.

The location in which the locales are installed varies from system to system.
For example, "/usr/share/locale" or "/usr/lib/locale".  See your system's
setlocale() man page.

Looking in these directories will show you the exact name of each locale.
Mostly upper/lowercase matters, thus "ja_JP.EUC" and "ja_jp.euc" are
different.  Some systems have a locale.alias file, which allows translation
from a short name like "nl" to the full name "nl_NL.ISO_8859-1".

Note that X-windows has its own locale stuff.  And unfortunately uses locale
names different from what is used elsewhere.  This is confusing!  For Vim it
matters what the setlocale() function uses, which is generally NOT the
X-windows stuff.  You might have to do some experiments to find out what
really works.

							*locale-name*
The (simplified) format of |locale| name is:

	language
or	language_territory
or	language_territory.codeset

Territory means the country (or part of it), codeset means the |charset|.  For
example, the locale name "ja_JP.eucJP" means:
	ja	the language is Japanese
	JP	the country is Japan
	eucJP	the codeset is EUC-JP
But it also could be "ja", "ja_JP.EUC", "ja_JP.ujis", etc.  And unfortunately,
the locale name for a specific language, territory and codeset is not unified
and depends on your system.

Examples of locale name:
    charset	    language		  locale name ~
    GB2312	    Chinese (simplified)  zh_CN.EUC, zh_CN.GB2312
    Big5	    Chinese (traditional) zh_TW.BIG5, zh_TW.Big5
    CNS-11643	    Chinese (traditional) zh_TW
    EUC-JP	    Japanese		  ja, ja_JP.EUC, ja_JP.ujis, ja_JP.eucJP
    Shift_JIS	    Japanese		  ja_JP.SJIS, ja_JP.Shift_JIS
    EUC-KR	    Korean		  ko, ko_KR.EUC


USING A LOCALE

To start using a locale for the whole system, see the documentation of your
system.  Mostly you need to set it in a configuration file in "/etc".

To use a locale in a shell, set the $LANG environment value.  When you want to
use Korean and the |locale| name is "ko", do this:

    sh:    export LANG=ko
    csh:   setenv LANG ko

You can put this in your ~/.profile or ~/.cshrc file to always use it.

To use a locale in Vim only, use the |:language| command: >

	:language ko

Put this in your ~/.vimrc file to use it always.

Or specify $LANG when starting Vim:

   sh:    LANG=ko vim {vim-arguments}
   csh:	  env LANG=ko vim {vim-arguments}