LoginSignup
0
0

More than 3 years have passed since last update.

Kubuntu18.04インストール後の環境を整える

Last updated at Posted at 2020-05-07

何の話か

Kubuntuを導入する際に個人的に必ず行う最低限の設定やツールなど環境整備の事例についてです。
普段のエディタはviです。

homeの日本語ディレクトリを英語化

日本語を選んでインストールしたあとディレクトリだけは英語化
ubuntuの場合は普通にLANG=C xdg-user-dirs-gtk-updateで良いがkubuntuの場合は

LANG=C xdg-user-dirs-update --force

sshサーバ

sudo apt install -y openssh-server

公開鍵id_rsa.pub~/.ssh配下に置く

net-tools

手がコマンドを覚えているのでこれがないと暮らせない

sudo apt install net-tools

vim

標準でも入っているがtiny版なのでpluginもいろいろはいっているHuge版をインストール

sudo apt install vim

Plugin管理はVundleで

参照:Vundle Quick Start

git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

~/.vimrcに以下を記述
これもVundle Quick Startどおりにまず.vimrcに記述

~/.vimrc
set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

" ここ以下に導入したいpluginを書いていくgithubのAuthor/Github repoの形式
Plugin 'airblade/vim-gitgutter'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'scrooloose/nerdtree'

その後、viを立ち上げて

:PluginInstall

を実行する
Vundleの他のコマンド

:PluginList       - lists configured plugins
:PluginInstall    - installs plugins; append `!` to update or  :PluginUpdate
:PluginSearch foo - searches for foo; append `!` to refresh local cache
:PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal

Escの代わりにjjでコマンドモードに移行する設定

これ必須ですね

~/.vimrc
inoremap <silent> jj <ESC>

jq

最近はこれも必要

sudo apt install jq

参考:忘れがちなaptコマンド

環境整備の話ではないですが参考まで。
apt update/upgrade/installはひたすら打つのだけど以下はあまり使わないので忘れがち。

コマンド 動作
sudo apt remove (パッケージ名) パッケージ削除
sudo apt remove --purge (パッケージ名) パッケージ完全削除
sudo apt show (パッケージ名) パッケージ詳細情報表示
sudo apt list (パッケージ名) パッケージ検索(完全一致)
sudo apt search (パッケージ名) パッケージ検索(部分一致)
sudo dpkg -l インストール済パッケージ一覧表示

補足:インストールログは /var/log/apt/history.loghistory.log.1.gzなどにあり。

grep Commandline history.log
zcat history.log.1.gz |grep Commandline
などで検索すると見やすい。

0
0
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
0
0