fortran-language-server & lsp-mode

Emacs configuration

(use-package lsp-mode
  :ensure t
  :mode (("\\.F90\\'"  . f90-mode)
         ("\\.f03\\'"  . f90-mode)
         ("\\.fpp\\'"  . f90-mode)
         ("\\.pf\\'"  . f90-mode)
         ("\\.F\\'"  . f90-mode)
         ("\\.f\\'"  . f90-mode)
         ("\\.inc\\'"  . f90-mode))
  :hook ((python-mode . lsp)
         (f90-mode . lsp)
         (lsp-mode . lsp-enable-which-key-integration))
  :commands lsp
  :custom (
           (lsp-headerline-breadcrumb-enable t)
           (lsp-modeline-code-actions-enable nil))
)

.fortls is located at the project root.

{
  "source_dirs": ["src"],
  "excl_paths": ["build"],
  "pp_suffixes": [".F"],
  "pp_defs": {"SOME_MACRO": ""},
  "debug_log": true
}

To make dumb-jump case-insensitive

I am reading a mixed-case fortran source-code. In my environment, dumb-jump can not jump from uppercase subroutine call to the lower case definition (and vise-versa). In dumb-jump, the word currently being looked for (e.g. the word on which dumb-jump-go is invoked) is stored in the look-for variable in the dumb-jump-fetch-results function.

To enable the mixed case dumb-jump-go, to ignore case, I did two things.

(1) Modify the following line from

         (look-for (dumb-jump-process-symbol-by-lang lang found-symbol))

to

         (look-for (downcase (dumb-jump-process-symbol-by-lang lang found-symbol)))

(2) Add an rg option --ignore-care by dumb-jump-rg-search-args,

(use-package dumb-jump
  :ensure t
  :config
  (setq dumb-jump-force-searcher 'rg)
  (setq dumb-jump-rg-search-args "--ignore-case --pcre2")
  (setq dumb-jump-selector 'ivy)
  :init
  (add-hook 'xref-backend-functions #'dumb-jump-xref-activate)
)

Emacs 24bit colors on tmux

Setting up truecolor (24 bit color) in emacs in the terminal, under iTerm2, blink.sh, and others. · GitHub (install-terminfo-xterm-24bit.bash @localhost, @remotehost)

How to display 24-bit color in Emacs on tmux(Others-Community)

locahost% TERM=xterm-24bits ssh remotehost
remotehost% tmux
remotehost% emacs -nw

.tmux.conf (@localhost, @remotehost)

set -g default-terminal "xterm-24bits"
set-option -ga terminal-overrides ",xterm-24bits:Tc"

.zshenv (@localhost, @remotehost)

export TERM=xterm-24bits

dircolors (@localhost, @remotehost)

TERM xterm-24bits

Manim

最近YouTubeで3Blue1Brownをを見る機会が増えた。3Blue1Brownをpythonで描けるということを次の記事で知った。

Pythonで美しい動画を作ろう - Qiita

早速macOS big sur上にインストールしてた。以下メモ。

  • conda
  • cairoはbrewで入っている。ffmpegは無い。
% conda create -n manim -c conda-forge python=3.8
% conda install -c conda-forge ffmpeg
% mkdir manim && cd manim
% git clone https://github.com/ManimCommunity/manim.git
% cd manim
% pip install .
% cd ..
% mkdir project && cd project

Manimのcommit-hashは0dccec95.

https://github.com/ManimCommunity/manimのUsageをexample.pyとして保存。

% manim example.py SquareToCircle -p -ql

とすると、アニメーションが生成されてQuickTime Playerが開く。

VMWareからVirtualBox

複数に分かれているイメージファイルを一つにする。

Converting Multiple VMware disk image to single disk image - Server Fault

ストレージデバイスなしで新しいVirtualBox VMを作って、VMWareイメージをIDEで接続する。

ゲストのディスプレイの解像度に関しては

  1. ”enable 3D Acceleration"をオンにする。
  2. ゲストのビデオメモリ量を大きくする。
  3. View -> Virtual Screen 1 -> Scale to 200%

How to run a virtual machine in VirtualBox with a custom resolution (3840x2160) | Our Code World

結局Emacsを辞められない

vscodeをチラチラ眺めながらも、結局emacsが辞められない。遺産がそれほどあるわけでもない。むしろemacsがどんどん使いやすくなっていくし、キーバインドに不満もないので辞められない。人に勧められないのが残念(良い解説を見つけた↓)。

2020年代のEmacs入門 | Emacs JP

GitHub - daviwil/emacs-from-scratch: An example of a fully custom Emacs configuration developed live on YouTube!

lsp-mode LSP Mode - Language Server Protocol support for Emacs - LSP Mode - LSP support for Emacs

M-x customize-group RET lsp-pyls RET

少しlispの文法がわかると良いかな。勉強。 Lisp一夜漬け