Skip to main content

Editor Config

Editor Config





ကျွန်တော်တို့ Developer တွေတော်တော်များများက၊ ကိုယ်နဲ့ကျွမ်းကျင်ရာ ဒါမှမဟုတ် နှစ်သက်ရာ IDE/Text Editor တွေကို သုံးလေ့ရှိကြပါတယ်။ အဲ့နေရာမှာ ပြသနာတစ်ခုက IDE/Text Editor မတူတာနဲ့ Coding Style, Format တွေမှာ မတူတာ တွေဖြစ်တတ်ကြပါတယ်။ ဥပမာ - Eclipse သုံးတဲ့သူ အချင်းချင်းဆို setting ကို export လုပ်ပြီး အတူတူထားလို့ရပေမယ့်၊​ IntelliJ IDEA သုံးတဲ့သူတွေနဲ့ ဆို အဆင်မပြေဖြစ်ပြန်ရော။ Visual Studio Code, Atom, Sublime Text တွေကအများကြီးကို ကြားထဲ Indentation တွေ၊ Code Style တွေကို Standardize လုပ်ဖို့ ခက်ခဲလာတယ်။ အဲ့ဒါကြောင့် တစ်ချို့  Company/Project တွေဆိုရင် ဘယ် IDE/ Text Editor ပဲသုံးရမယ်ဆိုပြီးသတ်မှတ်ထားလေ့ရှိကြတယ်။ အကျိုးဆက်အနေနဲ့ကတော့ Productivity နဲ့ Developers တွေက သတ်မှတ်ထားတဲ့ tools တွေနဲ့ အကျွမ်းဝင်ဖို့ အချိန်ပေးရပါတယ်။

အဲ့ဒါ တွေကို Editor Config ကအလွယ်တကူဖြေရှင်းပေးနိုင်ပါတယ်။ Editor Config ရဲ့ အားသာချက်ကတော့ အတော်များများ IDE/ Text Editor တွေမှာ built-in ပါပြီးသားဖြစ်ပြီး၊ built-in မပါရင်လဲ Plugin တွေက အတော်များများအတွက်ရှိပါတယ်။ 


# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# Matches multiple files with brace expansion notation
# Set default charset
[*.{js,py}]
charset = utf-8

# 4 space indentation
[*.py]
indent_style = space
indent_size = 4

# Tab indentation (no size specified)
[Makefile]
indent_style = tab

# Indentation override for all JS under lib directory
[lib/**.js]
indent_style = space
indent_size = 2

# Matches the exact files either package.json or .travis.yml
[{package.json,.travis.yml}]
indent_style = space
indent_size = 2

ဒါကတော့ ဥပမာ တစ်ခုပါ။ config တွေကို လဲ​စိတ်ကြိုက်သတ်မှတ်ထားနိုင်တော့ အတော်လေးအဆင်ပြေပါတယ်။ Editor Config ကို သုံးမယ်ရင်တော့  ပေါ်က configuration တွေနဲ့ .editorconfig ဆိုတဲ့ file လေထဲထည့်မယ်။​ .editorconfig file ကို apply လုပ်ချင်တဲ့ root directory အောက်ကိုထည့်လိုက်ရုံပါပဲ။ Plugin ထည့်ဖို့လိုတဲ့ IDE/ Text Editor ဆိုရင်တော့ ထည့်ရပါမယ်။အသေးစိတ်လေ့လာချင်တယ်ဆိုရင်တော့ Editor Config ရဲ့ official website မှာ သွားရောက်လေ့လာနိုင်ပါတယ်။



Comments

Popular posts from this blog

Pigeon Myanmar's free Wireguard VPN

Pigeon Myanmar's free Wireguard VPN  Pigeon Myanmar ရဲ့ Free VPN service ကိုအသုံးပြုရန်အတွက် အောက်ပါ Telegram Chatbot ကို message ပို့ပြီး Config file ဒါမှမဟုတ် QR Code ကိုရယူနိုင်ပါတယ်။ အသုံးမပြုလိုသူများ၊ newvpn request မလုပ်ဖို့မတ္တာရပ်ခံအပ်ပါတယ်၊ client က limit ရှိတာကြောင့် လိုအပ်တဲ့သူတွေမရမှာစိုးလို့ပါ။ Telegram Chat Bot Telegram Chat Bot:  https://t.me/pigeonmyanmarbot Chat Bot မှာ /start ကိုလို့ပို့ပြီး သက်ဆိုင်ရာ Operation ကိုရေးပြီး VPN အသုံးပြုရန်အတွက် QR Code ဒါမှမဟုတ် Config file ရယူနိုင်ပါတယ်။ Telegram Account တစ်ခုကို client တစ်ခုသတ်မှတ်ထားဒါကြောင့် နောက်အကြိမ်တွေ ထပ်မှတ်ရယူပါကလည်း client အဟောင်းကိုသာ ရရှိတော့မှဖြစ်ပါတယ်။ QR Code/Config File ကို ပျောက်ပျက်သွားတဲ့အခါမှာလည်း ထပ်မံတောင်းခံ ကြည့်ရှူနိုင်ပါတယ်။   /newvpnqr - VPN QR Code ရယူရန်။ /newvpn - VPN Config File ရယူရန်။ VPN Installation and Setup သက်ဆိုင်ရာ Application ကိုအောက်ပါ link များမှ install လုပ်ပါ။  Application မှာ  + / Add a tunnel ခလုတ်နှိပ်ပါ။  Create from file or archive ဒါမှမဟုတ် Create from QR

How to use GIT? GIT ကိုဘယ်လို အသုံးပြုကြမလဲ (Cheat sheet)...

How to use GIT?  Git အသုံးပြုပုံကို နားလည်ကျွမ်းကျင်ဖို့ GIT ဘယ်လိုအလုပ်လုပ်လဲ ဆိုတာ နည်းနည်းတော့ သိထားဖို့လိုလိမ့်မယ်။  File ရဲ့ statuses တွေနဲ့ file transitions တွေကို သေချာ နားလည်ထားဖို့လိုတယ်။ File status မှာဆိုရင် file တစ်ခုကို git ကဘယ်အချိန်မှာ track စလုပ်လဲ၊ ဘယ်အချိန်မှာ modified, unmodified, staged statuses တွေဖြစ်သွားလဲဆိုတာတွေ နဲ့ File transitions မှာဆိုရင် file တစ်ခုက ဘယ် command run ရင် local repository မှာရှိတယ်။ ဘယ် command run ရင်တော့ remote repository (server) ကိုရောက်သွားလဲ ဆိုတာတွေကို အနည်းငယ်နားလည်ထားဖို့တော့လိုမယ်။ Git File Statuses Git မှာ file တွေကို track လုပ်နေတဲ့ statuses တွေရှိတယ်။ အဲ့ဒါတွေကတော့ အောက်ပါအတိုင်းဖြစ်တယ်။ Untracked Unmodified Modified Staged Untracked Status Untracked ဆိုတာက file တစ်ခုက ပထမဆုံး create လုပ်ပြီးတဲအချိန်မှာ git က အဲ့ file ကိုလုံးဝ track မလုပ်ရသေးတဲ့ file တွေက git မှာ untracked အနေနဲ့ရှိနေတယ်။ အဲ့ဒါကို git ကို စပြီး track လုပ်စေချင်တယ်ဆိုင်တော့ git add <file> command နဲ့ git ကို စ track လုပ်ခိုင်းလို့ရတယ်။ အဲ့လို git add လုပ်လို