Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export count as a variable when running commands #1187

Merged
merged 1 commit into from Apr 1, 2023
Merged

Export count as a variable when running commands #1187

merged 1 commit into from Apr 1, 2023

Conversation

joelim-work
Copy link
Collaborator

Fixes #1180

This change exports the command count as the variable lf_count so that it can be used by shell scripts. For example, with the following config file, typing 123e will result in printing 123.

cmd echocount %echo "$lf_count"
map e echocount

This is similar to the v:count variable in Vimscript:

function! EchoCount()
    echo v:count
endfunction

nnoremap <silent> e :<c-u>call EchoCount()<cr>

" Typing '123e' will result in printing '123'

This feature was requested by a user, please see the discussion in #1180 for more details about their use case.

@gokcehan
Copy link
Owner

gokcehan commented Apr 1, 2023

@joelim-work Oh, I didn't realize you already have a PR for this. As I mention in the discussion, this patch fixes #62 . Thanks for the patch.

@gokcehan gokcehan merged commit 3ae67fc into gokcehan:master Apr 1, 2023
3 checks passed
@joelim-work joelim-work deleted the export-lfcount branch April 1, 2023 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants