nnoremap <leader>c :Ack '^class ' <c-r>=&path<cr><home><right><right><right><right>< ;right><right><right><right><right><right><right><right>
The general idea is to use Ack to search for pattern.
under the &path path.The n*<right>
in this mapping is so ugly. How can it be optimized?
After help from the community, I put the final method below:
" help input
function! AckClass()
let l:classPattern = input('Pattern: ')
execute " Ack '^class " . l:classPattern . "' " . &path
endfunction
command! AckClass call AckClass()
I don’t know how far you want to interact
This is my vimrc function that changes the encoding and opens the file. It will display a list of options for your reference