Setting up autocompletion

nRF Util

tags
nRF Util

You only need to set this up once.

The following example shows how to set up autocompletion for Powershell. Complete the following steps:

  1. Make sure you have installed the nrfutil completion command with nrfutil install completion.
  2. Run the nrfutil completion install <name_of_shell> command for the shell you are using. For example:
    nrfutil completion install powershell
    
    This produces the following output:
    Add the following to your $PROFILE file:
    
    # From nrfutil completion install
    # WARNING: nrfutil tab-completion may become slow because of Windows Defender
    if ( Test-Path -Path ${env:USERPROFILE}\.nrfutil\share\nrfutil-completion\scripts\powershell\setup.ps1 ) {
        . ${env:USERPROFILE}\.nrfutil\share\nrfutil-completion\scripts\powershell\setup.ps1
    }
    
  3. Manually copy the required lines to your $PROFILE file. You can locate it with the echo $profile. If it does not exist, create the file.
  4. Add menu completion for powershell by adding the following line to the user shell profile:
    Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
    
  5. Save your profile file.
  6. Close and reopen the terminal.