ロリポップのSSH接続でviの文字化けを解消する

低価格大容量でナウなヤングに人気のレンタルサーバー、ロリポップ。
チカッパプランでは、SSH接続もできて便利そうなので試しに借りてみました。

レンタルサーバー会社によっては、SSH接続はできても使えるコマンドが厳しく制限されていたり、公開鍵認証が使えなかったりと、思うように使えないこともよくあります。(最近だとサーバーカウボーイがそうだった)
ロリポップは、2週間のお試し期間があるのでその点安心です。公開鍵認証もGitも使えるので、正式利用することにしました。

が、ファイルを編集してみようとすると日本語部分が文字化けします。
どうやら、サーバーのエンコーディングがEuc-JPになっているようです。
WordPressを始め、最近のWebアプリ事情はUTF-8が基本なので、ここもそれに合わせましょう。

ログインしたところ、ユーザーのホームディレクトリに、.vimrcを新しく設置します。

$ vi .vimrc
syntax on
set nobackup
set termencoding=utf-8
set encoding=utf-8
set fileencoding=utf-8
set fileencodings=iso-2022-jp,euc-jp,utf-8,ucs2le,ucs-2

これでファイルの編集、保存も問題なくできるようになりました。

9 thoughts on “ロリポップのSSH接続でviの文字化けを解消する

  1. ピンバック: エックスサーバーにインストールした vim が文字化けする場合の対処法 | MacBook Air とWordPressでこうなった

  2. AlexisBrums

    Brevity is the key.
    Here’s a classic Japanese saying for you.
    Another example comes from Spider-Man, where Uncle Ben turns to Peter Parker and says, With great power comes great responsibility.
    Like George Washington, Sandys believed that telling the truth is always the way to go.
    He once stated, If you want a thing done well, do it yourself.
    The Purpose & Function of Aphorism
    Your stories can benefit from this method too.
    Curiosity killed the cat.
    If you do, you agree with George Herbert’s famous aphorism from his book, Outlandish Proverbs.
    Speaking of being safe, that’s another aphorism example that you’ve probably heard before.
    Michael Corleone from The Godfather II disagreed with that.
    Aphorism Examples in Everyday Speech
    The complete quote was, A Jack of all trades and master of none, but oftentimes better than a master of one.
    (I say these words to make me glad),
    For example.
    Don’t judge a book by its cover.

    返信
  3. cbd store

    Have you tried the untrained item bar product? I’m unshakable you can devise the veracious mood with our CBD pen. Made with clear cannabis oil extracted from organically grown hemp, our CBD grease vaporizer trappings is suitable in compensation anyone who is agog or needs help to impassive down and focus. If in a trice this mechanism does not stop working, then devise advise you, the actions that you have occasion for to do are described in detail.

    返信
  4. Dab rigs

    I walked into the headshop with a implicate of meddlesomeness and trepidation. The walls were lined with shelves and pageantry cases filled with colorful pipes, bongs, and other smoking accessories. The air was solid with the batty about bon-bon pong of incense, and reggae music played softly in the background. A chummy saleslady greeted me and asked if I needed mitigate verdict anything. I admitted that I was a crumb overwhelmed during the set, and he offered to show me some of their best-selling items. As he pulled gone from a lustrous, silverware vaporizer, he explained how it worked and the benefits of using it throughout time-honoured smoking methods. He also showed me a variety of flavored rolling papers and a grinder with a cool design. I ended up leaving with a occasional items, sensibility disconcerted to go exposed my fresh purchases. The judgement had been surprisingly enjoyable, and I was impressed by way of the knowledgeable and friendly staff. I couldn’t hang on to report in back and enquire into more of what the headshop had to offer.

    返信

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です