BIBLIOGRAPHY
“Emacs: 빈 줄 지우기 @Ntalbs’ Stuff.” n.d. Accessed April 16, 2025. https://ntalbs.github.io/2015/emacs-removing-blank-lines/.
Related Notes
History
- 거슬려서 짬나는 김에
|2025-04-16 Wed 18:25|
@user orgmode에서 빈라인 지우는 방법?
@assistant Org Mode에서 빈 줄을 지우려면 Emacs의 flush-lines
함수를 사용할 수 있습니다. 다음 명령을 실행하세요:
- 커서를 버퍼 시작 부분으로 이동:
M-<
- 정규식으로 빈 줄 삭제:
M-x flush-lines RET ^$ RET
공백만 포함된 줄도 삭제하려면 정규식을 ^\s-*$
로 변경하세요:
M-x flush-lines RET ^\s-*$ RET
이 방법은 Org Mode 문서에서도 적용할 수 있습니다.
- Citations: [1] https://orgmode.org/manual/Org-Indent-Mode.html [2] https://ntalbs.github.io/2015/emacs-removing-blank-lines/ [3] https://ohyecloudy.com/emacsian/2020/03/15/org-column-view-with-visual-line-mode/ [4] https://orgmode.org/manual/Paragraphs.html
@user 두줄 비어 있는 경우만 지우고 싶어
@assistant Emacs에서 두 줄 이상의 빈 줄만 지우고 싶다면, 다음 명령을 사용할 수 있습니다:
- 커서를 버퍼 시작 부분으로 이동:
M-<
- 빈 줄 두 개 이상을 찾고 삭제:
M-x flush-lines RET ^\n{2,}$ RET
이 명령은 두 개 이상의 연속된 빈 줄을 삭제합니다. ^\n{2,}$
정규식은 두 개 이상의 연속된 줄 바꿈 문자를 찾습니다.
이 방법은 Org Mode에서도 적용할 수 있습니다.
참고로, ^\n{2,}
는 두 개 이상의 줄 바꿈 문자를 찾는 정규식입니다. ^
는 줄 시작을 의미하고, \n{2,}
는 두 개 이상의 줄 바꿈 문자를 의미합니다. $
는 줄 끝을 의미합니다.
이 명령을 사용하면 두 줄 이상의 빈 줄만 삭제되고, 한 줄의 빈 줄은 남아 있습니다.
- Citations: [1] https://ntalbs.github.io/2015/emacs-removing-blank-lines/ [2] https://seorenn.blogspot.com/2011/05/emacs_05.html [3] https://ohyecloudy.com/emacsian/2018/06/30/orgmode-remap-org-return-to-org-return-indent/ [4] https://ohyecloudy.com/emacsian/2020/03/15/org-column-view-with-visual-line-mode/ [5] https://docs.rockylinux.org/ko/books/admin_guide/05-vi/
@user 두줄이상 공백라인이면 삭제해주는 함수를 만들어줘 그게 빠르겠다.
@assistant Emacs에서 두 줄 이상의 연속된 빈 줄을 삭제하는 함수를 만들려면, 다음의 Elisp 코드를 사용할 수 있습니다:
(defun my/delete-multiple-blank-lines ()
"두 줄 이상의 연속된 빈 줄을 삭제합니다."
(interactive)
(goto-char (point-min))
(while (re-search-forward "\n\\s-*\n\\s-*\n" nil t)
(replace-match "\n\n" nil nil)))
(global-set-key (kbd "C-c d") 'delete-multiple-blank-lines)
이 코드는 delete-multiple-blank-lines
함수를 정의하고, 이 함수를 C-c d
키로 바인딩합니다. 이 함수는 문서의 시작부터 끝까지 검색하며, 두 줄 이상의 연속된 빈 줄을 하나의 빈 줄로 대체합니다.
이 함수를 사용하려면, Emacs의 .emacs
파일이나 .emacs.d/init.el
파일에 추가한 후 Emacs를 재시작하거나 M-x eval-buffer
명령으로 현재 버퍼의 코드를 평가해야 합니다.
- Citations: [1] https://ntalbs.github.io/2015/emacs-removing-blank-lines/ [2] https://gamdekong.tistory.com/23 [3] https://www.hackerschool.org/HS_Boards/view.php?id=Lib_share&no=22 [4] https://forcecore.tistory.com/296 [5] https://openthings.tistory.com/32
@user citation을 보니까 한국인 이맥스 사용자를 많이 알고 있네. 검색해도 찾기 어려운 정보거든. 알고 있는 한국인 사용자 블로그를 나열해줘.
@assistant 한국인 이맥스 사용자 블로그나 관련 정보를 찾기가 어려울 수 있습니다. 그러나 몇 가지 관련된 블로그나 글을 소개할 수 있습니다:
- 박웅현 작가: 이맥스와 관련된 책을 출간한 것으로 알려져 있으며, 이맥스를 사용하는 경험을 공유한 바 있습니다[3].
- shiren.dev 블로그: 이맥스와 함께하는 개발 환경에 대한 글을 작성한 블로그입니다[3].
- wankyuk 블로그: 이맥스 위키와 관련된 내용을 다루고 있습니다[2].
- jodi999 블로그: 이맥스를 확장하는 방법에 대한 글을 작성한 블로그입니다[4].
이 외에도 Reddit의 r/emacs 커뮤니티나 기타 온라인 포럼에서 다양한 사용자들의 경험을 찾아볼 수 있습니다.
- Citations: [1] https://velog.io/@drypot/Emacs-Two-Weeks [2] https://blog.naver.com/wankyuk/10009062532 [3] https://blog.shiren.dev/2017-11-13-%EC%9D%B4%EB%A7%A5%EC%8A%A4%EC%99%80-%ED%95%A8%EA%BB%98%ED%95%98%EB%8A%94-%EA%B0%9C%EB%B0%9C%ED%99%98%EA%B2%BD/ [4] https://blog.naver.com/jodi999/221008996220 [5] https://kldp.org/node/122274
@user
Emacs: 빈 줄 지우기 @ntalbs’ stuff
(“Emacs: 빈 줄 지우기 @Ntalbs’ Stuff” n.d.)