Ich kann CtrlP verwenden. Ich tippe ctrl + p, dann fange ich an, den Dateinamen zu schreiben, und so weiter. Aber, ich bin ein sehr fauler Entwickler. Ich möchte direkt an CtrlP das aktuelle Wort senden. Ich weiß, wie das aktuelle Wort zu bekommen:Vim Sprache: aktuelles Wort an CtrlP senden
let l:currentWord = expand('<cword>')
In Vim Sprache, ... ich Wie kann ich l senden: currentWord zu CtrlP?
map <F6> :call ComposerKnowWhereCurrentFileIs()<CR>
function! ComposerKnowWhereCurrentFileIs()
let l:currentWord = expand('<cword>')
let l:command = "grep " . l:currentWord . " ../path/to/composer -R | awk '{print $6}' | awk -F\\' '{print $2}'"
let l:commandFileFound = l:command . ' | wc -l'
let l:numberOfResults = system(l:commandFileFound)
if l:numberOfResults == 1
let l:fileName = system(l:command)
let l:openFileCommand = 'tabe /path/to/project' . l:fileName
exec l:openFileCommand
else
echo "Too many files :-(- use CtrlP ;-) "
endif
endfunction
Karte w –
lollo
Kann ich in einer Funktion zuordnen? – sensorario
Warum möchten Sie dies innerhalb der Funktion tun? – lollo