1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

個人的Ubuntuインストール直後にやるべきこと

Last updated at Posted at 2022-04-29

はじめに

色々なところでUbuntuを使う機会が増えたので, OSを入れた時に自分が見るための覚書も兼ねて, 個人的に必須な環境構築等をまとめておきます.

入れておきたいヤツたち

terminator

sudo apt install terminator

カスタマイズ性が高いターミナル. 背景を透過させられるのが便利.

plank

sudo apt install plank

MacのDockみたいなやつ.

tweaks

sudo add-apt-repository universe
sudo apt install gnome-tweak-tool

各種カスタマイズ.
Windows/Attach Modal Dialogs と Windows/Edge Tiling は無効化したい.
Startup Applications に terminator, plank を追加したい.

curl

sudo apt install curl

httpリクエストを送る. cuiで色々な設定を完結させるために今後よく使う.

vscode

curl -L https://go.microsoft.com/fwlink/?LinkID=760868 -o vscode.deb
sudo apt install ./vscode.deb

エディタ. まあ必要だよねという感じ.

個人的必須拡張機能

  • Bracket Pair (CoenraadS.bracket-pair-colorizer-2)
  • Draw.io Integration (hediet.vscode-drawio)
  • Drai.io Integration:Mermaid plugin(nopeslide.vscode-drawio-plugin-mermaid)
  • Markdown All in One (yzhang.markdown-all-in-one)
  • Maikdown Checkbox (PKief.markdown-checkbox)
  • Markdown PDF (yzane.markdown-pdf)
  • Marp for VS Code (marp-team.marp-vscode)
  • Remote - SSH (ms-vscode-remote.remote-ssh)
  • Remote - SSH: Editing Configuration Files (ms-vscode-remote.remote-ssh-edit)
  • SVG Viewer (cssho.vscode-svgviewer)

設定とかの移行に, VSCodeのSync機能を有効化する(デバイス間でショートカットキーや設定, 拡張機能などを同期できる).

vim

sudo apt install vim

ぱぱっとターミナル上でテキスト編集したい時に重宝. Hugeを使いたい.
あとで設定ファイル書く.

docker&docker-compose

sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
apt-cache policy docker-ce
sudo apt install docker-ce
sudo usermod -aG docker ${USER}
su - ${USER}
groups
sudo usermod -aG docker ${USER}


sudo curl -L "https://github.com/docker/compose/releases/download/1.26.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

xsel

sudo apt intall xsel

コマンドでパイプしてコピペできるやつ.

ThunderBird

sudo apt install thunderbird

メーラー.

gThumb

sudo apt install gthumb

画像ビューアー.

Vivaldi

wget -qO- https://repo.vivaldi.com/archive/linux_signing_key.pub | sudo apt-key add -
sudo add-apt-repository 'deb https://repo.vivaldi.com/archive/deb/ stable main'
sudo apt update && sudo apt install vivaldi-stable

https://vivaldi.com/ja/download/
ブラウザ.

拡張機能

slack

sudo snap install slack

各所のコミュニケーションで必須なので.

mozc設定gui

sudo apt install mozc-utils-gui

mac風の日本語/英語切り替えの設定のため.
再起動後にmozc/Tools/Properties/Keymap/Keymap StyleをCustom keymapにして, 以下をインポート.

keymap.txt
status	key	command
Composition	Backspace	Backspace
Composition	Ctrl a	MoveCursorToBeginning
Composition	Ctrl Backspace	Backspace
Composition	Ctrl d	MoveCursorRight
Composition	Ctrl Down	MoveCursorToEnd
Composition	Ctrl e	MoveCursorToBeginning
Composition	Ctrl Enter	Commit
Composition	Ctrl f	MoveCursorToEnd
Composition	Ctrl g	Delete
Composition	Ctrl h	Backspace
Composition	Ctrl i	ConvertToFullKatakana
Composition	Ctrl k	MoveCursorLeft
Composition	Ctrl l	MoveCursorRight
Composition	Ctrl Left	MoveCursorToBeginning
Composition	Ctrl m	Commit
Composition	Ctrl n	MoveCursorToEnd
Composition	Ctrl o	ConvertToHalfWidth
Composition	Ctrl p	ConvertToFullAlphanumeric
Composition	Ctrl Right	MoveCursorToEnd
Composition	Ctrl s	MoveCursorLeft
Composition	Ctrl Shift Space	InsertFullSpace
Composition	Ctrl Space	InsertHalfSpace
Composition	Ctrl t	ConvertToHalfAlphanumeric
Composition	Ctrl u	ConvertToHiragana
Composition	Ctrl Up	MoveCursorToBeginning
Composition	Ctrl x	MoveCursorToEnd
Composition	Ctrl z	Cancel
Composition	Delete	Delete
Composition	Down	MoveCursorToEnd
Composition	Eisu	ToggleAlphanumericMode
Composition	End	MoveCursorToEnd
Composition	Enter	Commit
Composition	ESC	Cancel
Composition	F10	ConvertToHalfAlphanumeric
Composition	F2	ConvertWithoutHistory
Composition	F6	ConvertToHiragana
Composition	F7	ConvertToFullKatakana
Composition	F8	ConvertToHalfWidth
Composition	F9	ConvertToFullAlphanumeric
Composition	Hankaku/Zenkaku	IMEOff
Composition	Henkan	IMEOn
Composition	Hiragana	InputModeHiragana
Composition	Home	MoveCursorToBeginning
Composition	Katakana	InputModeFullKatakana
Composition	Left	MoveCursorLeft
Composition	Muhenkan	IMEOff
Composition	Right	MoveCursorRight
Composition	Shift Backspace	Backspace
Composition	Shift ESC	Cancel
Composition	Shift Left	MoveCursorLeft
Composition	Shift Muhenkan	ConvertToFullAlphanumeric
Composition	Shift Right	MoveCursorRight
Composition	Shift Space	Convert
Composition	Space	Convert
Composition	Tab	PredictAndConvert
Conversion	Backspace	Cancel
Conversion	Ctrl a	SegmentFocusFirst
Conversion	Ctrl Backspace	Cancel
Conversion	Ctrl d	SegmentFocusRight
Conversion	Ctrl Down	CommitOnlyFirstSegment
Conversion	Ctrl e	ConvertPrev
Conversion	Ctrl Enter	Commit
Conversion	Ctrl f	SegmentFocusLast
Conversion	Ctrl g	Cancel
Conversion	Ctrl h	Cancel
Conversion	Ctrl i	ConvertToFullKatakana
Conversion	Ctrl k	SegmentWidthShrink
Conversion	Ctrl l	SegmentWidthExpand
Conversion	Ctrl Left	SegmentFocusFirst
Conversion	Ctrl m	Commit
Conversion	Ctrl n	CommitOnlyFirstSegment
Conversion	Ctrl o	ConvertToHalfWidth
Conversion	Ctrl p	ConvertToFullAlphanumeric
Conversion	Ctrl Right	SegmentFocusLast
Conversion	Ctrl s	SegmentFocusLeft
Conversion	Ctrl Shift Space	InsertFullSpace
Conversion	Ctrl Space	InsertHalfSpace
Conversion	Ctrl t	ConvertToHalfAlphanumeric
Conversion	Ctrl u	ConvertToHiragana
Conversion	Ctrl Up	ConvertPrev
Conversion	Ctrl x	ConvertNext
Conversion	Ctrl z	Cancel
Conversion	Delete	Cancel
Conversion	Down	ConvertNext
Conversion	Eisu	ToggleAlphanumericMode
Conversion	End	SegmentFocusLast
Conversion	Enter	Commit
Conversion	ESC	Cancel
Conversion	F10	ConvertToHalfAlphanumeric
Conversion	F6	ConvertToHiragana
Conversion	F7	ConvertToFullKatakana
Conversion	F8	ConvertToHalfWidth
Conversion	F9	ConvertToFullAlphanumeric
Conversion	Hankaku/Zenkaku	IMEOff
Conversion	Henkan	IMEOn
Conversion	Hiragana	InputModeHiragana
Conversion	Home	SegmentFocusFirst
Conversion	Katakana	InputModeFullKatakana
Conversion	Left	SegmentFocusLeft
Conversion	Muhenkan	IMEOff
Conversion	PageDown	ConvertNextPage
Conversion	PageUp	ConvertPrevPage
Conversion	Right	SegmentFocusRight
Conversion	Shift Backspace	Cancel
Conversion	Shift Down	ConvertNextPage
Conversion	Shift ESC	Cancel
Conversion	Shift Henkan	ConvertPrev
Conversion	Shift Left	SegmentWidthShrink
Conversion	Shift Muhenkan	ConvertToFullAlphanumeric
Conversion	Shift Right	SegmentWidthExpand
Conversion	Shift Space	ConvertPrev
Conversion	Shift Tab	ConvertPrev
Conversion	Shift Up	ConvertPrevPage
Conversion	Space	ConvertNext
Conversion	Tab	PredictAndConvert
Conversion	Up	ConvertPrev
DirectInput	Eisu	IMEOn
DirectInput	F13	IMEOn
DirectInput	Hankaku/Zenkaku	IMEOn
DirectInput	Henkan	IMEOn
DirectInput	Hiragana	IMEOn
DirectInput	Katakana	IMEOn
Precomposition	Backspace	Revert
Precomposition	Ctrl Backspace	Undo
Precomposition	Ctrl Shift Space	InsertFullSpace
Precomposition	Eisu	ToggleAlphanumericMode
Precomposition	Hankaku/Zenkaku	IMEOff
Precomposition	Hiragana	InputModeHiragana
Precomposition	Henkan	IMEOn
Precomposition	Katakana	InputModeFullKatakana
Precomposition	Muhenkan	IMEOff
Precomposition	Shift Muhenkan	ToggleAlphanumericMode
Precomposition	Shift Space	InsertAlternateSpace
Precomposition	Space	InsertSpace
Prediction	Ctrl Delete	DeleteSelectedCandidate
Suggestion	Down	PredictAndConvert
Suggestion	Shift Enter	CommitFirstSuggestion
Composition	ASCII	InsertCharacter
Composition	Kanji	IMEOff
Composition	OFF	IMEOff
Composition	ON	IMEOn
Conversion	Kanji	IMEOff
Conversion	OFF	IMEOff
Conversion	ON	IMEOn
DirectInput	Kanji	IMEOn
DirectInput	ON	IMEOn
Precomposition	ASCII	InsertCharacter
Precomposition	Kanji	IMEOff
Precomposition	OFF	IMEOff
Precomposition	ON	IMEOn

設定ファイル等

.bash_aliases

~/.bash_aliasesに以下を追加.

~/.bash_aliases
alias pbcopy='xsel --clipboard --input'
alias pbpaste='xsel --clipboard --output' 
alias op='xdg-open'
alias gits='git status'
alias dc='docker-compose'

$ source ~/.bashrc等も忘れず.

.vimrc

~/.vimrcを作成して以下を記述.

~/.vimrc
" setting https://qiita.com/morikooooo/items/9fd41bcd8d1ce9170301
"文字コードをUFT-8に設定
set fenc=utf-8
" バックアップファイルを作らない
set nobackup
" スワップファイルを作らない
set noswapfile
set nowb
" 編集中のファイルが変更されたら自動で読み直す
set autoread
" バッファが編集中でもその他のファイルを開けるように
set hidden
" 入力中のコマンドをステータスに表示する
set showcmd


" 見た目系
" 行番号を表示
set number
" 現在の行を強調表示
set cursorline
" 現在の行を強調表示(縦)
set cursorcolumn
" 行末の1文字先までカーソルを移動できるように
set virtualedit=onemore
" インデントはスマートインデント
set smartindent
" 括弧入力時の対応する括弧を表示
set showmatch
" ステータスラインを常に表示
set laststatus=2
" コマンドラインの補完
set wildmode=list:longest
" 折り返し時に表示行単位での移動できるようにする
nnoremap j gj
nnoremap k gk
" シンタックスハイライトの有効化
if &t_Co > 1
  syntax enable
endif


" Tab系
" 不可視文字を可視化(タブが「▸-」と表示される)
set list listchars=tab:\▸\-
" Tab文字を半角スペースにする
set expandtab
" 行頭以外のTab文字の表示幅(スペースいくつ分)
set tabstop=2
" 行頭でのTab文字の表示幅
set shiftwidth=2


" 検索系
" 検索文字列が小文字の場合は大文字小文字を区別なく検索する
set ignorecase
" 検索文字列に大文字が含まれている場合は区別して検索する
set smartcase
" 検索文字列入力時に順次対象文字列にヒットさせる
set incsearch
" 検索時に最後まで行ったら最初に戻る
set wrapscan
" 検索語をハイライト表示
set hlsearch
" ESC連打でハイライト解除
nmap <Esc><Esc> :nohlsearch<CR><Esc>

" https://ryonakagami.github.io/2021/04/27/ubuntu-vim-tutorial/
" no beep
set noerrorbells

set ai "Auto indent
set si "Smart indent
set wrap "Wrap lines

" set no bom
set nobomb

その他設定等

ibus-setup のショートカットキー解除

デフォルトだとCtrl+Shift+Eに絵文字?の機能のショートカットキーが割り当てられており, VSCode等のショートカットキーを上書きしてしまうため解除する. $ ibus-setupで設定画面を開き, 「絵文字」タブからショートカットキーを削除する.

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?