Ticket #4187: capitalize.plugin.sl
File capitalize.plugin.sl, 511 bytes (added by psprint, 3 years ago) |
---|
Line | |
---|---|
1 | % Copy to ~/.config/mc/plugin for this file to be loaded at mc's startup. |
2 | |
3 | define capitalize() { |
4 | variable word; |
5 | % Get the word left of cursor. |
6 | word = mc->cure_get_left_whole_word(0); |
7 | % Move to the beginning of it. |
8 | mc->cure_cursor_move(-strlen(word)); |
9 | % Replace the char with capitalized version of it. |
10 | mc->cure_delete(); |
11 | mc->cure_insert_ahead(toupper(word[0])); |
12 | } |
13 | |
14 | % Map the function capitalize() to the Alt-c key. |
15 | mc->editor_map_key_to_func("Capitalize","alt-c","capitalize"); |
16 |