Compare commits
1 Commits
fa9286e318
...
dev/script
| Author | SHA1 | Date | |
|---|---|---|---|
| 2e5c0dfedf |
@@ -12,11 +12,6 @@ end
|
||||
|
||||
set fish_greeting ""
|
||||
|
||||
if test -x $HOME/.local/bin
|
||||
set PATH $PATH $HOME/.local/bin
|
||||
end
|
||||
|
||||
|
||||
################################################################################
|
||||
# exa
|
||||
################################################################################
|
||||
@@ -33,7 +28,6 @@ end
|
||||
alias emacs="emacs -nw"
|
||||
alias gemacs="/usr/bin/emacs"
|
||||
set -gx EDITOR "emacs"
|
||||
set -gx LSP_USE_PLISTS "true"
|
||||
|
||||
################################################################################
|
||||
# Deb maintainer stuff
|
||||
@@ -64,17 +58,15 @@ export MINICOM="-c on"
|
||||
|
||||
|
||||
################################################################################
|
||||
# Anaconda / Conda / Mambaforge
|
||||
# Conda
|
||||
################################################################################
|
||||
|
||||
set CONDA_PREFIXES mambaforge miniforge3 miniconda3 anaconda3
|
||||
for prefix in $CONDA_PREFIXES
|
||||
if test -x $HOME/$prefix/bin/conda
|
||||
eval $HOME/$prefix/bin/conda "shell.fish" "hook" $argv | source
|
||||
break
|
||||
if test -x $HOME/miniconda3/bin/conda
|
||||
# >>> conda initialize >>>
|
||||
# !! Contents within this block are managed by 'conda init' !!
|
||||
eval $HOME/miniconda3/bin/conda "shell.fish" "hook" $argv | source
|
||||
# <<< conda initialize <<<
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
################################################################################
|
||||
# direnv
|
||||
@@ -88,22 +80,6 @@ direnv hook fish | source
|
||||
|
||||
starship init fish | source
|
||||
|
||||
################################################################################
|
||||
# CUDA
|
||||
################################################################################
|
||||
|
||||
if test -d /usr/local/cuda
|
||||
set PATH $PATH /usr/local/cuda/bin
|
||||
end
|
||||
|
||||
################################################################################
|
||||
# RUST
|
||||
################################################################################
|
||||
|
||||
if test -d $HOME/.cargo/bin
|
||||
set PATH $PATH $HOME/.cargo/bin
|
||||
end
|
||||
|
||||
################################################################################
|
||||
# Colortest
|
||||
################################################################################
|
||||
|
||||
@@ -30,4 +30,3 @@ SETUVAR fish_pager_color_completion:normal
|
||||
SETUVAR fish_pager_color_description:B3A06D\x1eyellow
|
||||
SETUVAR fish_pager_color_prefix:white\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
|
||||
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
|
||||
SETUVAR fish_pager_color_selected_background:\x2dr
|
||||
|
||||
@@ -3,12 +3,3 @@
|
||||
email = alexandre.tuleu.2005@polytechnique.org
|
||||
[credential]
|
||||
helper = cache
|
||||
[merge]
|
||||
tool = meld
|
||||
[init]
|
||||
defaultBranch = main
|
||||
[filter "lfs"]
|
||||
process = git-lfs filter-process
|
||||
required = true
|
||||
clean = git-lfs clean -- %f
|
||||
smudge = git-lfs smudge -- %f
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
*~
|
||||
.dir-locals.el
|
||||
.envrc
|
||||
.direnv
|
||||
cover.out
|
||||
.projectile
|
||||
.clangd
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
package foreign-env
|
||||
package nvm
|
||||
theme bobthefish
|
||||
theme default
|
||||
|
||||
@@ -8,8 +8,8 @@ disabled = true
|
||||
|
||||
|
||||
[character] # The name of the module we are configuring is "character"
|
||||
success_symbol = "[](#444444)" # The "success_symbol" segment is being set to "➜" with the color "bold green"
|
||||
error_symbol = "[](red)" # The "success_symbol" segment is being set to "➜" with the color "bold green"
|
||||
success_symbol = "[◤](#444444)" # The "success_symbol" segment is being set to "➜" with the color "bold green"
|
||||
error_symbol = "[◤](red)" # The "success_symbol" segment is being set to "➜" with the color "bold green"
|
||||
|
||||
[username]
|
||||
style_user="bold green"
|
||||
@@ -44,7 +44,7 @@ format="[$symbol$version]($style) "
|
||||
disabled = false
|
||||
map_symbol = true
|
||||
style="bg:#444444 red"
|
||||
format = "[](#444444 bg:red)[$symbol $status ](bg:red)"
|
||||
format = "[◤](#444444 bg:red)[$symbol $status ](bg:red)"
|
||||
|
||||
[time]
|
||||
disabled = false
|
||||
|
||||
755
.emacs
755
.emacs
@@ -1,9 +1,5 @@
|
||||
;(toggle-debug-on-error)
|
||||
(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")
|
||||
;;lsp performances
|
||||
(setq gc-cons-threshold (* 100 1024 1024));; 100MB
|
||||
(setq read-process-output-max (* 3 1024 1024));; 3MB
|
||||
|
||||
|
||||
(custom-set-variables
|
||||
;; custom-set-variables was added by Custom.
|
||||
;; If you edit it by hand, you could mess it up, so be careful.
|
||||
@@ -11,564 +7,335 @@
|
||||
;; If there is more than one, they won't work right.
|
||||
'(c-basic-offset 4)
|
||||
'(c-default-style
|
||||
'((c++-mode . "tuleu-c++")
|
||||
(quote
|
||||
((c++-mode . "tuleu-c++")
|
||||
(java-mode . "java")
|
||||
(awk-mode . "awk")
|
||||
(other . "gnu")))
|
||||
(other . "gnu"))))
|
||||
'(company-idle-delay 20.0)
|
||||
'(compilation-scroll-output 'first-error)
|
||||
'(custom-safe-themes
|
||||
'("162201cf5b5899938cfaec99c8cb35a2f1bf0775fc9ccbf5e63130a1ea217213" "e3daa8f18440301f3e54f2093fe15f4fe951986a8628e98dcd781efbec7a46f2" "6622bb651e72d8ebd66454bd86db6c3990324243ff4325c1b6df252aba63b13e" "2f8eadc12bf60b581674a41ddc319a40ed373dd4a7c577933acaff15d2bf7cc6" "f458b92de1f6cf0bdda6bce23433877e94816c3364b821eb4ea9852112f5d7dc" "016f665c0dd5f76f8404124482a0b13a573d17e92ff4eb36a66b409f4d1da410" "13096a9a6e75c7330c1bc500f30a8f4407bd618431c94aeab55c9855731a95e1" "8b148cf8154d34917dfc794b5d0fe65f21e9155977a36a5985f89c09a9669aa0" "bf948e3f55a8cd1f420373410911d0a50be5a04a8886cabe8d8e471ad8fdba8e" "680f62b751481cc5b5b44aeab824e5683cf13792c006aeba1c25ce2d89826426" "631c52620e2953e744f2b56d102eae503017047fb43d65ce028e88ef5846ea3b" default))
|
||||
'(display-time-24hr-format t)
|
||||
'(display-time-default-load-average nil)
|
||||
'(doom-modeline-github t)
|
||||
'(doom-modeline-indent-info t)
|
||||
'(doom-modeline-minor-modes t)
|
||||
'(doom-modeline-total-line-number t)
|
||||
'(fill-column 80)
|
||||
'(display-line-numbers-type t)
|
||||
'(global-auto-revert-mode t)
|
||||
'(global-display-line-numbers-mode t)
|
||||
'(global-subword-mode t)
|
||||
'(gofmt-command "goimports")
|
||||
'(inhibit-startup-screen t)
|
||||
'(lisp-body-indent 4)
|
||||
'(lisp-indent-offset 4)
|
||||
'(lisp-lambda-list-keyword-alignment t)
|
||||
'(lisp-lambda-list-keyword-parameter-alignment t)
|
||||
'(lisp-lambda-list-keyword-parameter-indentation 4)
|
||||
'(lisp-loop-forms-indentation 4)
|
||||
'(lisp-loop-keyword-indentation 4)
|
||||
'(lisp-simple-loop-indentation 4)
|
||||
'(lisp-tag-body-indentation 4)
|
||||
'(lisp-tag-indentation 4)
|
||||
'(org-agenda-files '("~/org/1.TODO.org"))
|
||||
'(org-agenda-files (quote ("~/org/1.TODO.org")))
|
||||
'(package-archives
|
||||
(quote
|
||||
(("gnu" . "https://elpa.gnu.org/packages/")
|
||||
("melpa" . "https://melpa.org/packages/"))))
|
||||
'(package-enable-at-startup nil)
|
||||
'(package-selected-packages
|
||||
'(clang-format+ cmake-format xterm-color dockerfile-mode web-mode prettier json-mode py-isort blacken pyvenv yaml-mode lsp-pyright ng2-mode lsp-ltex lsp-treemacs treemacs-nerd-icons treemacs-projectile treemacs lsp-ui lsp-mode which-key flycheck vterm projectile yasnippet-snippets yasnippet aggressive-indent doom-themes company-go zenburn-theme langtool smart-tabs-mode typescript-mode protobuf-mode opencl-mode glsl-mode go-mode markdown-mode srefactor irony cmake-mode company magit use-package))
|
||||
(quote
|
||||
(zenburn-theme langtool smart-tabs-mode typescript-mode protobuf-mode opencl-mode glsl-mode go-mode elpy markdown-mode yasnippet srefactor irony cmake-mode company magit use-package)))
|
||||
'(safe-local-variable-values
|
||||
'((vc-follow-symlinks . t)
|
||||
(quote
|
||||
((vc-follow-symlinks . t)
|
||||
(TeX-master . t)
|
||||
(TeX-parse-self . t)))
|
||||
'(system-packages-noconfirm t)
|
||||
(TeX-parse-self . t))))
|
||||
'(srefactor--getter-prefix "Get")
|
||||
'(srefactor--getter-setter-capitalize-p t)
|
||||
'(srefactor--setter-prefix "Set")
|
||||
'(tab-width 4)
|
||||
'(warning-suppress-log-types '((comp)))
|
||||
'(whitespace-style
|
||||
'(face trailing tabs lines-tail newline space-before-tab::tab space-before-tab::space space-before-tab tab-mark)))
|
||||
(quote
|
||||
(face trailing tabs lines-tail newline space-before-tab::tab space-before-tab::space space-before-tab tab-mark))))
|
||||
|
||||
|
||||
(if (display-graphic-p)
|
||||
(if (fboundp 'tool-bar-mode)
|
||||
(tool-bar-mode -1))
|
||||
(if (fboundp 'toggle-scroll-bar)
|
||||
(toggle-scroll-bar -1))
|
||||
(menu-bar-mode -1)
|
||||
(if (fboundp 'tool-bar-mode)
|
||||
(tool-bar-mode -1))
|
||||
)
|
||||
|
||||
(add-to-list 'default-frame-alist '(fullscreen . maximized))
|
||||
(add-hook 'before-save-hook 'delete-trailing-whitespace)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; package.el and use-package bootstrap
|
||||
;; Use-Package
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
|
||||
("gnu" . "https://elpa.gnu.org/packages/")))
|
||||
(package-initialize)
|
||||
(eval-when-compile
|
||||
|
||||
(unless (package-installed-p 'use-package)
|
||||
(unless package-archive-contents
|
||||
(package-refresh-contents))
|
||||
(package-refresh-contents)
|
||||
)
|
||||
(package-install 'use-package)
|
||||
)
|
||||
(require 'use-package)
|
||||
)
|
||||
|
||||
(require 'use-package)
|
||||
(require 'use-package-ensure)
|
||||
(setq use-package-always-ensure t)
|
||||
|
||||
|
||||
(use-package use-package-ensure-system-package)
|
||||
|
||||
;; required because vterm wants this before loading.
|
||||
(use-package emacs
|
||||
:demand t
|
||||
:ensure-system-package (
|
||||
(cmake . cmake)
|
||||
("/usr/include/vterm.h" . libvterm-dev)
|
||||
)
|
||||
)
|
||||
(require 'use-package)
|
||||
|
||||
|
||||
|
||||
(use-package doom-modeline
|
||||
:init
|
||||
(doom-modeline-mode 1)
|
||||
(display-time-mode 1))
|
||||
|
||||
(use-package delight
|
||||
:config
|
||||
(delight '((eldoc-mode nil "eldoc")
|
||||
(subword-mode nil "subword")))
|
||||
)
|
||||
|
||||
(use-package multiple-cursors
|
||||
:bind (("C-c m >" . 'mc/mark-next-like-this)
|
||||
("C-c m <" . 'mc/mark-previous-like-this)
|
||||
("C-c m a" . 'mc/mark-all-like-this)
|
||||
("C-c m e" . 'mc/edit-lines)
|
||||
)
|
||||
)
|
||||
|
||||
(use-package doom-themes
|
||||
:config
|
||||
(setq doom-themes-enable-bold t ; if nil, bold is universally disabled
|
||||
doom-themes-enable-italic t) ; if nil, italics is universally disabled
|
||||
(load-theme 'doom-spacegrey t)
|
||||
;; Enable flashing mode-line on errors
|
||||
(doom-themes-visual-bell-config )
|
||||
;; or for treemacs users
|
||||
;;(setq doom-themes-treemacs-theme "doom-atom") ; use "doom-colors" for less minimal icon theme
|
||||
;;(doom-themes-treemacs-config)
|
||||
;; Corrects (and improves) org-mode's native fontification.
|
||||
(doom-themes-org-config)
|
||||
(defun atu/toggle-display-line-mode ()
|
||||
"toggle between relative and absolute display-line-mode"
|
||||
(interactive)
|
||||
(if (eq display-line-numbers 'relative)
|
||||
(setq display-line-numbers 'absolute)
|
||||
(setq display-line-numbers 'relative)
|
||||
)
|
||||
)
|
||||
:init
|
||||
(setq whitespace-line-column nil)
|
||||
(global-whitespace-mode 1)
|
||||
:bind (
|
||||
("C-c d l" . 'atu/toggle-display-line-mode)
|
||||
)
|
||||
)
|
||||
|
||||
(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.
|
||||
)
|
||||
|
||||
(use-package xterm-color
|
||||
:config
|
||||
(setq compilation-environment '("TERM=xterm-256color"))
|
||||
|
||||
(defun atu/advice-compilation-filter (f proc string)
|
||||
(funcall f proc (xterm-color-filter string)))
|
||||
|
||||
(advice-add 'compilation-filter :around #'atu/advice-compilation-filter)
|
||||
)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Keymap
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
(global-set-key (kbd "<f9>") 'compile)
|
||||
|
||||
(use-package smart-tabs-mode
|
||||
:config
|
||||
(setq-default tab-width 4) ; or any other preferred value
|
||||
(setq cua-auto-tabify-rectangles nil)
|
||||
;; (defadvice align (around smart-tabs activate)
|
||||
;; (let ((indent-tabs-mode nil)) ad-do-it))
|
||||
;; (defadvice align (around smart-tabs activate)
|
||||
;; (let ((indent-tabs-mode nil)) ad-do-it))
|
||||
;; (defadvice align-regexp (around smart-tabs activate)
|
||||
;; (let ((indent-tabs-mode nil)) ad-do-it))
|
||||
(defadvice indent-relative (around smart-tabs activate)
|
||||
(let ((indent-tabs-mode nil)) ad-do-it))
|
||||
(defadvice indent-according-to-mode (around smart-tabs activate)
|
||||
(let ((indent-tabs-mode indent-tabs-mode))
|
||||
(if (memq indent-line-function
|
||||
'(indent-relative
|
||||
indent-relative-maybe))
|
||||
(setq indent-tabs-mode nil))
|
||||
ad-do-it))
|
||||
(smart-tabs-advice c-indent-line c-basic-offset)
|
||||
(smart-tabs-advice c-indent-region c-basic-offset)
|
||||
|
||||
(smart-tabs-add-language-support cmake cmake-mode-hook
|
||||
(
|
||||
(cmake-indent . cmake-tab-width)
|
||||
)
|
||||
)
|
||||
|
||||
(smart-tabs-add-language-support protobuf protobuf-mode-hook
|
||||
(
|
||||
(c-indent-line . c-basic-offset)
|
||||
(c-indent-region . c-basic-offset)
|
||||
)
|
||||
)
|
||||
|
||||
(smart-tabs-add-language-support html html-mode-hook
|
||||
(
|
||||
(sgml-indent-line . sgml-basic-offset)
|
||||
)
|
||||
)
|
||||
(smart-tabs-add-language-support glsl glsl-mode-hook
|
||||
(
|
||||
(c-indent-line . c-basic-offset)
|
||||
(c-indent-region . c-basic-offset)
|
||||
)
|
||||
)
|
||||
|
||||
(smart-tabs-add-language-support opencl opencl-mode-hook
|
||||
(
|
||||
(c-indent-line . c-basic-offset)
|
||||
(c-indent-region . c-basic-offset)
|
||||
)
|
||||
)
|
||||
|
||||
(smart-tabs-add-language-support elisp emacs-lisp-mode-hook
|
||||
(
|
||||
(lisp-indent-line . lisp-indent-offset)
|
||||
(lisp-indent-region . lisp-indent-offset)
|
||||
)
|
||||
(smart-tabs-insinuate 'c 'javascript 'c++ 'cmake 'nxml 'protobuf 'html 'glsl)
|
||||
)
|
||||
|
||||
(smart-tabs-insinuate 'c 'c++ 'cmake 'nxml 'protobuf 'glsl 'elisp)
|
||||
)
|
||||
|
||||
(use-package aggressive-indent
|
||||
:hook
|
||||
(emacs-lisp-mode . aggressive-indent-mode)
|
||||
)
|
||||
|
||||
(use-package magit
|
||||
:commands (magit-status)
|
||||
:bind ("C-x g" . magit-status)
|
||||
:hook
|
||||
(magit-mode .
|
||||
(lambda () (setq-local whitespace-style nil)))
|
||||
:custom
|
||||
(magit-credential-cache-daemon-socket nil)
|
||||
)
|
||||
|
||||
(use-package company
|
||||
:delight
|
||||
:bind ( ("M-TAB" . company-complete) )
|
||||
:config
|
||||
(global-company-mode t)
|
||||
)
|
||||
|
||||
(use-package cmake-mode
|
||||
:ensure-system-package (
|
||||
(cmake . cmake)
|
||||
(pip . python3-pip)
|
||||
(cmake-format . "pip install --user cmakelang[YAML]")
|
||||
)
|
||||
:config
|
||||
(setq cmake-tab-width 4)
|
||||
(defun atu/cmake-format-buffer ()
|
||||
"Formats the current buffer using cmake-format"
|
||||
(interactive)
|
||||
(shell-command-on-region
|
||||
;; region to execute on
|
||||
(point-min)
|
||||
(point-max)
|
||||
;; command
|
||||
"cmake-format -"
|
||||
;; replace
|
||||
t
|
||||
;; name of the error bufer
|
||||
"* cmake-format Error Buffer *"
|
||||
;;
|
||||
t))
|
||||
|
||||
:hook
|
||||
(cmake-mode . lsp-deferred)
|
||||
(cmake-mode . (lambda () (add-hook 'before-save-hook 'atu/cmake-format-buffer nil 'local)))
|
||||
)
|
||||
|
||||
(use-package cc-mode
|
||||
:ensure nil
|
||||
:ensure-system-package
|
||||
(clangd . clangd)
|
||||
:hook
|
||||
(c-mode . lsp-deferred)
|
||||
(c++-mode . lsp-deferred)
|
||||
(use-package company-irony
|
||||
:after (company irony)
|
||||
; :config
|
||||
; (add-to-list 'company-backends 'company-irony)
|
||||
)
|
||||
|
||||
(use-package clang-format+
|
||||
:ensure-system-package
|
||||
(clang-format . clang-format)
|
||||
:hook
|
||||
(c-mode-common . clang-format+-mode)
|
||||
(use-package company-irony-c-headers
|
||||
:after (company irony)
|
||||
; :config
|
||||
; (add-to-list 'company-backends 'company-irony-c-headers)
|
||||
)
|
||||
|
||||
(use-package irony
|
||||
:config
|
||||
(push 'glsl-mode irony-supported-major-modes)
|
||||
(push 'protobuf-mode irony-supported-major-modes)
|
||||
(push 'opencl-mode irony-supported-major-modes)
|
||||
)
|
||||
|
||||
(use-package srefactor
|
||||
:bind (:map c-mode-map
|
||||
("M-RET" . srefactor-refactor-at-point)
|
||||
:map c++-mode-map
|
||||
("M-RET" . srefactor-refactor-at-point))
|
||||
)
|
||||
|
||||
|
||||
(use-package yasnippet
|
||||
:delight yas-minor-mode
|
||||
:config
|
||||
(yas-global-mode)
|
||||
:after (company)
|
||||
:bind ( :map yas-minor-mode-map
|
||||
("TAB" . nil)
|
||||
)
|
||||
:config
|
||||
; (add-to-list 'company-backends 'company-yasnippet)
|
||||
)
|
||||
|
||||
(use-package yasnippet-snippets
|
||||
:after (yasnippet)
|
||||
)
|
||||
|
||||
(use-package projectile
|
||||
:bind ( :map projectile-mode-map
|
||||
( "C-c p" . 'projectile-command-map)
|
||||
)
|
||||
:delight
|
||||
:config
|
||||
(projectile-mode +1)
|
||||
(setq projectile-per-project-compilation-buffer t)
|
||||
(projectile-register-project-type 'ng2 '("angular.json" "package.json" "tsconfig.json")
|
||||
:project-file "angular.json"
|
||||
:compile "npm install"
|
||||
:test "ng test --progress=false"
|
||||
:run "ng serve"
|
||||
:test-suffix ".spec")
|
||||
)
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; C/C++
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(use-package vterm)
|
||||
|
||||
(use-package flycheck
|
||||
:delight
|
||||
:bind (("C-c C-n" . 'flycheck-next-error))
|
||||
:config
|
||||
(defvar-local atu/flycheck-local-cache nil)
|
||||
|
||||
(defun atu/flycheck-checker-get (fn checker property)
|
||||
(or (alist-get property (alist-get checker atu/flycheck-local-cache))
|
||||
(funcall fn checker property)))
|
||||
|
||||
(advice-add 'flycheck-checker-get :around 'atu/flycheck-checker-get)
|
||||
|
||||
(setq flycheck-indication-mode 'left-margin)
|
||||
|
||||
;; Adjust margins and fringe widths…
|
||||
(defun atu/set-flycheck-margins ()
|
||||
(setq left-fringe-width 8 right-fringe-width 8
|
||||
left-margin-width 1 right-margin-width 0)
|
||||
(flycheck-refresh-fringes-and-margins))
|
||||
:hook
|
||||
(flycheck-mode . atu/set-flycheck-margins)
|
||||
)
|
||||
|
||||
(use-package which-key
|
||||
:delight
|
||||
:config
|
||||
(which-key-mode)
|
||||
(which-key-setup-side-window-right-bottom)
|
||||
)
|
||||
|
||||
(use-package lsp-mode
|
||||
:delight
|
||||
:after (flycheck)
|
||||
:init
|
||||
;; set prefix for lsp-command-keymap (few alternatives - "C-l", "C-c l")
|
||||
(setq lsp-keymap-prefix "C-c l")
|
||||
:bind-keymap ("C-c l" . lsp-command-map)
|
||||
:config
|
||||
(yas-minor-mode)
|
||||
(if (display-graphic-p)
|
||||
(setq lsp-ui-doc-use-webkit t)
|
||||
)
|
||||
(add-to-list 'lsp-language-id-configuration '("\\.postcss\\'" . "css"))
|
||||
(advice-add 'lsp :before
|
||||
(lambda (&rest _args)
|
||||
(eval '(setf (lsp-session-server-id->folders (lsp-session)) (ht)
|
||||
(defun c-c++-header ()
|
||||
"sets either c-mode or c++-mode, whichever is appropriate for
|
||||
header"
|
||||
(interactive)
|
||||
(let ((c-file (concat (substring (buffer-file-name) 0 -1) "c")))
|
||||
(if (file-exists-p c-file)
|
||||
(c-mode)
|
||||
(c++-mode)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
:bind (
|
||||
("C-c C-d" . lsp-ui-doc-toggle)
|
||||
)
|
||||
:hook
|
||||
(lsp-mode . lsp-enable-which-key-integration)
|
||||
:commands
|
||||
(lsp lsp-deferred)
|
||||
)
|
||||
|
||||
(use-package lsp-ui
|
||||
:commands lsp-ui-mode
|
||||
:config
|
||||
(setq lsp-ui-sideline-show-diagnostics nil)
|
||||
:custom-face
|
||||
(lsp-ui-doc-background ((t (:background "#373B41"))))
|
||||
|
||||
)
|
||||
|
||||
(use-package treemacs
|
||||
:bind (("C-x t t" . treemacs)
|
||||
("M-0" . treemacs-select-window))
|
||||
:config
|
||||
(add-hook 'treemacs-mode-hook (lambda () (display-line-numbers-mode -1)))
|
||||
(treemacs-project-follow-mode t)
|
||||
)
|
||||
|
||||
(use-package treemacs-projectile)
|
||||
|
||||
(use-package nerd-icons )
|
||||
|
||||
(use-package treemacs-nerd-icons
|
||||
:config
|
||||
(treemacs-load-theme "nerd-icons"))
|
||||
|
||||
(use-package lsp-treemacs
|
||||
:after lsp-mode
|
||||
)
|
||||
|
||||
(use-package lsp-ltex
|
||||
:init
|
||||
(setq lsp-ltex-version "15.2.0")) ; make sure you have set this, see below
|
||||
|
||||
(use-package ng2-mode
|
||||
:hook
|
||||
(typescript-mode . lsp-deferred)
|
||||
)
|
||||
|
||||
(use-package lsp-pyright
|
||||
:hook
|
||||
(python-mode . (lambda ()
|
||||
(require 'lsp-pyright)
|
||||
(lsp-deferred))) ; or lsp-deferred
|
||||
)
|
||||
|
||||
|
||||
(use-package yaml-mode)
|
||||
|
||||
(use-package python
|
||||
:custom
|
||||
(python-shell-interpreter "ipython")
|
||||
(python-shell-interpreter-args "-i --simple-prompt")
|
||||
(python-indent-guess-indent-offset-verbose nil)
|
||||
:hook
|
||||
(python-mode . (lambda () (setq-local company-prescient-sort-length-enable nil)))
|
||||
(python-mode . (lambda () (setq-local fill-column 88)))
|
||||
(python-mode . lsp-deferred)
|
||||
(python-mode . atu/activate-venv)
|
||||
(lsp-managed-mode . (lambda ()
|
||||
(when (derived-mode-p 'python-mode)
|
||||
(setq atu/flycheck-local-cache '((lsp . ((next-checkers . (python-flake8)))))))))
|
||||
|
||||
)
|
||||
|
||||
(use-package pyvenv
|
||||
:after (projectile)
|
||||
:config
|
||||
(defun atu/get-direnv-venv ()
|
||||
"Gets .direnv from project root python venv if any"
|
||||
(when-let* ((root-dir (projectile-project-root))
|
||||
(direnv (concat (file-name-as-directory root-dir) ".direnv"))
|
||||
(direnv-exists (file-directory-p direnv))
|
||||
(venvs (directory-files direnv t "python-.*")))
|
||||
(car (last venvs)))
|
||||
)
|
||||
(defun atu/get-dotvenv ()
|
||||
"Gets .venv from project root if any"
|
||||
(when-let* ((root-dir (projectile-project-root))
|
||||
(venv-file (concat (file-name-as-directory root-dir) ".venv"))
|
||||
(venv-exists (file-exists-p venv-file))
|
||||
(venv-name (with-temp-buffer
|
||||
(insert-file-contents venv-file)
|
||||
(nth 0 (split-string (buffer-string))))))
|
||||
venv-name)
|
||||
)
|
||||
|
||||
(defun atu/get-venv-name ()
|
||||
"Gets venv name from project root. Support .venv and .direnv structure"
|
||||
(or (atu/get-dotvenv) (atu/get-direnv-venv))
|
||||
)
|
||||
|
||||
(defun atu/activate-venv ()
|
||||
"Activate python environment according to the project root"
|
||||
(when-let ((venv-name (atu/get-venv-name)))
|
||||
(setenv "WORKON_HOME" venv-name)
|
||||
(pyvenv-mode)
|
||||
(pyvenv-workon venv-name)
|
||||
(pyvenv-activate venv-name)
|
||||
(message (format "Using python: %s" venv-name))
|
||||
)
|
||||
)
|
||||
|
||||
(defun atu/get-venv-python ()
|
||||
"returns python executable from current venv"
|
||||
(when-let* ((venv-name (atu/get-venv-name))
|
||||
(python-exec (concat (file-name-as-directory venv-name) "bin/python3"))
|
||||
(python-exists (file-executable-p python-exec))
|
||||
)
|
||||
python-exec)
|
||||
)
|
||||
|
||||
(defun atu/activate-flycheck ()
|
||||
"Activate flycheck unless its in the venv"
|
||||
(if-let ((venv-name (atu/get-venv-name)))
|
||||
(unless (and buffer-file-name (file-in-directory-p buffer-file-name venv-name))
|
||||
(flycheck-mode))
|
||||
(flycheck-mode))
|
||||
)
|
||||
|
||||
(defun atu/pyls-set-jedi-environment ()
|
||||
"Sets the jedi environment according to the discovered venv"
|
||||
(when-let ((venv-name (atu/get-venv-name)))
|
||||
(setq lsp-pylsp-plugins-jedi-environment venv-name))
|
||||
)
|
||||
|
||||
(defun atu/append-workspace-extra-paths ()
|
||||
"Appends needed extra-paths to lsp-jedi workspace if found"
|
||||
(when-let* ((venv-name (atu/get-venv-name))
|
||||
(site-packages (file-expand-wildcards (concat (file-name-as-directory venv-name) "lib/python*/site-packages")))
|
||||
(site-package (car site-packages)))
|
||||
(setq lsp-jedi-workspace-extra-paths
|
||||
(vconcat lsp-jedi-workspace-extra-paths (vector site-package))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defun atu/flycheck-set-python-paths ()
|
||||
"Sets the rights executable for flycheck"
|
||||
(when-let ((python-exec (atu/get-venv-python)))
|
||||
(flycheck-set-checker-executable 'python-flake8 python-exec)
|
||||
(flycheck-set-checker-executable 'python-pylint python-exec)
|
||||
(flycheck-set-checker-executable 'python-mypy python-exec)
|
||||
(flycheck-reset-enabled-checker 'python-flake8)
|
||||
(flycheck-reset-enabled-checker 'python-pylint)
|
||||
(flycheck-add-next-checker 'lsp 'python-pylint)
|
||||
)
|
||||
)
|
||||
:hook
|
||||
(python-mode . atu/pyls-set-jedi-environment)
|
||||
;(python-mode . atu/activate-flycheck)
|
||||
;(python-mode . atu/append-workspace-extra-paths)
|
||||
(lsp-managed-mode . atu/flycheck-set-python-paths)
|
||||
)
|
||||
|
||||
|
||||
|
||||
(use-package blacken
|
||||
:commands blacken-mode blacken-buffer
|
||||
:hook
|
||||
(python-mode . blacken-mode)
|
||||
)
|
||||
|
||||
(use-package py-isort
|
||||
:commands py-isort-buffer
|
||||
:hook
|
||||
(python-mode . (lambda ()
|
||||
(add-hook 'before-save-hook 'py-isort-before-save)))
|
||||
)
|
||||
|
||||
|
||||
(add-to-list 'auto-mode-alist '("\\.h\\'" . c-c++-header))
|
||||
|
||||
(defconst tuleu-cc-style
|
||||
'("gnu"
|
||||
(c-offsets-alist . ((innamespace . [0])))
|
||||
)
|
||||
)
|
||||
(c-add-style "tuleu-c++" tuleu-cc-style)
|
||||
|
||||
(defun my-c-common-hook ()
|
||||
(global-set-key (kbd "C-c C-h") 'ff-find-other-file)
|
||||
(require 'compile)
|
||||
(global-set-key (kbd "C-x f") 'find-file-at-point)
|
||||
(c-set-offset 'inextern-lang 0)
|
||||
(eval-after-load 'company
|
||||
'(add-to-list
|
||||
'company-backends
|
||||
'(company-irony company-irony-c-headers company-yasnippet)))
|
||||
(smart-tabs-mode)
|
||||
(irony-mode)
|
||||
(yas-minor-mode-on)
|
||||
(company-irony-setup-begin-commands)
|
||||
(irony-cdb-autosetup-compile-options)
|
||||
)
|
||||
(add-hook 'c-mode-common-hook 'my-c-common-hook)
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; TeX/LaTeX
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;; (use-package auctex
|
||||
;; :hook (LaTeX-mode TeX-mode)
|
||||
;; )
|
||||
|
||||
;; (use-package auctex-latexmk
|
||||
;; :hook (LaTeX-mode TeX-mode)
|
||||
;; :bind (
|
||||
;; ("C-x f" . find-file-at-point)
|
||||
;; :map LaTeX-mode-map
|
||||
;; ([remap reftex-citation] . my-latex-insert-cite)
|
||||
;; ("M-q" . my-latex-fill-paragraph)
|
||||
;; )
|
||||
;; :config (
|
||||
;; (add-to-list 'TeX-command-list
|
||||
;; '("latexmk" "latexmk -pdf -interaction=nonstopmode -shell-escape %s" TeX-run-TeX nil t
|
||||
;; :help "Run latexmk on file"))
|
||||
;; (setq TeX-command-default "latexmk")
|
||||
;; (setq LaTeX-includegraphics-read-file 'LaTeX-includegraphics-read-file-relative)
|
||||
;; (setq LaTeX-includegraphics-strip-extension-flag nil)
|
||||
;; (add-to-list 'LaTeX-includegraphics-extensions '"tikz")
|
||||
;; ;; use Okular as default pdf viewer
|
||||
;; (setq TeX-view-program-selection '((output-pdf "Okular PDF Viewer")))
|
||||
;; (add-to-list 'TeX-expand-list '("%(dir)" (lambda nil (expand-file-name (TeX-master-directory)))))
|
||||
;; (setq TeX-view-program-list
|
||||
;; '(("Okular PDF Viewer" "okular --unique %o#src:%n%(dir)./%b")))
|
||||
;; ;; (setq auctex-latexmk-inherit-TeX-PDF-mode t)
|
||||
;; ;; launch server if not launched
|
||||
;; (load "server")
|
||||
;; (unless (server-running-p) (server-start))
|
||||
;; (setq reftex-plug-into-AUCTeX t)
|
||||
|
||||
;; (turn-on-reftex)
|
||||
;; (setq TeX-parse-self t)
|
||||
;; (setq TeX-auto-save t)
|
||||
;; (TeX-PDF-mode)
|
||||
;; (setq reftex-ref-macro-prompt nil)
|
||||
;; (defun my-latex-insert-cite (&optional P)
|
||||
;; ""
|
||||
;; (interactive "P")
|
||||
;; (TeX-insert-macro "cite")
|
||||
;; )
|
||||
;; (setq-default TeX-master nil)
|
||||
;; (defun my-latex-fill-paragraph (&optional P)
|
||||
;; "When called with prefix argument call `fill-paragraph'.
|
||||
;; Otherwise split the current paragraph into one sentence per line."
|
||||
;; (interactive "P")
|
||||
;; (if (not P)
|
||||
;; (save-excursion
|
||||
;; (let ((fill-column 12345678)) ;; relies on dynamic binding
|
||||
;; (fill-paragraph) ;; this will not work correctly if the paragraph is
|
||||
;; ;; longer than 12345678 characters (in which case the
|
||||
;; ;; file must be at least 12MB long. This is unlikely.)
|
||||
;; (let ((end (save-excursion
|
||||
;; (forward-paragraph 1)
|
||||
;; (backward-sentence)
|
||||
;; (point-marker)))) ;; remember where to stop
|
||||
;; (beginning-of-line)
|
||||
;; (while (progn (forward-sentence)
|
||||
;; (<= (point) (marker-position end)))
|
||||
;; (just-one-space) ;; leaves only one space, point is after it
|
||||
;; (delete-char -1) ;; delete the space
|
||||
;; (insert " %");; insert a %
|
||||
;; (newline) ;; and insert a newline
|
||||
;; (LaTeX-indent-line) ;; I only use this in combination with late, so this makes sense
|
||||
;; ))))
|
||||
;; ;; otherwise do ordinary fill paragraph
|
||||
;; (fill-paragraph P))
|
||||
;; )
|
||||
;; )
|
||||
;; )
|
||||
|
||||
|
||||
(use-package markdown-mode)
|
||||
|
||||
(use-package go-mode
|
||||
:after (projectile)
|
||||
(use-package elpy
|
||||
:init
|
||||
(elpy-enable)
|
||||
(setenv "WORKON_HOME" (concat (getenv "HOME") "/miniconda3/envs"))
|
||||
:config
|
||||
(unbind-key "C-c C-d" go-mode-map)
|
||||
(defun go-compile-command ()
|
||||
"returns a string to compile a go project"
|
||||
(setq project-makefile (concat (file-name-as-directory (projectile-project-root)) "Makefile"))
|
||||
(if (file-exists-p project-makefile)
|
||||
"make"
|
||||
"go build && go test && go vet"
|
||||
(add-hook 'elpy-mode-hook (lambda ()
|
||||
(add-hook 'before-save-hook
|
||||
'elpy-format-code nil t)))
|
||||
)
|
||||
|
||||
(use-package go-mode
|
||||
:config
|
||||
(use-package company-go)
|
||||
(use-package flymake-go)
|
||||
(setq gofmt-command "goimports")
|
||||
(add-hook 'before-save-hook 'gofmt-before-save)
|
||||
(set (make-local-variable 'company-backends) '(company-go))
|
||||
(flymake-mode)
|
||||
(setq compile-command "go build && go test -coverprofile=cover.out && go tool cover -html cover.out -o /tmp/cover.html")
|
||||
:bind (
|
||||
("C-c C-h" . godef-describe)
|
||||
("C-c C-j" . godef-jump)
|
||||
)
|
||||
(projectile-update-project-type
|
||||
'go
|
||||
:compile 'go-compile-command)
|
||||
:hook
|
||||
(go-mode . lsp-deferred)
|
||||
(go-mode . (lambda ()
|
||||
(add-hook 'before-save-hook #'lsp-format-buffer t t)
|
||||
(add-hook 'before-save-hook #'lsp-organize-imports t t)
|
||||
))
|
||||
)
|
||||
|
||||
(use-package glsl-mode)
|
||||
(use-package opencl-mode)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Protobuf
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(use-package protobuf-mode
|
||||
:mode "\\.proto\\'"
|
||||
:config
|
||||
@@ -576,49 +343,93 @@
|
||||
'((c-basic-offset . 4)
|
||||
(indent-tabs-mode . t))
|
||||
)
|
||||
;; (c-add-style "my-style" my-protobuf-style t)
|
||||
(c-add-style "my-style" my-protobuf-style t)
|
||||
)
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Typescript
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;l
|
||||
|
||||
(use-package typescript-mode
|
||||
:config
|
||||
(progn
|
||||
:config (progn
|
||||
(setq create-lockfiles nil)
|
||||
(add-to-list 'compilation-error-regexp-alist '("^Error: \\(.*?\\):\\([0-9]+\\):\\([0-9]+\\)" 1 2 3))
|
||||
)
|
||||
)
|
||||
|
||||
(use-package json-mode)
|
||||
|
||||
(use-package prettier
|
||||
:delight "PR"
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Language tool
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(use-package langtool
|
||||
:config (progn
|
||||
(setq langtool-language-tool-server-jar "~/.languagetool/languagetool-server.jar")
|
||||
(setq langtool-default-language "en-US")
|
||||
)
|
||||
:bind(
|
||||
("C-c l c" . langtool-check)
|
||||
("C-c l d" . langtool-check-done)
|
||||
("C-c l l" . langtool-switch-default-language)
|
||||
("C-c l s" . langtool-show-message-at-point)
|
||||
("C-c l b" . langtool-correct-buffer)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; After Init
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
(use-package zenburn-theme
|
||||
:config
|
||||
(setq prettier-mode-sync-config-flag t)
|
||||
:hook
|
||||
(web-mode . prettier-mode)
|
||||
(typescript-mode . prettier-mode)
|
||||
(js-mode . prettier-mode)
|
||||
(setq zenburn-override-colors-alist
|
||||
'(
|
||||
;; ("zenburn-bg-2" . "#000000")
|
||||
;; ("zenburn-bg-1" . "#2B2B2B")
|
||||
("zenburn-bg-1" . "#151515")
|
||||
;; ("zenburn-bg-08" . "#303030")
|
||||
("zenburn-bg-08" . "#1a1a1a")
|
||||
;; ("zenburn-bg-05" . "#383838")
|
||||
("zenburn-bg-05" . "#202020")
|
||||
;;("zenburn-bg" . "#3F3F3F")
|
||||
("zenburn-bg" . "#2b2b2b")
|
||||
;; ("zenburn-bg+05" . "#494949")
|
||||
("zenburn-bg+05" . "#393939")
|
||||
;; ("zenburn-bg+1" . "#4F4F4F")
|
||||
("zenburn-bg+1" . "#3F3F3F")
|
||||
;; ("zenburn-bg+2" . "#5F5F5F")
|
||||
("zenburn-bg+2" . "#4F4F4F")
|
||||
;; ("zenburn-bg+3" . "#6F6F6F")
|
||||
("zenburn-bg+3" . "#5F5F5F")
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(use-package web-mode
|
||||
:mode "\\.html?\\'" "\\.svelte\\'" "\\.\\(post\\)?css\\'"
|
||||
:interpreter "html" "css" "svelte"
|
||||
:config
|
||||
(setq web-mode-content-types-alist
|
||||
'(("css" . "\\.\\(post\\)?css\\'")))
|
||||
:hook
|
||||
(web-mode . lsp-deferred)
|
||||
(load-theme 'zenburn t)
|
||||
(zenburn-with-color-variables
|
||||
(custom-theme-set-faces
|
||||
'zenburn
|
||||
`(whitespace-space ((t (:background ,zenburn-bg :foreground ,zenburn-bg))))
|
||||
`(whitespace-hspace ((t (:background ,zenburn-bg+1 :foreground ,zenburn-bg+1))))
|
||||
`(whitespace-tab ((t (:foreground ,zenburn-bg+3))))
|
||||
`(whitespace-newline ((t (:foreground ,zenburn-bg+1))))
|
||||
`(whitespace-trailing ((t (:background ,zenburn-red))))
|
||||
`(whitespace-line ((t (:background ,zenburn-bg :foreground ,zenburn-magenta))))
|
||||
`(whitespace-space-before-tab ((t (:background ,zenburn-orange :foreground ,zenburn-orange))))
|
||||
`(whitespace-indentation ((t (:background ,zenburn-bg+1))))
|
||||
`(whitespace-empty ((t (:background ,zenburn-bg+1))))
|
||||
`(whitespace-space-after-tab ((t (:background ,zenburn-bg+1 :foreground ,zenburn-red))))
|
||||
`(font-lock-type-face ((t (:foreground ,zenburn-blue+1))))
|
||||
)
|
||||
|
||||
|
||||
(use-package dockerfile-mode
|
||||
:hook
|
||||
(dockerfile-mode . lsp-deferred)
|
||||
(global-whitespace-mode 1)
|
||||
)
|
||||
)
|
||||
(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.
|
||||
)
|
||||
|
||||
|
||||
|
||||
;; Local Variables:
|
||||
;; vc-follow-symlinks: t
|
||||
|
||||
@@ -230,7 +230,7 @@ tmux_conf_theme_right_separator_sub='\uE0B3' # PowerlineSymbols.otf font, see
|
||||
# - #{username}
|
||||
# - #{username_ssh}
|
||||
tmux_conf_theme_status_left=" ❐ #S "
|
||||
tmux_conf_theme_status_right=" #{prefix}#{pairing}#{synchronized} ,#{?battery_status,#{battery_status},}#{?battery_vbar, #{battery_vbar},}#{?battery_percentage, #{battery_percentage}, } #{weather} #{cpu_fg_color} #{cpu_percentage} #{ram_fg_color} #{ram_percentage} #{cpu_temp_fg_color}#{cpu_temp_icon}#{cpu_temp} , %R , %d %b |#{root}"
|
||||
tmux_conf_theme_status_right=" #{prefix}#{pairing}#{synchronized} ,#{?battery_status,#{battery_status},}#{?battery_vbar, #{battery_vbar},}#{?battery_percentage, #{battery_percentage}, } #{weather} #{cpu_fg_color} #{cpu_percentage} #{ram_fg_color} #{ram_percentage} #{cpu_temp_fg_color}#{cpu_temp_icon}#{cpu_temp} , %R , %d %b |#{root}"
|
||||
|
||||
# status left style
|
||||
tmux_conf_theme_status_left_fg="$tmux_conf_theme_colour_6,$tmux_conf_theme_colour_7,$tmux_conf_theme_colour_8"
|
||||
@@ -341,11 +341,11 @@ tmux_conf_copy_to_os_clipboard=false
|
||||
#set -g mode-keys vi
|
||||
|
||||
# replace C-b by C-a instead of using both prefixes
|
||||
set -gu prefix2
|
||||
unbind C-a
|
||||
unbind C-b
|
||||
set -g prefix C-\\
|
||||
bind C-\\ send-prefix
|
||||
# set -gu prefix2
|
||||
# unbind C-a
|
||||
# unbind C-b
|
||||
# set -g prefix C-a
|
||||
# bind C-a send-prefix
|
||||
|
||||
# move status line to top
|
||||
#set -g status-position top
|
||||
|
||||
24
README.md
24
README.md
@@ -1,24 +0,0 @@
|
||||
# Personnal configuration
|
||||
|
||||
## Installation
|
||||
You can install this configuration on a new system using
|
||||
|
||||
```bash
|
||||
curl -sSL https://git.tuleu.science/atuleu/home/raw/branch/master/update.sh | bash && $HOME/.home/update.sh
|
||||
```
|
||||
|
||||
## Keeping it synced
|
||||
|
||||
You can then update the configuration with:
|
||||
|
||||
```bash
|
||||
$HOME/.home/update.sh
|
||||
```
|
||||
|
||||
On a GNOME environment you may want to:
|
||||
|
||||
```bash
|
||||
$HOME/.home/update.sh --gnome
|
||||
```
|
||||
|
||||
This will install necessary fonts and makes GNOME terminal actually looks good.
|
||||
@@ -3,7 +3,7 @@ background-color='rgb(40,42,46)'
|
||||
background-transparency-percent=21
|
||||
bold-color-same-as-fg=true
|
||||
custom-command='env TERM=xterm-direct /usr/bin/fish'
|
||||
font='UbuntuMono Nerd Font Mono 11'
|
||||
font='UbuntuMono Nerd Font 11'
|
||||
foreground-color='rgb(197,200,198)'
|
||||
login-shell=false
|
||||
palette=['rgb(40,42,46)', 'rgb(204,102,102)', 'rgb(181,189,104)', 'rgb(240,198,116)', 'rgb(129,162,190)', 'rgb(178,148,187)', 'rgb(138,190,183)', 'rgb(150,152,150)', 'rgb(55,59,65)', 'rgb(255,153,153)', 'rgb(229,237,152)', 'rgb(255,246,164)', 'rgb(177,210,238)', 'rgb(226,196,235)', 'rgb(186,238,231)', 'rgb(197,200,198)']
|
||||
|
||||
280
update.sh
280
update.sh
@@ -2,100 +2,6 @@
|
||||
|
||||
set -e
|
||||
|
||||
function print_help() {
|
||||
echo "usage .home/update.sh [-g/--gnome] [-h/--help] [-v/--berbose] [-d/--dry]
|
||||
|
||||
Installs and updates shared configuration on a system. Options are:
|
||||
|
||||
-h/--help : print this help
|
||||
--reinstall : force reinstallation
|
||||
-g/--gnome : system is intended to run in a GNOME environement, and
|
||||
will setup gnome-terminal accordingly. Do not
|
||||
activate on headless system.
|
||||
--font : Installs font for gnome environment (selected if --gnome)
|
||||
-v/--verbose : prints command before running them
|
||||
-n/--dry : dry run, do not execute commands. Implies --verbose.
|
||||
"
|
||||
}
|
||||
|
||||
function exit_error() {
|
||||
print_help
|
||||
exit 1
|
||||
}
|
||||
|
||||
GNOME=false
|
||||
FONT=false
|
||||
VERBOSE=false
|
||||
DRY=false
|
||||
REINSTALL=false
|
||||
|
||||
function set_reinstall_on() {
|
||||
REINSTALL=true
|
||||
}
|
||||
|
||||
function set_gnome_on() {
|
||||
GNOME=true
|
||||
FONT=true
|
||||
}
|
||||
|
||||
function set_font_on() {
|
||||
FONT=true
|
||||
}
|
||||
|
||||
function set_verbose_on() {
|
||||
VERBOSE=true
|
||||
}
|
||||
|
||||
function set_dry_on() {
|
||||
DRY=true
|
||||
VERBOSE=true
|
||||
}
|
||||
|
||||
while getopts "vnhg-:" optchar
|
||||
do
|
||||
case "${optchar}" in
|
||||
-)
|
||||
case "${OPTARG}" in
|
||||
reinstall)
|
||||
set_reinstall_on
|
||||
;;
|
||||
gnome)
|
||||
set_gnome_on
|
||||
;;
|
||||
verbose)
|
||||
set_verbose_on
|
||||
;;
|
||||
font)
|
||||
set_font_on
|
||||
;;
|
||||
dry)
|
||||
set_dry_on
|
||||
;;
|
||||
*)
|
||||
echo "invalid argument --${OPTARG}"
|
||||
exit_error
|
||||
;;
|
||||
esac;;
|
||||
h)
|
||||
print_help
|
||||
exit 0
|
||||
;;
|
||||
g)
|
||||
set_gnome_on
|
||||
;;
|
||||
n)
|
||||
set_dry_on
|
||||
;;
|
||||
v)
|
||||
set_verbose_on
|
||||
;;
|
||||
*)
|
||||
exit_error
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
files=".config/fish \
|
||||
.config/git \
|
||||
.config/omf \
|
||||
@@ -105,145 +11,20 @@ files=".config/fish \
|
||||
.tmux.conf.local"
|
||||
|
||||
|
||||
|
||||
|
||||
function this_script_root_dir() {
|
||||
dirname $(realpath ${BASH_SOURCE[0]})
|
||||
}
|
||||
|
||||
function run() {
|
||||
if $VERBOSE
|
||||
then
|
||||
echo "[$@]"
|
||||
fi
|
||||
if ! $DRY
|
||||
then
|
||||
echo "$@"
|
||||
$@
|
||||
fi
|
||||
}
|
||||
|
||||
function run_git() {
|
||||
if $VERBOSE
|
||||
then
|
||||
echo "[git $@] in $(this_script_root_dir)"
|
||||
fi
|
||||
if ! $DRY
|
||||
then
|
||||
pushd $(this_script_root_dir) 1>/dev/null
|
||||
if $VERBOSE
|
||||
then
|
||||
git $@
|
||||
else
|
||||
git $@ 1>/dev/null
|
||||
fi
|
||||
popd 1>/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
function load_gnome_terminal_profiles() {
|
||||
echo "--- Installing GNOME terminal profile"
|
||||
if which dconf 1>/dev/null
|
||||
then
|
||||
run dconf load /org/gnome/terminal/legacy/profiles:/ < $(this_script_root_dir)/gnome-terminal-profiles.dconf
|
||||
fi
|
||||
}
|
||||
|
||||
function install_fish() {
|
||||
echo "--- Ensuring fish is current shell"
|
||||
if ! which fish 1>/dev/null
|
||||
then
|
||||
echo "+++ Installing fish"
|
||||
run sudo apt-get install -y fish
|
||||
else
|
||||
echo "+++ Fish is installed"
|
||||
fi
|
||||
|
||||
fish=$(which fish)
|
||||
current_shell=$(grep $USER /etc/passwd | cut -d ":" -f 7)
|
||||
if [ $current_shell != $fish ]
|
||||
then
|
||||
echo "+++ Changing shell to $fish (you will be prompted for passwd)"
|
||||
run chsh -s $fish
|
||||
else
|
||||
echo "+++ Default shell is $fish"
|
||||
fi
|
||||
}
|
||||
|
||||
function install_direnv() {
|
||||
echo "--- Ensuring direnv is installed"
|
||||
if ! which direnv 1>/dev/null
|
||||
then
|
||||
echo "++ Installing direnv"
|
||||
run sudo apt-get install -y direnv
|
||||
else
|
||||
echo "+++ direnv is installed"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
function install_starship() {
|
||||
echo "--- Ensuring starship is installed"
|
||||
if which starship 1>/dev/null
|
||||
then
|
||||
echo "+++ Starship is installed"
|
||||
if ! $REINSTALL
|
||||
then
|
||||
return
|
||||
fi
|
||||
echo "+++ Reinstalling starship"
|
||||
fi
|
||||
echo "+++ Installing starship"
|
||||
if $VERBOSE
|
||||
then
|
||||
echo "[curl -sS https://starship.rs/install.sh | sh -s -- --yes]"
|
||||
fi
|
||||
if ! $DRY
|
||||
then
|
||||
curl -sS https://starship.rs/install.sh | sh -s -- --yes
|
||||
fi
|
||||
}
|
||||
|
||||
function install_ubuntu_mono_nerd() {
|
||||
echo "--- Ensuring Ubuntu Mono Nerd font is present"
|
||||
if [ ! -e /usr/share/terminfo/x/xterm-direct ]
|
||||
then
|
||||
run sudo apt-get install -y ncurses-term
|
||||
else
|
||||
echo "+++ xterm-direct is in terminfo database"
|
||||
fi
|
||||
|
||||
if fc-list | grep "UbuntuMono Nerd Font" 1>/dev/null
|
||||
then
|
||||
echo "+++ UbuntuMono Nerd font is installed"
|
||||
if ! $REINSTALL
|
||||
then
|
||||
return
|
||||
fi
|
||||
echo "+++ Reinstalling UbuntuMono Nerd font"
|
||||
fi
|
||||
|
||||
echo "+++ Fetching UbuntuMono Nerd Font"
|
||||
run mkdir -p ~/.local/share/fonts
|
||||
pushd ~/.local/share/fonts
|
||||
run curl -fL -o UbuntuMonoNerdFontMono-Regular.ttf https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/UbuntuMono/Regular/UbuntuMonoNerdFontMono-Regular.ttf
|
||||
popd
|
||||
run fc-cache -f
|
||||
|
||||
}
|
||||
|
||||
function install_deps() {
|
||||
install_fish
|
||||
install_direnv
|
||||
install_starship
|
||||
if $FONT
|
||||
then
|
||||
install_ubuntu_mono_nerd
|
||||
fi
|
||||
}
|
||||
|
||||
function install_files() {
|
||||
echo "--- Ensuring symlinks to git file are present"
|
||||
function install_home() {
|
||||
for f in $files
|
||||
do
|
||||
run rm -Rf $HOME/$f
|
||||
@@ -255,58 +36,13 @@ function install_files() {
|
||||
run ln -sf $(this_script_root_dir)/$f $HOME/$f
|
||||
done
|
||||
run ln -sf $(this_script_root_dir)/.tmux/.tmux.conf $HOME/.tmux.conf
|
||||
}
|
||||
|
||||
function update_oh_my_fish() {
|
||||
echo "--- Updating Oh My Fish"
|
||||
FISH=$(which fish)
|
||||
if $VERBOSE
|
||||
then
|
||||
echo "[$FISH -c 'omf install']"
|
||||
fi
|
||||
if ! $DRY
|
||||
then
|
||||
if $VERBOSE
|
||||
then
|
||||
$FISH -c 'omf install'
|
||||
else
|
||||
$FISH -c 'omf install' 1>/dev/null
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function update_home() {
|
||||
if $VERBOSE
|
||||
then
|
||||
echo "--- this_script_root_dir: $(this_script_root_dir)"
|
||||
fi
|
||||
update_repos
|
||||
install_deps
|
||||
install_files
|
||||
update_oh_my_fish
|
||||
if $GNOME
|
||||
then
|
||||
load_gnome_terminal_profiles
|
||||
fi
|
||||
if ! $DRY
|
||||
then
|
||||
echo "--- git.tuleu.science:atuleu/home.git updated and set"
|
||||
fi
|
||||
}
|
||||
|
||||
function update_repos() {
|
||||
echo "--- Updating git.tuleu.science:atuleu/home.git"
|
||||
run_git pull
|
||||
run_git submodule init
|
||||
run_git submodule update
|
||||
}
|
||||
|
||||
if [ -z $BASH_SOURCE ] && [ ! -d "$HOME/.home" ]
|
||||
then
|
||||
echo "--- cloning git.tuleu.science:atuleu/home.git in $HOME/.home"
|
||||
pushd $HOME 1>/dev/null
|
||||
run_git clone https://git.tuleu.science/atuleu/home.git .home
|
||||
popd 1>/dev/null
|
||||
else
|
||||
update_home
|
||||
fi
|
||||
pushd $(this_script_root_dir)
|
||||
git pull
|
||||
git submodule init
|
||||
git submodule update
|
||||
popd
|
||||
install_home
|
||||
|
||||
Reference in New Issue
Block a user