submlie 安裝ctags和codeformatte

下面介紹如何進行安裝

1.首先介紹codeformatte的安裝和使用

  • 使用快捷鍵 “ Ctl+Shift+P ”,再選擇 "Package Control: Install Package"
  • 等待列出可安裝的插件列表,輸入"CodeFormatter"找到它,並點擊即可安裝.
  • 設置CodeFormatter
  • 根據自己的編程環境,可通過”Preferences > package setttings > codeFormatter > settings-user“設置一些參數,如PHP的安裝路徑。
  • {"codeformatter_php_options":
        {
            "syntaxes": "php", // Syntax names which must process PHP formatter
            "php_path": "D:/phpStudy/php/php-7.0.12-nts/php.exe", // Path for PHP executable, e.g. "/usr/lib/php" or "C:/Program Files/PHP/php.exe". If empty, uses command "php" from system environments
            "format_on_save": false, // Format on save
            "php55_compat": false, // PHP 5.5 compatible mode
            "psr1": false, // Activate PSR1 style
            "psr1_naming": false, // Activate PSR1 style - Section 3 and 4.3 - Class and method names case
            "psr2": true, // Activate PSR2 style
            "indent_with_space": 4, // Use spaces instead of tabs for indentation
            "enable_auto_align": true, // Enable auto align of = and =>
            "visibility_order": true, // Fixes visibility order for method in classes - PSR-2 4.2
            "smart_linebreak_after_curly": true, // Convert multistatement blocks into multiline blocks
            // Enable specific transformations. Example: ["ConvertOpenTagWithEcho", "PrettyPrintDocBlocks"]
            // You can list all available transformations from command palette: CodeFormatter: Show PHP Transformations
            "passes": [],
            // Disable specific transformations
            "exclude": []
        },
    }

     

  • 使用CodeFormatter,使用快捷鍵 "ctrl+alt+f" 即可

2.開始安裝ctags,相對有一點麻煩

  • 使用快捷鍵 “ Ctl+Shift+P ”,再選擇 "Package Control: Install Package"
  • 等待列出可安裝的插件列表,輸入"ctags"找到它,並點擊即可安裝.
  • 下載ctags.exe  https://download.csdn.net/download/xyf_1995/10556734
  • ctags.exe 解壓到一個目錄,注意要是純ASCII字符的目錄不要帶空格或中文命名的目錄。
  • 打開菜單在Preferences菜單中打開Package settings->ctags->settings-user和settings-default
  • 把default中的配置全部複製到user中,然後改一下command配置項,爲ctags的可執行文件路徑,這裏的路徑就是ctags.exe存放的路徑
    {"command": "D:/phpStudy/ctags.exe"}

     

  • 配置ctags,Preferences->Package Settings->CTags->Mouse Binding – User

  • [
        {
            "button": "button1",
            "count": 1,
            "press_command": "drag_select",
            "modifiers": ["ctrl"],
            "command": "navigate_to_definition"
        },
        {
            "button": "button2",
            "count": 1,
            "modifiers": ["ctrl"],
            "command": "jump_prev"
        }
    ]

     

  • 項目右鍵選擇使用Tags 

  • 配置成功後ctrl+鼠標左鍵就可以跳轉到該函數,ctrl+鼠標右鍵就可以調回使用函數的位置

3.以上操作都完成後,你就擁有格式化代碼和調轉函數的技能了,你就可以愉快的編輯代碼啦!!!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章