Skip to content

Instantly share code, notes, and snippets.

@3panda
Created May 3, 2020 01:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 3panda/40e0f59859d02082075f068f3eade955 to your computer and use it in GitHub Desktop.
Save 3panda/40e0f59859d02082075f068f3eade955 to your computer and use it in GitHub Desktop.
Ubuntu 18.04 にNeovim Iinstall

Ubuntu 18.04 にNeovim Iinstall

https://github.com/neovim/neovim/wiki/Installing-Neovim#ubuntu

バージョンが少し古くdeopleteが使えないので

ppaを登録 参考 https://launchpad.net/~neovim-ppa/+archive/ubuntu/stable

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:neovim-ppa/stable
sudo apt-get update
sudo apt-get install neovim

正しくインストール出来ているの確認

which nvim
nvim --version

Neovimを起動して確認

nvim

https://qiita.com/ryo2132/items/7d4e4bbf0654c6874697

Neovimのコマンドモードで

:echo has('python3')

1 が返ればOK。 0 が返ってきた場合はPythonのnvimモジュールが正しくインストールされていない可能性がある

C++のコード補完

これを参考に http://kutimoti.hatenablog.com/entry/2018/05/20/110732

http://mojelder.hatenablog.com/entry/clang01

pip3はneovimではなくpynvim

sudo -H pip3 install pynvim

C++のコンパイル

C++のコンパイル こういしないとコンパイルが通らない

g++ -o main001 main001.cpp

インサートモードからノーマルモードで無変換に戻せない問題の解決

Mozcのキー設定に以下追加

モード:入力文字なし
入力キー:Ctr `
コマンド:キャンセル後IMEを無効化

xvkbdのインストール

sudo apt install -y xvkbd

次に init.vimに以下を追加する

Ctrl + ` でのIMIを無効にする

if has('unix')
  inoremap <silent><Esc> <Esc>:silent call system('xvkbd -text "\C\[grave]" > /dev/null 2>&1')<CR>
  if has('gui_running') " ターミナルでカーソル・キーで履歴が辿れなくなる--
    cnoremap <silent><Esc> <Esc>:silent call system('xvkbd -text "\C\[grave]" > /dev/null 2>&1')<CR>
  endif
endif

neovim 上でヤンクした内容をクリップボードに保存

https://qiita.com/gotchane/items/0e7e6e0d5c7fa9f55c1a

xclipのインストール

sudo apt install -y xclip

https://linuxfan.info/xclip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment