Skip to content

Commit

Permalink
Merge branch 'main' into editor-config
Browse files Browse the repository at this point in the history
  • Loading branch information
ShuN6211 authored Sep 28, 2024
2 parents 2e22fc1 + 9d80939 commit 675e0ea
Show file tree
Hide file tree
Showing 16 changed files with 1,074 additions and 489 deletions.
18 changes: 9 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.lsp-session-v1
elpa/
init.elc
snippets/
backup/
request/
var
zsh_plugin/
### iterm ###
config/iterm2/AppSupport
.zcomp*

### Local settings ###
*.local
local.*
!local.*.sample

### Zsh cache ###
*.zwc
.zcomp*
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
## my_dotfiles
- My dotfiles
- https://wiki.archlinux.org/title/XDG_Base_Directory
# dotfiles

- My dotfiles: config files and build scripts.
- I follow the design specified in [XDG_Base_Directory](https://wiki.archlinux.org/title/XDG_Base_Directory).

## Requires

- [sheldon](https://github.com/rossmacarthur/sheldon)
- Shell plugin manager.
- Install sheldon using one of the install options you prefer.
- [Deno](https://deno.com/)
- [zeno.zsh](https://github.com/yuki-yano/zeno.zsh) uses deno.
- Install deno using one of the install options you prefer.

## Install
```shell
curl -sL https://raw.githubusercontent.com/ShuN6211/dotfiles/refs/heads/main/install.sh | sh
```
57 changes: 57 additions & 0 deletions config/editorconfig/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
indent_style = space
indent_size = 4
trim_trailing_whitespace = false

[*.html]
indent_style = space
indent_size = 2

[*.{css,scss}]
indent_style = space
indent_size = 2

[*.json]
indent_style = space
indent_size = 2

[*.{yml,yaml}]
indent_style = space
indent_size = 2

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

[*.{js,ts}]
indent_style = space
indent_size = 2

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

[{*.sh,*.bash,*.zsh,.zsh*,.bash*}]
indent_style = space
indent_size = 4

# The indent size used in the `package.json` file cannot be changed
# https://github.com/npm/npm/pull/3180#issuecomment-16336516
[{.travis.yml,npm-shrinkwrap.json,package.json}]
indent_style = space
indent_size = 4
10 changes: 10 additions & 0 deletions config/emacs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/backup
/eln-cache
/elpa
/savehist
*.elc
/custom.el
/projects
/transient
/var
/auto-save-list
236 changes: 52 additions & 184 deletions config/emacs/init.el
Original file line number Diff line number Diff line change
@@ -1,97 +1,73 @@

;; download leaf
;; <leaf-install-code>
(eval-and-compile
(customize-set-variable
'package-archives '(("org" . "https://orgmode.org/elpa/")
("melpa" . "https://melpa.org/packages/")
("gnu" . "https://elpa.gnu.org/packages/")))
'package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
("melpa" . "https://melpa.org/packages/")))
(package-initialize)
(unless (package-installed-p 'leaf)
(package-refresh-contents)
(package-install 'leaf))
(use-package leaf :ensure t)

(leaf leaf-keywords
:ensure t
:init
;; optional packages if you want to use :hydra, :el-get, :blackout,,,
(leaf hydra :ensure t)
(leaf el-get :ensure t)
(leaf blackout :ensure t)

:config
;; initialize leaf-keywords.el
(leaf-keywords-init)))
;; </leaf-install-code>
;; now you can use leaf

;;;; leaf-convert, tree, macrostep

(leaf leaf
:config
(leaf leaf-convert :ensure t)
(leaf leaf-tree
:ensure t
:custom ((imenu-list-size . 30)
(imenu-list-position . 'left))))

(leaf macrostep
:ensure t
:bind (("C-c e" . macrostep-expand)))
(leaf leaf-convert
:doc "Convert many format to leaf format"
:ensure t)

;; 2重管理予防
(leaf cus-edit
:doc "tools for customizing Emacs and Lisp packages"
:tag "builtin" "faces" "help"
:custom `((custom-file . ,(locate-user-emacs-file "custom.el"))))

;; 基本的な設定
;; emacs テーマ選択
(load-theme 'manoj-dark t)

;; y or n
(fset 'yes-or-no-p 'y-or-n-p)

;; clip board
(setq select-enable-clipboard t)

;; 括弧の補完
;;(electric-pair-mode t)

;; リージョンのハイライト
(transient-mark-mode t)

;; 現在位置列数表示
(column-number-mode t)

;; line number の表示
(global-linum-mode t)

;; line number を分かりやすくする
(set-face-attribute 'linum nil
:foreground "#a9a9a9"
:background "#404040"
:height 0.9)
;; スタートアップメッセージを表示させない
(setq inhibit-startup-message t)

;; スクロールは 1 行ごと
(setq mouse-wheel-scroll-amount '(1 ((shift) . 5)))

;; スクロールの加速をやめる
(setq mouse-wheel-progressive-speed nil)
(leaf cus-start
:doc "define customization properties of builtins"
:preface
(defun c/redraw-frame nil
(interactive)
(redraw-frame))

:bind (("M-ESC ESC" . c/redraw-frame))
:custom '((user-full-name . "Shun Makino")
(user-login-name . "ShuN")
(create-lockfiles . nil)
(tab-width . 4)
(debug-on-error . t)
(init-file-debug . t)
(frame-resize-pixelwise . t)
(enable-recursive-minibuffers . t)
(history-length . 1000)
(transient-mark-mode . t)
(history-delete-duplicates . t)
(scroll-preserve-screen-position . t)
(scroll-conservatively . 100)
(mouse-wheel-scroll-amount . '(1 ((control) . 5)))
(select-enable-clipboard . t)
(case-fold-search . t)
(ring-bell-function . 'ignore)
(text-quoting-style . 'straight)
(mouse-wheel-progressive-speed . nil)
(truncate-lines . t)
(inhibit-startup-message . t)
(use-dialog-box . nil)
(use-file-dialog . nil)
(menu-bar-mode . t)
(tool-bar-mode . nil)
(scroll-bar-mode . nil)
(global-display-line-numbers-mode . t )
(indent-tabs-mode . nil))
:config
(defalias 'yes-or-no-p 'y-or-n-p)
(keyboard-translate ?\C-h ?\C-?))

;; 大文字・小文字を区別しない
(setq case-fold-search t)
;; theme
(load-theme 'manoj-dark t)

;; utf-8
(leaf leaf-convert
(leaf editorconfig
:ensure t
:require t
:config
(set-language-environment "japanese")
(set-default-coding-systems 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-buffer-file-coding-system 'utf-8))
(editorconfig-mode 1))

;; auto-convert
(leaf autorevert
Expand Down Expand Up @@ -201,7 +177,7 @@
:custom ((ivy-prescient-retain-classic-highlighting . t))
:global-minor-mode t)

;; flycheck 構文チェッカー
;; flycheck
(leaf flycheck
:doc "On-the-fly syntax checking"
:req "dash-2.12.1" "pkg-info-0.4" "let-alist-1.0.4" "seq-1.11" "emacs-24.3"
Expand Down Expand Up @@ -260,120 +236,12 @@
(c++-mode-hook . ((c-set-style "bsd")
(setq c-basic-offset 4))))

;; lsp

(leaf lsp-mode
:doc "LSP mode"
:tag "languages" "emacs>=26.1"
:url "https://github.com/emacs-lsp/lsp-mode"
:added "2022-07-22"
:emacs>= 26.1
:ensure t
:commands (lsp lsp-deferred)
:custom ((lsp-keymap-prefix . "C-c l"))
:hook (lsp-mode-hook . lsp-headerline-breadcrumb-mode)
)

(leaf lsp-ui
:doc "UI modules for lsp-mode"
:req "emacs-26.1" "dash-2.18.0" "lsp-mode-6.0" "markdown-mode-2.3"
:tag "tools" "languages" "emacs>=26.1"
:url "https://github.com/emacs-lsp/lsp-ui"
:added "2022-11-19"
:emacs>= 26.1
:ensure t
:custom ((lsp-ui-doc-enable . t)
(lsp-ui-doc-position . 'at-point)
(lsp-ui-doc-header . t)
(lsp-ui-doc-include-signature . t)
(lsp-ui-doc-max-width . 150)
(lsp-ui-doc-max-height . 30)
(lsp-ui-doc-use-childframe . nil)
(lsp-ui-doc-use-webkit . nil)
(lsp-ui-peek-enable . t)
(lsp-ui-peek-peek-height . 20)
(lsp-ui-peek-list-width . 50))
)

(leaf lsp-pyright
:doc "Python LSP client using Pyright"
:req "emacs-26.1" "lsp-mode-7.0" "dash-2.18.0" "ht-2.0"
:tag "lsp" "tools" "languages" "emacs>=26.1"
:url "https://github.com/emacs-lsp/lsp-pyright"
:added "2022-07-22"
:emacs>= 26.1
:ensure t
:hook (python-mode-hook . (lambda ()
(require 'lsp-pyright)
(lsp))) ; or lsp-deferred
)

;; python

(leaf python-mode
:doc "Python major mode"
:tag "oop" "python" "processes" "languages"
:url "https://gitlab.com/groups/python-mode-devs"
:added "2022-07-12"
:ensure t
:custom (python-indent-guess-indent-offset . nil))

;; smartparens 括弧の補完など.
(leaf smartparens
:ensure t
:require smartparens-config
:custom ((electric-pair-mode . nil))) ; electirc-pair-modeを無効化.

;; rainbow-delimiters 括弧の強調表示
(leaf rainbow-delimiters
:ensure t
:hook
((prog-mode-hook . rainbow-delimiters-mode)))


;; formatter, blacken
(leaf blacken
:ensure t
:custom ((blacken-line-length . 119) ; 1行の流さを119文字まで許可
(blacken-skip-string-normalization . t))) ; 文字リテラルで '' を""に変えない.

;; jupyter
(leaf ein
:doc "Emacs IPython Notebook"
:req "emacs-25" "websocket-1.12" "anaphora-1.0.4" "request-0.3.3" "deferred-0.5" "polymode-0.2.2" "dash-2.13.0" "with-editor-0.-1"
:tag "reproducible research" "literate programming" "jupyter" "emacs>=25"
:url "https://github.com/dickmao/emacs-ipython-notebook"
:added "2022-11-19"
:emacs>= 25
:custom (ein:polymode . t)
:ensure t
)

;; isort
(leaf py-isort :ensure t)

(leaf highlight-indent-guides
:ensure t
:blackout t
:hook (((prog-mode-hook yaml-mode-hook) . highlight-indent-guides-mode))
:custom (
(highlight-indent-guides-method . 'character)
(highlight-indent-guides-auto-enabled . t)
(highlight-indent-guides-responsive . t)
(highlight-indent-guides-character . ?\|)))

;; コードの先頭, 末尾への移動, 行頭, 行末への移動.
(leaf mwim
:ensure t
:bind (("C-a" . mwim-beginning-of-code-or-line)
("C-e" . mwim-end-of-code-or-line)))

(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:inherit nil :stipple nil :background "black" :foreground "WhiteSmoke" :inverse-video nil :box nil :strike-through nil :extend nil :overline nil :underline nil :slant normal :weight normal :height 160 :width normal :foundry "nil" :family "Cica")))))

;; end of init.el
(provide 'init)
Loading

0 comments on commit 675e0ea

Please sign in to comment.