vimの設定

今気に入っているvimの設定をメモしておきます。最近はoverleafでvimの編集モードを使っているのですが、ノーマルのvimを使うのも悪くないと思っています。新しい環境でvimを使う時には、さくっと最低限の設定だけしてメインの作業に入りたいですね。

私的には、最低限:imap jj <ESC>さえあれば、満足できます。overleafでも、これだけは使っています。ただ、イテレータにjを使うときには、一気に作業しづらくなります、、

set number
set cursorline
syntax enable
set hlsearch
set incsearch
set smartindent
set visualbell
set virtualedit=onemore
set ignorecase
set smartcase
set expandtab
set autoindent
set ruler

set statusline=%F
set statusline+=%=
set statusline+=[Encode=%{&fileencoding}]
set statusline+=[Low=%l/%L]
set laststatus=2

imap jj <ESC>

#以下deinの設定
if &compatible
  set nocompatible               " Be iMproved
endif

set runtimepath+=/home/user_name/.cache/dein/repos/github.com/Shougo/dein.vim
call dein#begin('/home/user_name/.cache/dein')
call dein#add('/home/user_name/.cache/dein/repos/github.com/Shougo/dein.vim')
call dein#add('itchyny/lightline.vim')
call dein#end()
filetype plugin indent on
syntax enable

listとnumpy.ndarrayの追加・結合の操作

たまに混同します.
これくらいは、さっさと覚えたいですね。

list末尾への追加・結合操作

要素を追加: append()
リストやタプルを結合: extend(), +演算子

numpy.ndarrayへの追加操作

numpy.append(arr, values, axis=None)
numpy.append — NumPy v1.23 Manual

numpy.ndarrayへの結合操作

numpy.concatenate((a1, a2, ...), axis=0)
numpy.concatenate — NumPy v1.23 Manual

numpy.vstack(tup)
numpy.hstack(tup)

ubuntuにArialフォントを導入する

Ubuntu にArialを入れて、matplotlibで使えるようにする方法をメモします。

ついでに、他のフォントも同時に入れてしまいます。

mkdir ~/ms-fonts/

cd ~/ms-fonts/

wget http://downloads.sourceforge.net/corefonts/arial32.exe
wget http://downloads.sourceforge.net/corefonts/arialb32.exe
***不要ならスキップ
wget http://downloads.sourceforge.net/corefonts/andale32.exe
wget http://downloads.sourceforge.net/corefonts/comic32.exe
wget http://downloads.sourceforge.net/corefonts/courie32.exe
wget http://downloads.sourceforge.net/corefonts/georgi32.exe
wget http://downloads.sourceforge.net/corefonts/impact32.exe
wget http://downloads.sourceforge.net/corefonts/times32.exe
wget http://downloads.sourceforge.net/corefonts/trebuc32.exe
wget http://downloads.sourceforge.net/corefonts/verdan32.exe
wget http://downloads.sourceforge.net/corefonts/webdin32.exe
***
sudo dpkg-reconfigure ttf-mscorefonts-installer
sudo fc-cache


キャッシュを削除します。(python - Matplotlib cannot find basic fonts - Stack Overflow)

rm ~/.cache/matplotlib/*

動作テスト

sudo fc-match Arial

OSのアップデートは一つの方法で行いましょう。

先日までpop os 21.10を使っていました。system76から22.04が出てるよというメッセージを受け取ったので、GUIのアップデートボタンを押しました。その後、ステータスがしばらく変わらず、(なにを思ったのか)terminalからpop-upgrade release upgrade を走らせてしまいました。

dpkgまわりでなにか衝突が起こったらしく、音が出なくなったり不具合が色々とでてきます。。。

忙しかったので(先人の知恵を試すのも面倒くさくなってきたので)、OSを入れ直そうと考えていました。インストールメディアを作って、メディアから起動するとユーザーとファイルを保ったままOSを入れ直すオプションがあるではないですか!

 

ということで、先人の知恵では身動きできないときには、インストールメディアから起動して、OSを修復(?)しましょう。または、OSの勉強をしましょう。