日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程语言 > python >内容正文

python

sublime配置python环境变量_Sublime Python环境配置

發(fā)布時(shí)間:2023/12/10 python 17 豆豆
生活随笔 收集整理的這篇文章主要介紹了 sublime配置python环境变量_Sublime Python环境配置 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

文章主要說明了能讓Python的編程者使用更方便的一些設(shè)置和調(diào)整。

Sublime Text簡介

Sublime Text是一個(gè)很棒的編輯器,支持跨平臺(tái),有著強(qiáng)大的插件子系統(tǒng)。對(duì)于Python開發(fā),有不少插件可以讓你開發(fā)起來更流暢、更有樂趣。

我現(xiàn)在仍然在不同的項(xiàng)目之間切換編輯器。不過我發(fā)現(xiàn)對(duì)應(yīng)Python開發(fā),Sublime在輕量級(jí)的編輯器和全功能的IDE之間有著很好的平衡。

安裝插件

正如之前提到的, Sublime 有一個(gè)非常豐富的插件系統(tǒng)。而我當(dāng)前使用的插件如下:

Package Control?在 Sublime 里直接安裝附加插件的包管理器。

ChineseLocalizations?Sublime系統(tǒng)語言插件,改為中文菜單

ConvertToUTF8 處理中文亂碼問題

SublimeCodeIntel?為部分語言增強(qiáng)自動(dòng)完成功能,包括了 Python 。這個(gè)插件同時(shí)也可以讓你跳轉(zhuǎn)到符號(hào)定義的地方,通過按住 alt 并點(diǎn)擊符號(hào)。非常方便。

SideBarEnhancements?這個(gè)插件提供了側(cè)邊欄附加的上下文菜單選項(xiàng),例如"New file","New Floder"等。這些本應(yīng)當(dāng)默認(rèn)就該有的,卻沒有。

SideBarHider

SublimeREPL?允許你在編輯界面直接運(yùn)行 Python 解釋器。我傾向于在單獨(dú)的終端窗口用?bpython?來運(yùn)行,但有時(shí) SublimeREPL 是很有幫助的。

SublimeTmpl Sublime模板

ctags跨文件跳轉(zhuǎn),跳轉(zhuǎn)到指定函數(shù)聲明的地方(ctrl+alt+左鍵)。

window 下載 ctags.exe(prdownloads.sourceforge.net/ctags/ctags58.zip,ctags.exe文件放在一個(gè)環(huán)境變量能訪問到的地方),然后在打開的工程目錄上運(yùn)行ctags?-R?-f?.tags生成

ubuntu下安裝運(yùn)行命令:sudo apt-get install exuberant-ctags

在CTags.sublime-setting--User中添加路徑:{"command": "C:\\Windows\\System32\\ctags.exe",}

BracketHighlighter該插件提供配對(duì)標(biāo)簽,或大括號(hào)或字符引號(hào)的配對(duì)高亮顯示,算是對(duì)系統(tǒng)高亮的加強(qiáng)吧

Tomorrow Color Schemes?Color schemes?決定了編輯器界面語法高亮的字體顏色。這是一個(gè)非常酷的暗黑系樣式。

Theme - Soda SolarizedDark?Themes?影響 Sublime 界面元素的顏色和風(fēng)格。這個(gè)非常適合 Tomorrow Night 的配色方案。

All Autocomplete?Sublime 默認(rèn)的自動(dòng)完成只關(guān)注當(dāng)前文件的單詞。這個(gè)插件擴(kuò)展了其自動(dòng)完成的單詞列表到所有打開的文件。

TortoiseSVN生成后右鍵點(diǎn)擊文件或文件夾(這個(gè)要錢,如果是windows的話用TorstoiseSVN,這個(gè)要先預(yù)裝TorstoiseSVN)

OmniMarkupPreviewer?支持將標(biāo)記語言(Markdown僅是其中一種)渲染為 HTML 并在瀏覽器上實(shí)時(shí)預(yù)覽,同時(shí)支持導(dǎo)出 HTML 源碼文件

使用Anaconda進(jìn)行代碼自動(dòng)校驗(yàn)、修正(按PEP8)

配置文件

Sublime Text 的一個(gè)優(yōu)點(diǎn)就是它的所有配置都是簡單的基于 JSON 的配置文件。這使得你可以很容易的將配置轉(zhuǎn)到另一個(gè)系統(tǒng)中。我也見過一些人使用 Dropbox 自動(dòng)同步他們所有電腦上的配置。

Preferences.sublime-settings?配置了 Sublimede 的顯示和行為.你可以在sublime 中通過?Preferences > Settings — User?打開并編輯此文件。我使用如下配置:

{

// Colors

"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",

"theme": "Soda SolarizedDark.sublime-theme",

// Cursor style - no blinking and slightly wider than default

"caret_style": "solid",

"wide_caret": true,

// Font

"font_face": "Ubuntu Mono",

"font_size": 16.0,

"font_options":

[

"subpixel_antialias",

"no_bold"

],

"line_padding_bottom": 0,

"line_padding_top": 0,

// 折疊,展開選項(xiàng)

"fold_buttons": true,

"fade_fold_buttons": false,

"highlight_line": true,

"auto_complete": true,

"show_minimap": true,

// Word wrapping - follow PEP 8 recommendations

"rulers": [ 72, 79 ],

"word_wrap": false,

"wrap_width": 80,

// Editor view look-and-feel

"draw_white_space": "all",

// Editor behavior

"scroll_past_end": false,

"highlight_modified_tabs": true,

"find_selected_text": true,

// Whitespace - no tabs, trimming, end files with \n

"tab_size": 4,

"translate_tabs_to_spaces": true,

"trim_trailing_white_space_on_save": true,

"ensure_newline_at_eof_on_save": true,

// 不顯示的包、文件夾、文件

"ignored_packages":

[

"Vintage", "Markdown"

],

"folder_exclude_patterns":

[

".git",

"__pycache__",

"env",

"env3",

".svn"

],

"file_exclude_patterns":

[

".DS_Store",

"*.pid",

"*.pyc",

".tags",

".tags_sorted_by_file",

"*.exe",

".svn-base"

],

}

Anaconda.sublime-settings配置如下:

{

// python運(yùn)行地址

"python_interpreter": "C:/Python27/python.exe",

// AutoComplete設(shè)置

"suppress_word_completions":true,

"suppress_explicit_completions":true,

"complete_parameters":true,

// AutoFormatting

"auto_formatting": true,

"auto_formatting_timeout": 2,

"autoformat_ignore":

[

"E309",

"E501",

],

// 是否啟用linter

"anaconda_linting": false,

"anaconda_linting_behaviour": "load-save",

// 頁面報(bào)錯(cuò)

"anaconda_gutter_theme": "simple",

"anaconda_linter_mark_style": "outline",

"anaconda_gutter_marks": true,

"anaconda_linter_underlines": true,

"anaconda_linter_phantoms": true,

"use_pylint": false,

"pylint_ignore":

[

"C0111",

],

"pep8": true,

"pep8_ignore":

[

"E309",

"E501",

"C0111"

],

}

按鍵綁定

Sublime 的按鍵綁定也是全部可配置的基于JSON的 sublime-keymap 配置文件。我修改了一些默認(rèn)配置以更好的配合我的 TextMate / IntelliJ 肌肉記憶。你可以完全不修改。如果你想,修改很簡單,并可以跨平臺(tái)使用。我使用如下的綁定:

[

// Rebind "go to file" to cmd+shift+O

{ "keys": ["super+shift+o"], "command": "show_overlay", "args": {

"overlay": "goto",

"show_files": true

}},

// Rebind swap line up/down to cmd+shift+up/down

{ "keys": ["super+shift+up"], "command": "swap_line_up" },

{ "keys": ["super+shift+down"], "command": "swap_line_down" },

// Delete a line with cmd+delete

{ "keys": ["super+backspace"], "command": "run_macro_file", "args": {

"file": "Packages/Default/Delete Line.sublime-macro"

}},

// Reindent selection with cmd+alt+L

{ "keys": ["super+alt+l"], "command": "reindent"}

]

命令行工具

同 TextMate 的 mate 類似,Sublime Text 包含了一個(gè)命令行工具,允許你通過 shell 打開編輯器。工具名為 sublis,默認(rèn)不可用。要使之生效,在任一 shell 中運(yùn)行下面:

ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl

更多靈感

我希望這篇安裝指南能夠幫到你。如果你有任何建議或意見,敬請(qǐng) Twitter 我一行或給我發(fā)郵件。另外,感謝下面的作者及其關(guān)于配置 sublime 的作品。它們啟發(fā)了我很多:

總結(jié)

以上是生活随笔為你收集整理的sublime配置python环境变量_Sublime Python环境配置的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。