Skip to content

Commit

Permalink
Start each line in insert mode
Browse files Browse the repository at this point in the history
Now starts each line in insert mode instead of switching to insert mode
when starting Athame. This allows for better behavior for
ATHAME_VIM_PERSIST mode. The user can change this by editing the
athamerc.
  • Loading branch information
ardagnir committed Feb 12, 2017
1 parent 3ab173a commit a308798
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion athame.c
Expand Up @@ -111,7 +111,7 @@ void athame_init(int instream, FILE* outstream)
if (is_vim_alive()) {
athame_remote_expr("Vimbed_Reset()", 1);
int cursor = ap_get_cursor();
snprintf(athame_buffer, DEFAULT_BUFFER_SIZE-1, "Vimbed_UpdateText(%d, %d, %d, %d, 1)", athame_row+1, cursor+1, athame_row+1, cursor+1);
snprintf(athame_buffer, DEFAULT_BUFFER_SIZE-1, "Vimbed_UpdateText(%d, %d, %d, %d, 1, 'StartLine')", athame_row+1, cursor+1, athame_row+1, cursor+1);
athame_remote_expr(athame_buffer, 1);
athame_poll_vim(1);
} else {
Expand Down
4 changes: 2 additions & 2 deletions athame_util.h
Expand Up @@ -118,7 +118,7 @@ static int start_vim(int char_break, int instream)
if (pid == 0)
{
int cursor = ap_get_cursor();
snprintf(athame_buffer, DEFAULT_BUFFER_SIZE-1, "+call Vimbed_UpdateText(%d, %d, %d, %d, 1)", athame_row+1, cursor+1, athame_row+1, cursor+1);
snprintf(athame_buffer, DEFAULT_BUFFER_SIZE-1, "+call Vimbed_UpdateText(%d, %d, %d, %d, 1, 'StartLine')", athame_row+1, cursor+1, athame_row+1, cursor+1);
int vim_error = 0;
if (ATHAME_VIM_BIN[0]) {
if (testrc) {
Expand Down Expand Up @@ -458,7 +458,7 @@ static void athame_update_vimline(int row, int col)

fclose(updateFile);

snprintf(athame_buffer, DEFAULT_BUFFER_SIZE-1, "Vimbed_UpdateText(%d, %d, %d, %d, 0)", row+1, col+1, row+1, col+1);
snprintf(athame_buffer, DEFAULT_BUFFER_SIZE-1, "Vimbed_UpdateText(%d, %d, %d, %d, 0, '')", row+1, col+1, row+1, col+1);

athame_remote_expr(athame_buffer, 1);
updated = 1;
Expand Down
3 changes: 2 additions & 1 deletion athamerc
Expand Up @@ -15,7 +15,8 @@ set backspace+=start "Without this, you can't delete shell completions

set textwidth=0 "Don't try to wrap text

startinsert "Start in insert mode. Most shell vi-modes do this.
"Start each line in insert mode. Most shell vi-modes do this:
autocmd User Vimbed_StartLine call feedkeys("\<C-\>\<C-N>i","n")

" These make arrows more shell like. Feel free to comment them out:
if v:version>=800 || has("patch928")
Expand Down
2 changes: 1 addition & 1 deletion vimbed
Submodule vimbed updated 1 files
+7 −1 plugin/vimbed.vim

0 comments on commit a308798

Please sign in to comment.