cohama / lexima.vim

Auto close parentheses and repeat by dot dot dot...
995 stars 46 forks source link

[question] how do i represent end of line in lexima rules? #118

Closed alexzanderr closed 2 years ago

alexzanderr commented 2 years ago

i want to tell lexima to add double quotes when the cursor if right before end of line, because normally:

before inserting double quotes:

text text text |\n

after inserting double quotes:

text text text "|\n

ony this happens...

expectation (after inserting double quotes):

text text text "|"\n

this is my rule

call lexima#add_rule({'char': '"', 'at': '\%# (here how do i represent new line)', 'input_after': '"'})

thanks in advance.

cohama commented 2 years ago

Please use $ which represents the end-of-line.

call lexima#add_rule({'char': '"', 'at': '\%#$', 'input_after': '"'})

By the way, are you going to edit vim script? " will be expanded always except vim script because " is treated as a comment.

alexzanderr commented 2 years ago

thanks for idea. yes, my bad, i forgot to mention that i was writing in vim script, but i realized later.

On Fri, Jul 30, 2021, 06:19 cohama @.***> wrote:

Please use $ which represents the end-of-line.

call lexima#add_rule({'char': '"', 'at': '\%#$', 'input_after': '"'})

By the way, are you going to edit vim script? " will be expanded always except vim script because " is treated as a comment.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cohama/lexima.vim/issues/118#issuecomment-889598838, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANB4F4AN5AQJ4F2YEN4LULDT2IK53ANCNFSM5BGG2WAA .