sublime3 設置python

sublime3 中文設置

  • 按住  ctrl + `
  • 在彈出的對話空輸入代碼
    import urllib.request,os,hashlib; h = '6f4c264a24d933ce70df5dedcf1dcaee' + 'ebe013ee18cced0ef93d5f746d80ef60'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)
  • 按回車執行代碼
  • 在列表對話框搜索插件 chineseLocalizations 進行安裝css

sublime3 禁止更新提示

  • Preferences(首選項)--- Settings(設置)中user配置中添加"update_check": falsehtml

  • 最後一個配置不須要加逗號","

sublime3 變成python的IDE

  • 打開Windows系統的命令提示符工具(cmd),輸入一下命令
    pip install flake8
    pip install --upgrade flake8
  • 從新打開sublime3
  • 安裝SublimeLinter插件
  • 安裝SublimeLinter-flake8插件(語法檢查)
  • 從新打開sublime3
  • 配置SublimeLinter
    • 把左邊的配置文件所有拷貝到右邊(把默認配置文件拷貝大用戶配置文件)
    • 把兩個(145行、154行) "mark_style": "outline" 改爲 "mark_style": "squiggly_underline"
    • 把(50行) "lint_mode": "background" 改爲 "lint_mode": "load_save"
  • 安裝Anaconda插件(代碼補全)
  • 從新打開sublime3
    •  編輯Anaconda的user配置文件
    • 添加如下內容
      {
          "anaconda_linting": false,
          "pep8": false
      }
  • 從新打開sublime3
  • 設置sublime3字體及風格
    • 在user配置改爲如下代碼
      {
      	"ignored_packages":
      	[
      		"Vintage"
      	],
      	"update_check": false,
      	"font_face": "Consolas",
      	"font_size":16,
      	"font_options": [ 
      	"directwrite",
      	"subpixel_antialias"
      	],
      	"font_options": [ 
      	"directwrite",
      	"subpixel_antialias", 
      	"no_bold", "no_italic"
      	],
      	"caret_style": "solid", 
      	"wide_caret": true, 
      	"highlight_line": true,
      	"draw_white_space": "all", 
      	"indent_guide_options": [
      	"draw_active"
      	],
      	"line_padding_bottom": 1, 
      	"line_padding_top": 2,
      	"fold_buttons": false,
      	"scroll_past_end": true,
      	"shift_tab_unindent": true
      }
  • 安裝Tomorrow Color Schemes插件(配色方案)
    • 配色方案中能夠選擇喜歡的配色方案了
    • 選擇Tomorrow-Night主題
  • 安裝Theme-SoDaReloaded插件(主題及文件類型UI)
    • 配置下user文件
    • 在user配置文件裏添加代碼
      "theme": "SoDaReloaded Dark.sublime-theme"
  •  配置PEP8規範
    • 添加如下代碼,註釋的是每行滿80個字符就自動換行
      {
      	"tab_size": 4, //TAB鍵爲4個空格
      	"translate_tabs_to_spaces": true,
      	"trim_trailing_white_space_on_save": true, 
      	"ensure_newline_at_eof_on_save": true
      	//"rulers": [ 
      	//72,
      	//79
      	//],
      	//"word_wrap": true,
      	//"wrap_width": 80
      }
  • 安裝sidebarenhancements(右鍵加強) python

    • 設置user配置文件
    • 添加如下代碼
      "file_exclude_patterns":[
      		"*.pyc",
      		"*.pyo",
      		"*.exe",
      		"*.dll",
      		"*.obj",
      		"*.o",
      		"*.a",
      		"*.lib",
      		"*.so",
      		"*.dylib",
      		"*.ncb",
      		"*.sdf",
      		"*.suo",
      		"*.pdb",
      		"*.idb",
      		".DS_Store",
      		"*.class",
      		"*.psd",
      		"*.db",
      		"*.sublime-workspace"
      	],
      	"folder_exclude_patterns": [
      		".svn", 
      		".git",
      		".hg", 
      		"CVS", 
      		"__pycache__"
      	]
  • 安裝Zen Tabs插件
    • 配置插件user文件
    • 添加如下代碼
      {
          "open_tab_limit":  5,
          "highlight_modified_tabs": true,
          "show_full_path": false
      }
  • 安裝 SublimeTmpl 插件
    •  配置文件1
    • 添加如下代碼
      {
      	"disable_keymap_actions": false, // "all"; "html,css"
      	"date_format" : "%Y/%m/%d %H:%M",
      	"attr": {
      	    "author": "LongRm",
      	}
      }
    • 配置文件2git

    • 添加如下代碼(Ctrl+Alt+P能夠新建python模板文件)dom

      [
          {
              "caption": "Tmpl: Create python", "command": "sublime_tmpl",
              "keys": ["ctrl+alt+p"], "args": {"type": "python"}
          },
      ]
    • 修改模板源文件 D:\Sublime3\Data\Packages\SublimeTmpl\templates;修改後代碼以下ide

      #!/usr/bin/env python
      # -*- coding: utf-8 -*-
      # @Date    : ${date}
      # @Author  : ${author}
  • 安裝SublimeREPL插件。(python交互界面,原配的ctrl+b只能顯示結果,沒法交互(回車無效))
    • 添加如下代碼(按F5彈出交互窗口)
      {"keys":["f5"], "caption": "SublimeREPL: Python - RUN current file", "command": "run_existing_window_command", "args": {"id": "repl_python_run","file": "config/Python/Main.sublime-menu"} }

 

  • 安裝IMESupport插件。輸入法跟隨光標

 

sublime3中Git的使用

  • 安裝Git(下載地址 https://git-scm.com/download/win
  • git環境進行基本的配置svn

  • 打開 git Bash
  •  

    git config --global user.email "yourname@yourdomain.com"   # git的郵箱
    git config --global user.name "Firstname Lastname"              # git用戶
    
    git config --global --list   # 命令能夠查看上面的配置

     

  • git部分命令工具

    git init    # 初始化當前目錄爲git本地倉庫
    git init [project-name]    # 初始化git本地倉庫,[project-name]爲倉庫地址
    git clone [url]    # 拉項目到本地倉庫,[url]爲遠程倉庫地址
    
    # 提交文件(在項目目錄下提交全部文件)
    git add .
    git commit -m "描述"
    git remote add origin [url]    # 使用https地址;有提示輸入帳號密碼
    git push -u origin master      # 提交完畢
    #######提示出錯信息:fatal: remote origin already exists.####### #### 第一次先不理,不必定不成功 #### git remote rm origin ################################################################
  •  安裝GitGutter插件(文件新增內容標註)(安裝了沒反應.....)字體

  •  

    安裝 Git插件(ctrl+shift+p 輸入部分git命令)ui

  • 安裝 Git Commit Message Syntax 插件

相關文章
相關標籤/搜索