IntelliJ IDEA에서 행 번호를 영구적으로 활성화하는 방법

2024-07-27

단계:

  1. 파일 메뉴를 클릭합니다.
  2. 설정을 선택합니다.
  3. 편집기를 선택합니다.
  4. 일반 탭을 선택합니다.
  5. 행 번호 확인란을 선택합니다.
  6. 적용을 클릭합니다.

이제 모든 편집기 창에서 행 번호가 표시됩니다.

참고:

  • 특정 파일이나 프로젝트에 대한 행 번호만 활성화하려면 해당 파일이나 프로젝트의 설정을 따로 변경해야 합니다.
  • 키보드 단축키 Ctrl+Shift+A를 사용하여 설정 창을 빠르게 열 수 있습니다.

추가 팁:

  • 행 번호 표시 방식을 변경하려면 편집기 설정에서 행 번호 섹션의 다른 옵션을 사용할 수 있습니다.



Python:

# Print "Hello, World!" to the console
print("Hello, World!")

# Calculate the sum of two numbers
num1 = 10
num2 = 20
sum = num1 + num2
print(sum)

Java:

public class HelloWorld {
    public static void main(String[] args) {
        // Print "Hello, World!" to the console
        System.out.println("Hello, World!");
    }
}

JavaScript:

// Write "Hello, World!" to the console
console.log("Hello, World!");

// Calculate the sum of two numbers
var num1 = 10;
var num2 = 20;
var sum = num1 + num2;
console.log(sum);



  1. Open the Editor Settings dialog by going to File > Settings and selecting Editor.
  2. In the Editor settings page, navigate to the General tab.
  3. Under the Appearance section, locate the Line Numbers checkbox.
  4. Ensure the Line Numbers checkbox is checked.
  5. Click Apply and then OK to save the changes.

Using the Editor Preferences:

  1. Open the Preferences dialog by going to IntelliJ IDEA > Preferences.
  2. In the Preferences dialog, search for Editor in the search bar.
  3. Select the Editor preferences category.

Using the Keyboard Shortcut:

  1. Press Ctrl+Alt+S (Windows) or Cmd+, (macOS) to open the Settings/Preferences dialog.
  2. In the Search field, type line numbers.
  3. Locate the Editor > General > Appearance > Line Numbers setting.
  4. Ensure the checkbox next to Line Numbers is checked.

Using the Registry (Windows):

  1. Open the Windows Registry Editor by pressing Win+R, typing regedit, and pressing Enter.
  2. Navigate to the following registry key:
HKEY_CURRENT_USER\Software\JetBrains\IntelliJIdea2024.3\settings\editor\general
  1. Create a new DWORD (32-bit) value named lineNumbers.
  2. Double-click the lineNumbers value and set its value to 1.
  3. Close the Registry Editor.
  4. Restart IntelliJ IDEA for the changes to take effect.

Using the Application Properties (macOS):

  1. Open the Terminal application.
  2. Navigate to the directory where IntelliJ IDEA is installed.
  3. Run the following command, replacing <path-to-idea> with the actual path to the IntelliJ IDEA application:
defaults write <path-to-idea>/Contents/InfoEditor.plist EditorGeneral.LineNumbers -bool true
  1. Close the Terminal window.

intellij-idea

intellij idea