Microsoft MVP성태의 닷넷 이야기
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 
(연관된 글이 2개 있습니다.)

Visual Studio 편집기의 \r\n (crlf) 개행을 \n으로 폴더 별 설정하는 방법

리눅스 관련 작업을 윈도우에서 하다 보면 가장 불편한 점이 바로 \r\n 개행을 \n으로 바꿔야 한다는 것입니다. 가령, bash 쉘 스크립트(.sh)을 \r\n으로 저장하면 리눅스에서 실행 시 다음과 같은 오류가 발생합니다.

$ /share/dual.sh
-bash: ./dual.sh: /bin/bash^M: bad interpreter: No such file or directory

물론, Visual Studio의 경우 "File" / "Save As..." 명령어를 이용해 "Save with Encoding..." 옵션으로 "Line endings"를 "Unix (LF)"로 바꿔 저장하면 되지만 이게 개별 파일마다 그래야 하는 것이 여간 불편한 작업이 아닐 수 없습니다. (참고로, JetBrains의 IDE(예를 들어 PyCharm 등)에서는 단순히 해당 파일을 다시 저장하면 자동으로 Unix (LF) 방식으로 개행을 처리해 줍니다.)

그런데 마침 어제 블로그에 다음과 같은 글을 쓰신 분이 있습니다. ^^

Visual Studio - editorconfig 사용하기
; https://jacking75.github.io/VS_editorconfig/

위의 글을 보면, 폴더 단위로 에디터의 편집 설정을 .editorconfig 파일로 할 수 있는 방법을 소개하고 있습니다. 아하... 그렇다면 리눅스 관련 쉘 스크립트가 있는 폴더에는 다음과 같은 내용의 .editorconfig을 마련해 주면 됩니다.

[*]
indent_style = space
insert_final_newline = true
end_of_line = lf

editorconfig에 관한 자세한 사항은 다음의 글을 참고하시고,

What is EditorConfig?
; http://editorconfig.org/

팁으로 탐색기에서 "."으로 시작하는 파일을 만들고 싶다면 다음의 방법을 사용하면 됩니다.

점(.)으로 시작하는 파일명을 탐색기에서 만드는 방법
; https://www.sysnet.pe.kr/2/0/1731

이대로 끝내기 아쉬우니, Visual Studio 코드 편집 창의 주석으로 이미지를 삽입할 수 있는 확장을 소개합니다. ^^

Memeful comments extension for Visual Studio
; http://mariusbancila.ro/blog/2017/11/23/memeful-comments-extension-for-visual-studio/

소스 코드에 다음과 같이 (img가 아닌) image 태그를 연결하면,

/// <image url="http://res.sysnet.pe.kr/sysnetimages/rd_1usb_2hid_1.png" />

다음과 같이 이미지를 보여줍니다. ^^

memeful_ext_1.png




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]

[연관 글]






[최초 등록일: ]
[최종 수정일: 8/4/2021]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




... 61  62  63  64  65  66  67  68  69  [70]  71  72  73  74  75  ...
NoWriterDateCnt.TitleFile(s)
11892정성태5/10/201912534웹: 38. HTTP Cookie의 expires 시간 형식(RFC7231)
11891정성태5/9/201915008.NET Framework: 831. (번역글) .NET Internals Cookbook Part 12 - Memory structure, attributes, handles
11890정성태5/8/201910775개발 환경 구성: 439. "Visual Studio Enterprise is required to execute the test." 메시지와 관련된 코드 기록
11889정성태5/8/201911623개발 환경 구성: 438. mstest, QTAgent의 로그 파일 설정 방법
11888정성태5/8/201926801.NET Framework: 830. C# - 비동기 호출을 취소하는 CancellationToken의 간단한 예제 코드 [1]파일 다운로드1
11887정성태5/8/201913319.NET Framework: 829. C# - yield 문을 사용할 수 있는 메서드의 조건
11886정성태5/7/201912401오류 유형: 534. mstest.exe 실행 시 "Visual Studio Enterprise is required to execute the test." 오류 [2]
11885정성태5/7/20199369오류 유형: 533. mstest.exe 실행 시 "File extension specified '.loadtest' is not a valid test extension." 오류 발생
11884정성태5/5/201913052.NET Framework: 828. C# DLL에서 Win32 C/C++처럼 dllexport 함수를 제공하는 방법 - 두 번째 이야기
11883정성태5/3/201917361.NET Framework: 827. C# - 인터넷 시간 서버로부터 받은 시간을 윈도우에 적용하는 방법파일 다운로드1
11882정성태5/2/201914278.NET Framework: 826. (번역글) .NET Internals Cookbook Part 11 - Various C# riddles파일 다운로드1
11881정성태4/28/201914519오류 유형: 532. .NET Core 프로젝트로 마이그레이션 시 "CS0579 Duplicate 'System.Reflection.AssemblyCompanyAttribute' attribute" 오류 발생
11880정성태4/25/201911218오류 유형: 531. 이벤트 로그 오류 - Task Scheduling Error: m->NextScheduledSPRetry 1547, m->NextScheduledEvent 1547
11879정성태4/24/201916462.NET Framework: 825. (번역글) .NET Internals Cookbook Part 10 - Threads, Tasks, asynchronous code and others파일 다운로드2
11878정성태4/22/201914468.NET Framework: 824. (번역글) .NET Internals Cookbook Part 9 - Finalizers, queues, card tables and other GC stuff파일 다운로드1
11877정성태4/22/201914417.NET Framework: 823. (번역글) .NET Internals Cookbook Part 8 - C# gotchas파일 다운로드1
11876정성태4/21/201914250.NET Framework: 822. (번역글) .NET Internals Cookbook Part 7 - Word tearing, locking and others파일 다운로드1
11875정성태4/21/201914614오류 유형: 530. Visual Studo에서 .NET Core 프로젝트를 열 때 "One or more errors occurred." 오류 발생
11874정성태4/20/201914625.NET Framework: 821. (번역글) .NET Internals Cookbook Part 6 - Object internals파일 다운로드1
11873정성태4/19/201913583.NET Framework: 820. (번역글) .NET Internals Cookbook Part 5 - Methods, parameters, modifiers파일 다운로드1
11872정성태4/17/201914046.NET Framework: 819. (번역글) .NET Internals Cookbook Part 4 - Type members파일 다운로드1
11871정성태4/16/201913903.NET Framework: 818. (번역글) .NET Internals Cookbook Part 3 - Initialization tricks [3]파일 다운로드1
11870정성태4/16/201911573.NET Framework: 817. Process.Start로 실행한 콘솔 프로그램의 출력 결과를 얻는 방법파일 다운로드1
11869정성태4/15/201915419.NET Framework: 816. (번역글) .NET Internals Cookbook Part 2 - GC-related things [2]파일 다운로드2
11868정성태4/15/201913146.NET Framework: 815. CER(Constrained Execution Region)이란?파일 다운로드1
11867정성태4/15/201912175.NET Framework: 814. Critical Finalizer와 SafeHandle의 사용 의미파일 다운로드1
... 61  62  63  64  65  66  67  68  69  [70]  71  72  73  74  75  ...