Công cụ thành viên

Công cụ trang web


programming:nvtools:eclipse

Đây là một phiên bản cũ của tài liệu!


Cấu hình Eclipse để phát triển NukeViet

1. Tải về và cài đặt

2. Thêm định dạng file cần thiết

Cấu hình định dạng file:

Một số mã nguồn sử dụng các định dạng file mà trình soạn thảo chưa được ghi nhận, ví dụ: giao diện CMS NukeViet sử dụng *.tpl thay vì *.html. Vậy nên, chúng ta cần phải thêm định dạng *.tpl hiển thị như *.html.

Trong cửa sổ Freferences, đi đến General / Editors / File Associations

  Click Add (1), nhập vào định dạng file muốn thêm vào (*.tpl). Nhấn OK để hoàn tất
  Click Add (2), chọn định dạng muốn áp dụng cho định dạng (*.tpl) vừa thêm ở trên. VD chọn HTML Editor

Kết quả: Khi mở một file có định dạng *.tpl, thì code hiển thị như *.html

Làm tương tự với file có định dạng *.ini được mở bằng XML Editor

3. Thay đổi font chữ, kích thước chữ

Font, kích thước chữ ở đây là code khi bạn soạn thảo, không phải chữ của các menu hệ thống. Đi đến General / Appearance / Color and Fonts. Chọn đối tượng định dạng (1), chọn Edit (2) để thay đổi font và kích thuớc chữ, nhấn OK (3) để áp dụng. Bạn có thể chọn các đối tượng hiển thị khác nhau ở phần (1), sau đó thay đổi tuơng tự.

4. Thay đổi mẫu định dạng code

Bạn có thể thay đổi mẫu định dạng mã PHP theo ý bạn, truy cập PHP / Code style / Formater. Chọn mẫu hoặc import mẫu bạn mong muốn eclipse_neon_3_nukeviet4_php.zip Nhấn OK để hoàn tất.

Áp dụng bằng cách nhấn Ctrl + F để định dạng tự động cho nội dung tập tin đang mở. Hoặc định dạng cho toàn bộ tập tin (PHP) trong một thư mục bằng cách Click phải chuột lên thư mục (ở cửa sổ PHP Explorer),, chọn Source, chọn Format

5. Cấu hình Format cho Javascript

Cấu hình tương tự như PHP bằng cách truy cập: Javascript/ Code style / Formater eclipse_neon_3_nukeviet4_js.zip

6. Cấu hình xóa khoảng trống khi lưu file

Với PHP

Với JavaScript: Truy cập “Toolbar –> Window –> Preferences –> JavaScript –> Editor –> Save Actions”.

  1. Find and enable “Perform the selected actions on save”.
  2. Find and enable “Additional actions”.
  3. Press the button “Configure…”.
  4. Select the tab “Code Organizing”.
  5. Find and enable “Remove trailing whitespace”.
  6. Find and select “All lines”.
  7. Press “OK” to continue.

Khi bạn đã xong, bấm “OK” để lưu và đóng cửa sổ Preferences.

7. Cấu hình cho CSS

8. Cấu hình cho html

9. add FTP support to Eclipse

Chức năng này mặc định chưa có trong Eclipse trên windows, bạn cần cài đặt nó theo các bước sau:

  1. Go to 'Help' → 'Install New Software' (in older Eclipses, this is called something a bit different)
  2. In the 'Work with:' drop-down, select your version's plugin release site. Example: for oxygenr, this is: Oxygen - http://download.eclipse.org/releases/oxygen
  3. In the filter field, type 'remote'.
  4. Check the box next to 'Remote System Explorer End-User Runtime'
  5. Click 'Next', and accept the terms. It should now download and install.
  6. After install, Eclipse may want to restart.

Using it, in Eclipse:

  1. Window → Open Perspective → (perhaps select 'Other') → Remote System Explorer
  2. File → New → Other → Remote System Explorer (folder) → Connection (or type Connection into the filter field)
  3. Choose FTP from the 'Select Remote System Type' panel.
  4. Fill in your FTP host info in the next panel (username and password come later).
  5. In the Remote Systems panel, right-click the hostname and click 'connect'.
  6. Enter username + password and you're good!
  7. Well, not exactly 'good'. The RSE system is fairly unusual, but you're connected.
  8. And you're one smart cookie! You'll figure out the rest.

Tham khảo: https://mynukeviet.net/chu-de/su-dung-cong-cu-eclipse-trong-lap-trinh-php/

programming/nvtools/eclipse.1499131876.txt.gz · Sửa đổi lần cuối: 2017/07/04 08:31 bởi vuthao